Skip to content
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

Wipe shard state before switching recovered files live #10179

Merged
merged 1 commit into from
Mar 20, 2015

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Mar 20, 2015

Today we leave the shard state behind even if a recovery is half finished
this causes in rare conditions shards to be recovered and promoted as
primaries that have never been fully recovered.

Closes #10053

@s1monw s1monw added the review label Mar 20, 2015
@s1monw
Copy link
Contributor Author

s1monw commented Mar 20, 2015

@bleskes if you have a few moments

IndexShard shard = test.shard(0);
ShardStateMetaData shardStateMetaData = ShardStateMetaData.load(logger, shard.shardId, env.shardPaths(shard.shardId));
assertEquals(getShardStateMetadata(shard), shardStateMetaData);
MutableShardRouting routing = new MutableShardRouting(shard.shardRouting, shard.shardRouting.version()+1);
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this?

@bleskes
Copy link
Contributor

bleskes commented Mar 20, 2015

LGTM. Left a minor comment

Today we leave the shard state behind even if a recovery is half finished
this causes in rare conditions shards to be recovered and promoted as
primaries that have never been fully recovered.

Closes elastic#10053
@s1monw s1monw merged commit 93fedcb into elastic:master Mar 20, 2015
@s1monw s1monw deleted the issues/10053 branch March 20, 2015 15:43
@dakrone
Copy link
Member

dakrone commented Mar 26, 2015

@s1monw it looks like this was just merged to master, is that correct? Can you label the PR?

@clintongormley clintongormley added >enhancement v2.0.0-beta1 :Distributed/Recovery Anything around constructing a new shard, either from a local or a remote source. labels Apr 5, 2015
@clintongormley clintongormley changed the title [RECOVERY] Wipe shard state before switching recovered files live Wipe shard state before switching recovered files live Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Recovery Anything around constructing a new shard, either from a local or a remote source. >enhancement v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recovery should wipe the shard state file before starting recovery
4 participants