Skip to content

Commit

Permalink
Internal: an inactive shard is activated by triggered synced flush
Browse files Browse the repository at this point in the history
When a shard becomes in active we trigger a sync flush in order to speed up future recoveries. The sync flush causes a new translog generation to be made, which in turn confuses the IndexingMemoryController making it think that the shard is active. If no documents comes along in the next 5m, the shard is made inactive again , triggering a sync flush and so forth.

To avoid this, the IndexingMemoryController is changed to ignore empty translogs when checking if a shard became active. This comes with the price of potentially missing indexing operations which are followed by a flush. This is acceptable as if no more index operation come in, it's OK to leave the shard in active.

A new unit test is introduced and comparable integration tests are removed.

Relates elastic#13802
Includes a backport of elastic#13784

Closes elastic#13824
  • Loading branch information
bleskes committed Sep 28, 2015
1 parent aa45407 commit d7faab1
Show file tree
Hide file tree
Showing 3 changed files with 536 additions and 122 deletions.
Expand Up @@ -238,10 +238,7 @@ public boolean equals(Object o) {

ByteSizeValue sizeValue = (ByteSizeValue) o;

if (size != sizeValue.size) return false;
if (sizeUnit != sizeValue.sizeUnit) return false;

return true;
return bytes() == sizeValue.bytes();
}

@Override
Expand Down

0 comments on commit d7faab1

Please sign in to comment.