Skip to content

Fix ShardGenerations in RepositoryData in BwC Case #48920

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

Merged

Conversation

original-brownbear
Copy link
Member

@original-brownbear original-brownbear commented Nov 9, 2019

We were tripping the assertion that the makes sure we only have empty ShardGenerations in RepositoryData in the BwC case because shard generations were passed to the Repository in the BwC case. Fixed by only generating empty shard gen for BwC snapshots in SnapshotsService.

Example failure: https://gradle-enterprise.elastic.co/s/p4gcla5uzwqxc/tests/by5gldejueyv2-jascz2copdfni

This assertion doesn't actually work, we don't have any
guards against setting up the actual `ShardGenerations` object
upstream in `SnapshotsService` that makes this work.
The reason this didn't fail in BwC tests was that in most cases BwC
runs continue to run with an old version master in the 2/3 upgraded
case so a situation where the master and one data node are upgraded
and put a generation into the generations object didn't come up.
@original-brownbear original-brownbear added >test Issues or PRs that are addressing/adding tests :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.0.0 v7.6.0 labels Nov 9, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore)

@ywelsch
Copy link
Contributor

ywelsch commented Nov 11, 2019

I would prefer to keep the assertion and adapt the call sites. I think this just needs adapting SnapshotService.buildGenerations to first do

if (snapshot.useShardGenerations()) {
    return ShardGenerations.EMPTY;
}

@original-brownbear
Copy link
Member Author

@ywelsch right, seems it's only that one spot in fact -> adjusted as suggested :)

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Can you adapt PR title / description?

@original-brownbear original-brownbear changed the title Remove Broken BwC Assertion in RepositoryData Fix ShardGenerations in RepositoryData in BwC Case Nov 11, 2019
@original-brownbear
Copy link
Member Author

Thanks Yannick!

@original-brownbear original-brownbear merged commit 13fc45d into elastic:master Nov 11, 2019
@original-brownbear original-brownbear deleted the rem-broken-assert-bwc branch November 11, 2019 15:24
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Nov 11, 2019
We were tripping the assertion that the makes sure we only have empty `ShardGenerations` in `RepositoryData` in the BwC case because shard generations were passed to the `Repository` in the BwC case. Fixed by only generating empty shard gen for BwC snapshots in `SnapshotsService`.
original-brownbear added a commit that referenced this pull request Nov 11, 2019
We were tripping the assertion that the makes sure we only have empty `ShardGenerations` in `RepositoryData` in the BwC case because shard generations were passed to the `Repository` in the BwC case. Fixed by only generating empty shard gen for BwC snapshots in `SnapshotsService`.
@original-brownbear original-brownbear restored the rem-broken-assert-bwc branch August 6, 2020 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >test Issues or PRs that are addressing/adding tests v7.6.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants