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

Do not renew sync-id if all shards are sealed #29103

Merged
merged 2 commits into from
Mar 16, 2018

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Mar 16, 2018

Today the synced-flush always issues a new sync-id even though all
shards haven't been changed since the last seal. This causes active
shards to have different a sync-id from offline shards even though all
were sealed and no writes since then.

This commit adjusts not to renew sync-id if all active shards are sealed
with the same sync-id.

Closes #27838

Today the synced-flush always issues a new sync-id even though all
shards haven't been changed since the last seal. This causes active
shards to have different a sync-id from offline shards even though all
were sealed and no writes since then.

This commit adjusts not to renew sync-id if all active shards are sealed
with the same sync-id.

Closes elastic#27838
@dnhatn dnhatn added v7.0.0 v6.3.0 :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. v5.6.9 labels Mar 16, 2018
@dnhatn dnhatn requested review from s1monw and bleskes March 16, 2018 01:49
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

Copy link
Contributor

@bleskes bleskes 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 like how contained it is (i.e. not trying to cover all edge cases where some of the shards may have another seal id in place or trying to reuse the primary's sync id marker). I left some simple ask for testing. No need for another cycle

final ShardsSyncedFlushResult secondSeal = SyncedFlushUtil.attemptSyncedFlush(internalCluster(), shardId);
assertThat(secondSeal.successfulShards(), equalTo(numberOfReplicas + 1));
assertThat(secondSeal.syncId(), equalTo(firstSeal.syncId()));
// Shards were updated, renew synced flush
Copy link
Contributor

Choose a reason for hiding this comment

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

can we inject/remove the marker from one of the shards and see that the synced flush is re-applied?

@dnhatn
Copy link
Member Author

dnhatn commented Mar 16, 2018

Thanks @bleskes for reviewing.

@dnhatn dnhatn merged commit 2c1ef3d into elastic:master Mar 16, 2018
@dnhatn dnhatn deleted the dont-renew-syncid branch March 16, 2018 15:16
dnhatn added a commit that referenced this pull request Mar 17, 2018
Today the synced-flush always issues a new sync-id even though all
shards haven't been changed since the last seal. This causes active
shards to have different a sync-id from offline shards even though all
were sealed and no writes since then.

This commit adjusts not to renew sync-id if all active shards are sealed
with the same sync-id.

Closes #27838
dnhatn added a commit that referenced this pull request Mar 17, 2018
Today the synced-flush always issues a new sync-id even though all
shards haven't been changed since the last seal. This causes active
shards to have different a sync-id from offline shards even though all
were sealed and no writes since then.

This commit adjusts not to renew sync-id if all active shards are sealed
with the same sync-id.

Closes #27838
dnhatn added a commit that referenced this pull request Mar 17, 2018
DaveCTurner added a commit that referenced this pull request Mar 20, 2018
@DaveCTurner
Copy link
Contributor

@dnhatn I backed out the backport to the 5.6 branch because it seems to be the source of the test failures in #29162.

dnhatn added a commit that referenced this pull request Mar 20, 2018
Let re-enable this commit, then fix the BWC issue.
dnhatn added a commit that referenced this pull request Mar 20, 2018
I misunderstood how the bwc versions works. If we backport to 5.x, we
need to backport to all supported 6.*.  This commit corrects the BWC
versions for PreSyncedFlushResponse.

Relates #29103
dnhatn added a commit that referenced this pull request Mar 20, 2018
Today the synced-flush always issues a new sync-id even though all
shards haven't been changed since the last seal. This causes active
shards to have different a sync-id from offline shards even though all
were sealed and no writes since then.

This commit adjusts not to renew sync-id if all active shards are sealed
with the same sync-id.

Closes #27838
dnhatn added a commit that referenced this pull request Mar 20, 2018
I misunderstood how the bwc versions works. If we backport to 5.x, we
need to backport to all supported 6.*.  This commit corrects the BWC
versions for PreSyncedFlushResponse.

Relates #29103
dnhatn added a commit that referenced this pull request Mar 20, 2018
I misunderstood how the bwc versions works. If we backport to 5.x, we
need to backport to all supported 6.*.  This commit corrects the BWC
versions for PreSyncedFlushResponse.

Relates #29103
dnhatn added a commit that referenced this pull request Mar 20, 2018
Today the synced-flush always issues a new sync-id even though all
shards haven't been changed since the last seal. This causes active
shards to have different a sync-id from offline shards even though all
were sealed and no writes since then.

This commit adjusts not to renew sync-id if all active shards are sealed
with the same sync-id.

Closes #27838
dnhatn added a commit that referenced this pull request Mar 20, 2018
Today the synced-flush always issues a new sync-id even though all
shards haven't been changed since the last seal. This causes active
shards to have different a sync-id from offline shards even though all
were sealed and no writes since then.

This commit adjusts not to renew sync-id if all active shards are sealed
with the same sync-id.

Closes #27838
dnhatn added a commit that referenced this pull request Mar 21, 2018
dnhatn added a commit that referenced this pull request Mar 21, 2018
dnhatn added a commit that referenced this pull request Mar 21, 2018
We discussed and agreed to include #29103 in 6.3.0+ but not in 5.6.9. We
will re-evaluate the urgency and importance of the issue then decide
which versions that the change should be included.

This reverts commit 25b4d9e.
dnhatn added a commit that referenced this pull request Mar 21, 2018
We discussed and agreed to include #29103 in 6.3.0+ but not in 5.6.9. We
will re-evaluate the urgency and importance of the issue then decide
which versions that the change should be included.

This reverts commit f10a3ed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. >enhancement v6.3.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants