Skip to content

Prevent infinite loop on search index error - #6127

Draft
dpitera wants to merge 1 commit into
apache:mainfrom
dpitera:prevent-infinite-retry
Draft

dpitera wants to merge 1 commit into
apache:mainfrom
dpitera:prevent-infinite-retry

Conversation

@dpitera

@dpitera dpitera commented Sep 23, 2026

Copy link
Copy Markdown

When CouchDB and Clouseau get out of sync,
ken_server enters an infinite resubmit loop.
Every 5 seconds it resubmits the affected shard, which respawns the dreyfus index updater, which fails again, causing sustained text_search_error 500s for all _find queries against that database with
no recovery path.

To fix this, we limit the max number of retries to a configurable number, defaulting to 5 in this commit.

This commit does not address the root cause of the "out of sync" behavior between Couch and Clouseau; rather it simply mitigates customer impact and does not infinitely retry.

Issues: https://github.ibm.com/cloudant/dbcore/issues/724

Overview

Testing recommendations

Related Issues or Pull Requests

Checklist

  • This is my own work, I did not use AI, LLM's or similar technology
  • Code is written and works correctly
  • Changes are covered by tests
  • Any new configurable parameters are documented in rel/overlay/etc/default.ini
  • Documentation changes were made in the src/docs folder
  • Documentation changes were backported (separated PR) to affected branches

@dpitera
dpitera marked this pull request as draft September 23, 2026 23:28
When CouchDB and Clouseau get out of sync,
ken_server enters an infinite resubmit loop.
Every 5 seconds it resubmits the affected shard, which respawns the
dreyfus index updater, which fails again, causing sustained
text_search_error 500s for all _find queries against that database with
 no recovery path.

To fix this, we limit the max number of retries to a configurable
number, defaulting to 5 in this commit.

Note: the retry limit applies to all index types and not just search.

Note: we use a new table with an independent lifecycle to ensure we
preserve the intent of the code beforehand: skip_job should not block a
live job.

This commit does not address the root cause of the "out of sync"
behavior between Couch and Clouseau; rather it simply mitigates
customer impact and does not infinitely retry.

Issues: https://github.ibm.com/cloudant/dbcore/issues/724
@dpitera
dpitera force-pushed the prevent-infinite-retry branch from d1948fb to 1253a4b Compare September 24, 2026 04:10
@rnewson

rnewson commented Sep 28, 2026

Copy link
Copy Markdown
Member

"When CouchDB and Clouseau get out of sync, the current behavior is to retry infinitely"

Please describe how this happens?

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

Successfully merging this pull request may close these issues.

2 participants