Skip to content

Index with no changes gets new sync_id when becoming inactive. #27838

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

Closed
larschri opened this issue Dec 15, 2017 · 1 comment
Closed

Index with no changes gets new sync_id when becoming inactive. #27838

larschri opened this issue Dec 15, 2017 · 1 comment
Assignees
Labels
:Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard.

Comments

@larschri
Copy link

larschri commented Dec 15, 2017

Elasticsearch version (bin/elasticsearch --version):

Version: 5.5.2, Build: b2f0c09/2017-08-14T12:33:14.154Z, JVM: 1.8.0_144

Plugins installed: []

JVM version (java -version):

java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

OS version (uname -a if on a Unix-like system):

Linux xxx 3.13.0-33-generic #58-Ubuntu SMP Tue Jul 29 16:45:05 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:

The problem is that restarting a node takes very long. It takes several hours to wait for a cluster to become green after restarting just one single node, even if there are no indexing and sync flush was successfully executed. The restarted node should be able to recover from local files since they are up to date, but it doesn't because the sync_id doesn't match.

Expected behavior: After shutting down indexing and performing a successful synced flush it is expected that sync_ids stays the same.

Actual behavior: After shutting down indexing and performing a successful synced flush the sync_id changes when the index becomes inactive.

Steps to reproduce:

# Create replicated index with single shard
curl -XPUT localhost:9200/testindex -d '{"settings":{"index":{
  "number_of_shards" : 1,
  "number_of_replicas" : 1
}}}'

# Index one document
curl -XPUT localhost:9200/testindex/doc/1 -d '{}'

# Perform a synced flush
curl -XPOST localhost:9200/_flush/synced

# Note the sync_id (if jq is not installed; navigate JSON correspondingly)
curl localhost:9200/_stats?level=shards | jq '.indices.testindex.shards["0"][].commit.user_data.sync_id'

# wait 5-6 minutes

# The sync_id has changed:
curl localhost:9200/_stats?level=shards | jq '.indices.testindex.shards["0"][].commit.user_data.sync_id'

Provide logs (if relevant):

With debug logging enabled, something like this is printed:

[2017-12-15T11:30:21,439][DEBUG][o.e.i.e.Engine           ] [xxx] [testindex][0] successfully sync committed. sync id [AWBZ8H59yP3Rl7MoZfSx].
[2017-12-15T11:30:22,312][DEBUG][o.e.i.s.IndexShard       ] [xxx] [testindex][0] shard is now inactive
@bleskes bleskes self-assigned this Dec 15, 2017
@clintongormley clintongormley added :Distributed Indexing/Distributed A catch all label for anything in the Distributed Indexing Area. Please avoid if you can. :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. and removed :Engine :Distributed Indexing/Distributed A catch all label for anything in the Distributed Indexing Area. Please avoid if you can. labels Feb 13, 2018
dnhatn added a commit to dnhatn/elasticsearch that referenced this issue 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 elastic#27838
@dnhatn dnhatn self-assigned this Mar 16, 2018
@dnhatn
Copy link
Member

dnhatn commented Mar 16, 2018

I opened #29103 to propose an enhancement.

dnhatn added a commit that referenced this issue 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
dnhatn added a commit that referenced this issue 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 issue 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 issue 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 issue 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 issue 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
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.
Projects
None yet
Development

No branches or pull requests

5 participants