-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Track Shard Snapshot Generation in CS #46864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track Shard Snapshot Generation in CS #46864
Conversation
Adds communication of new shard generations from datanodes to master and tracking of those generations in the CS. This is a preliminary to elastic#46250
|
Pinging @elastic/es-distributed |
| return nodeId; | ||
| } | ||
|
|
||
| public String generation() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracking the generation here as well as via the String callback to have it available for retries of shard status updates on e.g. master failover in SnapshotShardsService.
| if (primary == null || !primary.assignedToNode()) { | ||
| builder.put(shardId, | ||
| new SnapshotsInProgress.ShardSnapshotStatus(null, ShardState.MISSING, "primary shard is not allocated")); | ||
| new SnapshotsInProgress.ShardSnapshotStatus(null, ShardState.MISSING, "primary shard is not allocated", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing null for the generations for now since we don't know them when starting a shard snapshot yet. #46250 will make use of the ability to pass the shard-generation via the CS by determining the initial shard gen values from the repositories' RepositoryData here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok - Maybe add a comment that will be later removed?
…-via-network-for-46250
…-via-network-for-46250
|
@tlrx let me know what you think about this for an increment here :) Obviously it's a little artificial to track the shards' generations here without using them though on the bright side it makes debugging things a little easier in isolation sine we get an additional bit of synchronization between the master and the data nodes. |
tlrx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I had to run the code a bit to validate my understanding because I found this change surprisingly simple :) I left minor comments.
@tlrx let me know what you think about this for an increment here :)
That's good for me. Thanks for splitting things as it makes things much more easier to review.
I would only merge it to
master/8.0for now and then do the complete backport of #46250 in one go later to reduce the noise from this change.
+1 too. Don't forget the backport pending label.
server/src/main/java/org/elasticsearch/index/snapshots/IndexShardSnapshotStatus.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java
Outdated
Show resolved
Hide resolved
| if (primary == null || !primary.assignedToNode()) { | ||
| builder.put(shardId, | ||
| new SnapshotsInProgress.ShardSnapshotStatus(null, ShardState.MISSING, "primary shard is not allocated")); | ||
| new SnapshotsInProgress.ShardSnapshotStatus(null, ShardState.MISSING, "primary shard is not allocated", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok - Maybe add a comment that will be later removed?
test/framework/src/main/java/org/elasticsearch/index/shard/IndexShardTestCase.java
Show resolved
Hide resolved
…-via-network-for-46250
|
Jenkins run elasticsearch-ci/1 (dep. download fail) |
|
Thanks Tanguy
Yea the CS + network/serialization code is a lot cleaner than the code around |
* Track Shard Snapshot Generation in CS Adds communication of new shard generations from datanodes to master and tracking of those generations in the CS. This is a preliminary to elastic#46250
Adds communication of new shard generations from datanodes to master
and tracking of those generations in the CS.
This is a preliminary to #46250 extracted to a separate PR for simpler review => I would only merge it to
master/8.0for now and then do the complete backport of #46250 in one go later to reduce the noise from this change.