Open dakrone opened 1 year ago
Pinging @elastic/es-core-infra (Team:Core/Infra)
The reason this assertion is tripping is because ClusterChangedEvent.indexMetadataChanged
uses reference equality test - the identity has changed - but the next bit of code to run in IndexService.updateMetadata
uses a value equality test - no settings have actually changed. So the index service gets confused as to why it has actually been called, the version has updated, but no settings have changed.
So the best thing to do here might be to just remove these assertions - its ok for the settings version to increment without anything changing. But this is more distributed's area, so pinging them for a second opinion
Pinging @elastic/es-distributed (Team:Distributed)
It has been suggested that we reject attempts to set the number of replicas while auto_expand_replicas
is in play: https://github.com/elastic/elasticsearch/issues/27835. I think that's the only way you can hit this. I even opened a PR to show how we could deprecate that behaviour in https://github.com/elastic/elasticsearch/pull/73230. I'd prefer that we at least ignore updates to number_of_replicas
in this situation rather than accepting them and then reverting them, and leave the assertion alone, but I would be ok with weakening the assertion in this situation too. I'd rather not remove it tho.
That said, this is definitely a :Core/Infra/Settings
question IMO
@DaveCTurner This doesn't seem to have to do with the specific settings set in this issue, but in general with how the settings differences are calculated, as @thecoop noted. Since the assertions in question live in IndexService, it seems to me to be more of a question for the Distributed team, though this is probably a gray area. Are you comfortable removing the assertions?
@rjernst @DaveCTurner Would it help if I add another reproduction case here?
Namely, trying to modify a data stream to replace an existing backing index with a downsample index will run into this problem as well (https://github.com/elastic/elasticsearch/pull/91141/files#diff-3525330b076f1366498e871381f6f4a3fe7e0127b55e863227a3b98cf29d7e6cR128 )
The workaround is not great https://github.com/elastic/elasticsearch/pull/91141/files#diff-3525330b076f1366498e871381f6f4a3fe7e0127b55e863227a3b98cf29d7e6cR110
Is there any update on this? It still reproduces on main
.
Elasticsearch Version
8.8.0-SNAPSHOT
Installed Plugins
No response
Java Version
bundled
OS Version
n/a
Problem Description
It's possible to cause an assert failure by putting the same index settings into an index twice.
Steps to Reproduce
When running on the
main
branch, with./gradlew run
(so that asserts are enabled), it is possible to easily crash Elasticsearch with the following:Putting the same settings in twice causes this assertion to trip:
Logs (if relevant)
No response