[CORE] Log sending translog operation batches to nodes

This commit is contained in:
Lee Hinman 2015-04-10 16:38:45 -06:00
parent c347dfe91c
commit fcbe3f92b7
1 changed files with 16 additions and 0 deletions

View File

@ -610,6 +610,10 @@ public class RecoverySourceHandler implements Engine.RecoveryHandler {
.withType(TransportRequestOptions.Type.RECOVERY) .withType(TransportRequestOptions.Type.RECOVERY)
.withTimeout(recoverySettings.internalActionLongTimeout()); .withTimeout(recoverySettings.internalActionLongTimeout());
if (operation == null) {
logger.trace("[{}][{}] no translog operations to send to {}",
indexName, shardId, request.targetNode());
}
while (operation != null) { while (operation != null) {
if (shard.state() == IndexShardState.CLOSED) { if (shard.state() == IndexShardState.CLOSED) {
throw new IndexShardClosedException(request.shardId()); throw new IndexShardClosedException(request.shardId());
@ -642,6 +646,12 @@ public class RecoverySourceHandler implements Engine.RecoveryHandler {
recoveryOptions, EmptyTransportResponseHandler.INSTANCE_SAME).txGet(); recoveryOptions, EmptyTransportResponseHandler.INSTANCE_SAME).txGet();
} }
}); });
if (logger.isTraceEnabled()) {
logger.trace("[{}][{}] sent batch of [{}][{}] (total: [{}]) translog operations to {}",
indexName, shardId, ops, new ByteSizeValue(size),
shard.translog().estimatedNumberOfOperations(),
request.targetNode());
}
ops = 0; ops = 0;
size = 0; size = 0;
@ -665,6 +675,12 @@ public class RecoverySourceHandler implements Engine.RecoveryHandler {
}); });
} }
if (logger.isTraceEnabled()) {
logger.trace("[{}][{}] sent final batch of [{}][{}] (total: [{}]) translog operations to {}",
indexName, shardId, ops, new ByteSizeValue(size),
shard.translog().estimatedNumberOfOperations(),
request.targetNode());
}
return totalOperations; return totalOperations;
} }