Query the staging retry batch through the static index - #5953
Open
ramonsmits wants to merge 1 commit into
Open
ramonsmits wants to merge 1 commit into
ramonsmits wants to merge 1 commit into
Conversation
GetStagingBatch ran a dynamic query on RetryBatches filtered by Status. RavenDB serves that with an Auto/RetryBatches/ByStatus index. The retry processor calls it on every cycle, so the auto index exists on every error database. An auto index has no per-index search engine setting, so the "Error Database Search Engine" custom check keeps failing after all static indexes are migrated to Lucene. RetryBatches_ByStatusAndSession already maps Status. Query through it.
mauroservienti
approved these changes
Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The staging query of the retry processor now uses the static index
RetryBatches_ByStatusAndSession. Before, it was a dynamic query. RavenDB created the auto indexAuto/RetryBatches/ByStatusfor it on every error database.Analysis
RetryStagingStore.GetStagingBatchransession.Query<RetryBatch>()with a filter onStatus, without a static index. The query has been dynamic since the first version of group retries in 2015.GetStagingBatchon every processing cycle. The auto index is created seconds after the database is created, also when the collection is empty.Indexing.Auto.SearchEngineType. It has no per-index search engine setting. The migration procedure in the docs changes the engine per index, so it cannot change this index.Error Database Search Enginecustom check and the start-up warning list all indexes, auto indexes included. After all static indexes use Lucene, the check still fails because ofAuto/RetryBatches/ByStatus. Found in the smoke test of 6.21.1 for Migrated Lucene indexes are reset to Corax at start-up when the index is not locked #5948.Changes
RetryStagingStore.GetStagingBatchqueries throughRetryBatches_ByStatusAndSession. That index already mapsStatus.RetryStagingStoreIndexTests.Getting_the_staging_batch_creates_no_auto_index(RavenDB). It fails on the old query and passes on the new one.Existing databases
Indexing.TimeToWaitBeforeDeletingAutoIndexMarkedAsIdleInHrs). It can also be deleted in the Studio.Testing
ServiceControl.Persistence.Tests.RavenDB, filterRetryStagingStore: 14/14 in Release.