Skip to content

Conversation

@original-brownbear
Copy link
Contributor

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.0 for now and then do the complete backport of #46250 in one go later to reduce the noise from this change.

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
@original-brownbear original-brownbear added >non-issue :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.0.0 labels Sep 19, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

return nodeId;
}

public String generation() {
Copy link
Contributor Author

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",
Copy link
Contributor Author

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.

Copy link
Member

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?

@original-brownbear
Copy link
Contributor Author

@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.

Copy link
Member

@tlrx tlrx left a 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.0 for 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.

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",
Copy link
Member

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?

@original-brownbear
Copy link
Contributor Author

Jenkins run elasticsearch-ci/1 (dep. download fail)

@original-brownbear
Copy link
Contributor Author

Thanks Tanguy

found this change surprisingly simple :)

Yea the CS + network/serialization code is a lot cleaner than the code around RepositoryData making this the nice part :D Will do my best with the repository side of things in the follow up though :)

@original-brownbear original-brownbear merged commit f11a3c2 into elastic:master Sep 23, 2019
@original-brownbear original-brownbear deleted the send-new-shard-gen-via-network-for-46250 branch September 23, 2019 15:28
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Oct 23, 2019
* 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
mkleen added a commit to crate/crate that referenced this pull request Jun 23, 2020
mkleen added a commit to crate/crate that referenced this pull request Jun 23, 2020
mkleen added a commit to crate/crate that referenced this pull request Jun 23, 2020
mkleen added a commit to crate/crate that referenced this pull request Jun 23, 2020
mkleen added a commit to crate/crate that referenced this pull request Jun 23, 2020
mkleen added a commit to crate/crate that referenced this pull request Jun 23, 2020
mkleen added a commit to crate/crate that referenced this pull request Jun 23, 2020
mkleen added a commit to crate/crate that referenced this pull request Jun 23, 2020
mkleen added a commit to crate/crate that referenced this pull request Jun 23, 2020
mkleen added a commit to crate/crate that referenced this pull request Jun 23, 2020
mkleen added a commit to crate/crate that referenced this pull request Jun 23, 2020
mergify bot pushed a commit to crate/crate that referenced this pull request Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants