Skip to content

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

Draft
ramonsmits wants to merge 1 commit into
search-engine-rebuilt-indexesfrom
search-engine-locked-index-reporting
Draft

ramonsmits wants to merge 1 commit into
search-engine-rebuilt-indexesfrom
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, because definition changes from new versions are not applied to it
  • an error for a locked index whose definition changed, because the change is not applied until the operator unlocks the index

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.

@ramonsmits
ramonsmits added this pull request to stack #6037 October 20, 2026 15:00
@ramonsmits
ramonsmits force-pushed the search-engine-locked-index-reporting branch from 532637c to 48c4a37 Compare October 20, 2026 15:02
}
else
{
Logger.LogWarning("Index {IndexName} is locked ({LockMode}). Definition changes from new versions are not applied until the index is unlocked", index.IndexName, existing.LockMode);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As is, this message could raise support questions for no good reason. What about:

Suggested change
Logger.LogWarning("Index {IndexName} is locked ({LockMode}). Definition changes from new versions are not applied until the index is unlocked", index.IndexName, existing.LockMode);
Logger.LogWarning("Index {IndexName} is locked ({LockMode}). This version of ServiceControl doesn't contain index changes. Definition changes from new versions are not applied until the index is unlocked", index.IndexName, existing.LockMode);

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.

Agreed, however, I would try to make it shorter...

Something like "Index XX is locked but definition is full compatible"?

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.
{
if (changed)
{
Logger.LogError("Index {IndexName} is locked ({LockMode}) and its definition changed ({Changes}). The change is not applied until the index is unlocked", index.IndexName, existing.LockMode, changes);

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.

@mauroservienti and I have discussed that maybe it is even better to throw an exception here as some part of application depends on this change. If this part is not critical then maybe its not that important to throw but we align on that we should throw here.

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.

2 participants