Skip to content

Report locked indexes and index rebuilds at start-up - #6036

Merged
ramonsmits merged 7 commits into
masterfrom
search-engine-locked-index-reporting
Nov 5, 2026
Merged

ramonsmits merged 7 commits into
masterfrom
search-engine-locked-index-reporting

Conversation

@ramonsmits

@ramonsmits ramonsmits commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Partially addresses:

IndexDeployment now logs what it decides at start-up:

  • one line per database with its static index search engine setting, or that none is set
  • one line per index with the engine it uses and whether the engine is set on the index or inherited from the database
  • a warning for each index that RavenDB rebuilds because its definition changed, with the differences that cause the rebuild
  • a warning for a locked index whose definition is unchanged
  • an error for a locked index whose definition changed. Setup then fails with an exception that names the locked indexes, because the change is not applied until the operator unlocks the index. Before, a LockedIgnore index started silently with the old definition, and a LockedError index failed with a RavenDB exception.

Not included, left for #6015: the number of documents the rebuild covers, a setting that refuses a rebuild at start-up, and the same information in ServiceControl Management before the upgrade.

mauroservienti added a commit that referenced this pull request Oct 21, 2026
Add an ADR for the decisions in #6034, #6035, #6036 and #6013: ServiceControl
no longer writes search engine settings to existing databases, picks the
engine of each new or rebuilt index, and reports and approves index
definition changes. Link it from the engineering context index.
@danielmarbach
danielmarbach force-pushed the search-engine-locked-index-reporting branch from 48c4a37 to 69e09b9 Compare October 28, 2026 12:15
@ramonsmits
ramonsmits marked this pull request as ready for review November 2, 2026 11:04
@ramonsmits
ramonsmits force-pushed the search-engine-locked-index-reporting branch from de22afd to 1595aee Compare November 2, 2026 11:12
@danielmarbach
danielmarbach force-pushed the search-engine-locked-index-reporting branch from 1595aee to 0687ac2 Compare November 4, 2026 14:07
Base automatically changed from search-engine-rebuilt-indexes to master November 4, 2026 15:33
@ramonsmits
ramonsmits force-pushed the search-engine-locked-index-reporting branch from 0687ac2 to d5163c1 Compare November 4, 2026 15:38
@danielmarbach
danielmarbach force-pushed the search-engine-locked-index-reporting branch from d5163c1 to 3112532 Compare November 4, 2026 15:49
@ramonsmits
ramonsmits force-pushed the search-engine-locked-index-reporting branch 2 times, most recently from d9c3fd9 to 51036cd Compare November 4, 2026 16:05
}

var definedIsLucene = IsLucene(definedSearchEngineType);
Logger.Log(definedIsLucene ? LogLevel.Information : LogLevel.Warning, "Index {IndexName} uses the {SearchEngineType} search engine set in its definition{Note}", index.IndexName, definedSearchEngineType, definedIsLucene ? "" : ". ServiceControl supports only Lucene");

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielmarbach I guess the intent here is to report if an index has has a (un)supported search engine type. I think I'm ok with these having the same log template for both states but with a different log level just as is happening later in the code . I'm not sure that if we would have used log tempates

Not a fan of the {Note} as its a log template argument but nothing really against it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ramonsmits if you prefer, else that's also fine. I care mostly about the other small improvements

@ramonsmits

Copy link
Copy Markdown
Member Author

CI keeps failing, create CI fix:

@danielmarbach
danielmarbach force-pushed the search-engine-locked-index-reporting branch from 0a30bfe to 26b8432 Compare November 5, 2026 10:03
@ramonsmits
ramonsmits merged commit 2f91157 into master Nov 5, 2026
36 checks passed
@ramonsmits
ramonsmits deleted the search-engine-locked-index-reporting branch November 5, 2026 10:28
danielmarbach added a commit that referenced this pull request Nov 5, 2026
* Record the RavenDB index search engine and rebuild decision

Add an ADR for the decisions in #6034, #6035, #6036 and #6013: ServiceControl
no longer writes search engine settings to existing databases, picks the
engine of each new or rebuilt index, and reports and approves index
definition changes. Link it from the engineering context index.

* Cut unnecessary redundancy which is already context in the PRs

---------

Co-authored-by: Daniel Marbach <danielmarbach@users.noreply.github.com>
danielmarbach added a commit that referenced this pull request Nov 5, 2026
(cherry picked from commit 2f91157)

Co-authored-by: Daniel Marbach <danielmarbach@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants