Skip to content

Retry processor runs a dynamic query that creates the auto index Auto/RetryBatches/ByStatus #5960

Closed

Description

@ramonsmits

Describe the bug

The retry processor runs a dynamic query. RavenDB creates an auto index for it. ServiceControl must only use its own static indexes, so this auto index must never exist.

RetryStagingStore.GetStagingBatch runs session.Query<RetryBatch>() with a filter on Status and no static index. RavenDB serves the query with the auto index Auto/RetryBatches/ByStatus. The retry processor calls GetStagingBatch on every processing cycle, so the auto index appears seconds after the error database is created, also when the RetryBatches collection is empty. Every error database has it.

The query has been dynamic since group retries were added in July 2015 (ServiceControl 1.6.0). The static index RetryBatches_ByStatusAndSession already maps Status, so the auto index is not needed.

Why this is a bug:

  • ServiceControl deploys and manages its index definitions at start-up. An auto index is outside that control. It is created at run time with the database defaults of that moment, and RavenDB can mark it idle and delete it. This gives an index set that differs per installation and over time.
  • Every index costs disk space, memory and indexing work on each write to the RetryBatches collection.
  • Side effect since 6.20.0: the Error Database Search Engine custom check and the start-up warning list all indexes that use Corax. An auto index has no per-index search engine setting, so the per-index migration procedure cannot change it. The check keeps failing after all static indexes use Lucene.

Steps to reproduce

  1. Create an error database with ServiceControl, any version with RavenDB persistence.
  2. Start the primary instance.
  3. Open the index list in RavenDB Studio. Auto/RetryBatches/ByStatus is present next to the static indexes.

Relevant log output

Side effect on 6.20.0 and 6.21.0 after all static indexes were migrated to Lucene:

Warn|ServiceControl.RavenDB.StartupChecks|The following RavenDB index(es) use the Corax search engine: Auto/RetryBatches/ByStatus. ...

Additional Information

Activity

  1. changed the title [-]Retry processor creates the auto index Auto/RetryBatches/ByStatus which cannot be migrated to Lucene[/-] [+]Retry processor runs a dynamic query that creates the auto index Auto/RetryBatches/ByStatus[/+] on Oct 6, 2026
  2. ramonsmits commented on Oct 6, 2026

    @ramonsmits
    MemberAuthor

    Is fixed in 6.21.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions