Index shard should roll generation via the engine

Today when a replica shard detects a new primary shard (via a primary
term transition), we roll the translog generation. However, the
mechanism that we are using here is by reaching through the engine to
the translog directly. By poking all the way through rather than asking
the engine to manage the roll for us we miss:
 - taking a read lock in the engine while the roll is occurring
 - trimming unreferenced readers

This commit addresses this by asking the engine to roll the translog
generation for us.

Relates #28537
This commit is contained in:
Jason Tedor 2018-02-07 14:57:50 -05:00 committed by GitHub
parent 2023c98bea
commit 666c4f9414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2251,7 +2251,7 @@ public class IndexShard extends AbstractIndexShardComponent implements IndicesCl
getLocalCheckpoint(),
localCheckpoint);
getEngine().getLocalCheckpointTracker().resetCheckpoint(localCheckpoint);
getEngine().getTranslog().rollGeneration();
getEngine().rollTranslogGeneration();
});
globalCheckpointUpdated = true;
} catch (final Exception e) {