Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continue pre-indexing other views when a view was not found #19

Open
1yuv opened this issue Jun 10, 2024 · 1 comment
Open

Continue pre-indexing other views when a view was not found #19

1yuv opened this issue Jun 10, 2024 · 1 comment

Comments

@1yuv
Copy link
Member

1yuv commented Jun 10, 2024

It has been seen that couchdb pre-indexing views fails occasionally due to missing or deleted views.

An unexpected error occurred HTTPResponseError: HTTP Error Response: 504 Gateway Time-out
    at Object.request (/app/src/utils.js:110:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async indexView (/app/src/pre-index-views.js:91:14)
    at async Promise.all (index 6)
    at async indexStagedDdocs (/app/src/pre-index-views.js:116:3)
    at async preIndexViews (/app/src/pre-index-views.js:125:3)
    at async /app/bin/pre-index-views.js:13:5 {
  response: Response {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
    [Symbol(Response internals)]: {
      url: 'http://medic/:@haproxy:5984/medic/_design/:staged:medic/_view/messages_by_state?limit=0',
      status: 504,
      statusText: 'Gateway Time-out',
      headers: [Headers],
      counter: 0
    }
  },
  status: 504
}

The manul process on this case at the moment is to restart preindex views and it will resume from previous point. For larger migrations, it takes many hours to complete preindex views. It's not convinient that you figure out preindex views failed due to missing view and you have to restart.

Proposed solution:

  1. Continue indexing other views if a particular view is not found
  2. Log at the end of the process which views were not preindexed.
@dianabarsan
Copy link
Member

A gateway timeout is probably not an error that we should just ignore. This can mean that the service we're connected to has crashed, and the state has changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants