Skip to content

Commit

Permalink
TEST: Avoid triggering merges in FlushIT
Browse files Browse the repository at this point in the history
In testSyncedFlushSkipOutOfSyncReplicas, we reindex the extra documents
to all shards including the out-of-sync replica. However, reindexing to
that replica can trigger merges (due to the new deletes) which cause the
synced-flush failed. This test starts failing after we aggressively
trigger merges segments with a large number of deletes in LUCENE-8263.
  • Loading branch information
dnhatn committed Jul 26, 2018
1 parent eb73dde commit 0ed3458
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,11 @@ public void testSyncedFlushSkipOutOfSyncReplicas() throws Exception {
"out of sync replica; num docs on replica [" + (numDocs + extraDocs) + "]; num docs on primary [" + numDocs + "]"));
// Index extra documents to all shards - synced-flush should be ok.
for (IndexShard indexShard : indexShards) {
for (int i = 0; i < extraDocs; i++) {
indexDoc(IndexShardTestCase.getEngine(indexShard), "extra_" + i);
// Do reindex documents to the out of sync replica to avoid trigger merges
if (indexShard != outOfSyncReplica) {
for (int i = 0; i < extraDocs; i++) {
indexDoc(IndexShardTestCase.getEngine(indexShard), "extra_" + i);
}
}
}
final ShardsSyncedFlushResult fullResult = SyncedFlushUtil.attemptSyncedFlush(logger, internalCluster(), shardId);
Expand Down

0 comments on commit 0ed3458

Please sign in to comment.