Skip to content

Commit

Permalink
trace
Browse files Browse the repository at this point in the history
  • Loading branch information
dnhatn committed Jul 26, 2018
1 parent 6d25980 commit 327f1ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ public void handleResponse(ShardSyncedFlushResponse response) {

@Override
public void handleException(TransportException exp) {
logger.trace(() -> new ParameterizedMessage("{} error while performing synced flush on [{}], skipping", shardId, shard), exp);
logger.error(() -> new ParameterizedMessage("{} error while performing synced flush on [{}], skipping", shardId, shard), exp);
results.put(shard, new ShardSyncedFlushResponse(exp.getMessage()));
countDownAndSendResponseIfDone(syncId, shards, shardId, totalShards, listener, countDown, results);
}
Expand Down Expand Up @@ -474,7 +474,7 @@ private PreSyncedFlushResponse performPreSyncedFlush(PreShardSyncedFlushRequest
indexShard.flush(flushRequest);
final CommitStats commitStats = indexShard.commitStats();
final Engine.CommitId commitId = commitStats.getRawCommitId();
logger.trace("{} pre sync flush done. commit id {}, num docs {}", request.shardId(), commitId, commitStats.getNumDocs());
logger.error("{} pre sync flush done. commit id {}, num docs {}", request.shardId(), commitId, commitStats.getNumDocs());
return new PreSyncedFlushResponse(commitId, commitStats.getNumDocs(), commitStats.syncId());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,16 @@ public void testSyncedFlushSkipOutOfSyncReplicas() throws Exception {
indexDoc(IndexShardTestCase.getEngine(indexShard), "extra_" + i);
}
}

final ShardsSyncedFlushResult fullResult = SyncedFlushUtil.attemptSyncedFlush(logger, internalCluster(), shardId);
assertBusy(() -> {
for (IndexShard shard : indexShards) {
assertThat(shard.routingEntry().toString(),
shard.commitStats().getNumDocs(), equalTo(numDocs + extraDocs));
}
});
assertThat(fullResult.totalShards(), equalTo(numberOfReplicas + 1));
assertThat(fullResult.failureReason(), nullValue());
assertThat(fullResult.successfulShards(), equalTo(numberOfReplicas + 1));
}

Expand Down

0 comments on commit 327f1ba

Please sign in to comment.