Cluster state and versions - when should we increment which version and how often? #14158
Labels
discuss
:Distributed Coordination/Discovery-Plugins
Anything related to our integration plugins with EC2, GCP and Azure
While reviewing #14062 I found it somewhat difficult to reason about which version is incremented when in the cluster state. I open this issue to summarize how I think versions work right now and to maybe get some feedback on how this can be handled in a more easy to understand way.
This is the version numbers we maintain:
MetaData
version:IndexMetaData
version:IndexMetaData.Builder.version(..)
and where it is called.RoutingTable
versionAllocationService.buildChangedResult(..)
.ShardRouting
s. It is updated when a singleShardRouting
changes during allocation and then copied over to allShardRouting
s from the same copy inIndexRoutingTable.normalizeVersions()
once allocation has finished.Q: Cluster state version and
MetaData
version are updated only once per cluster state update task but the others are not or at least it is not immediately clear if they can potentially be incremented by > 1. It it OK ifIndexMetaData
version,RoutingTable
version and shard version increment by more than one between cluster states?While I think I understand why we do versioning now the way we do it I find it cumbersome to read and wonder if there is a cleaner way to maintain these versions.
For example: we only need the version increments before master sends the new cluster state to the other nodes. Can we build a new cluster state without incrementing any version in any of the components and then here check the difference between new and old cluster state and update all versions in one go? This would leave no questions open about when versions are updated and where. Chatted very briefly with @s1monw who thinks this will add complexity and not remove any but I have not yet given up hope and will give it a shot.
Any kind of feedback is more than welcome.
The text was updated successfully, but these errors were encountered: