[BUG] [Remote State] Cluster chaining can break if there is consecutive node replace and restart #10841
Labels
bug
Something isn't working
Cluster Manager
Storage:Remote
Storage
Issues and PRs relating to data and metadata storage
v2.12.0
Issues and PRs related to version 2.12.0
Describe the bug
Cluster chaining can break if there is consecutive node replace and restart
To Reproduce
Step for single node cluster
Bootstrap single node
No local disk state found
No remote disk state found
Cluster Manager Election success
First cluster uuid formed -
uuid_1
First pre-publish - write
Metadata
to remoteFirst publish - write
Metadata
to disk with clusterUUIDuuid_1
andclusterUUIDCommitted
asfalse
First pre-commit - write
Metadata
to remote with clusterUUIDuuid_1
andclusterUUIDCommitted
astrue
first commit - write
Metadata
to local disk with clusterUUID commmitted trueTerminate the node and replace with a new one so that all local disk state is lost
Bootstrap new replacement node
No local disk state found, hence no cluster uuid.
Go to remote for latest state.
Found
Metadata
in remote with clusterUUIDuuid_1
andclusterUUIDCommitted
astrue
Construct
ClusterState
from remoteMetadata
with clusterUUIDClusterState.UNKNOWN_UUID
andclusterUUIDCommitted
asfalse
.Write new
ClusterState
to disk with clusterUUIDClusterState.UNKNOWN_UUID
andclusterUUIDCommitted
asfalse
.Cluster Manager Election success
New cluster uuid formed -
uuid_2
Pre publish - write to remote with clusterUUID
uuid_2
andclusterUUIDCommitted
asfalse
.Publish - write to local disk with clusterUUID
uuid_2
andclusterUUIDCommitted
asfalse
.Kill process on the node.
Process restarts and local disk state is found with clusterUUID
uuid_2
andclusterUUIDCommitted
asfalse
.Don't go to remote as clusterUUID is not
ClusterState.UNKNOWN_UUID
.lastKnownClusterUUID remains
ClusterState.UNKNOWN_UUID
and RemotePersistedState is initialized withpreviousClusterUUID
asClusterState.UNKNOWN_UUID
.First pre-commit after this will write state to remote by calling
RemotePersistedState.setLastAcceptedState
. This will write new ClusterState to remote with previousClusterUUID asClusterState.UNKNOWN_UUID
OpenSearch/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java
Lines 165 to 189 in 9b7a9d0
Expected behavior
previousClusterUUID
chaining should not break in any case.The text was updated successfully, but these errors were encountered: