Skip to content
Permalink
Browse files

Don't throttle the translog stage of recovery

After copying the index files (which are throttled), we currently throttle the translog as well. The translog phase3 part is performed under a lock, so its better not to throttle it at all, and move it as fast as possible.
  • Loading branch information...
kimchy committed Jan 25, 2014
1 parent 1aa1e83 commit b66885dab33dcf8e315e99450ec0a1a56df3490f
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/main/java/org/elasticsearch/indices/recovery/RecoverySource.java
@@ -294,9 +294,13 @@ private int sendSnapshot(Translog.Snapshot snapshot) throws ElasticsearchExcepti
totalOperations++;
if (ops >= recoverySettings.translogOps() || size >= recoverySettings.translogSize().bytes()) {

if (recoverySettings.rateLimiter() != null) {
recoverySettings.rateLimiter().pause(size);
}
// don't throttle translog, since we lock for phase3 indexing, so we need to move it as
// fast as possible. Note, sine we index docs to replicas while the index files are recovered
// the lock can potentially be removed, in which case, it might make sense to re-enable
// throttling in this phase
// if (recoverySettings.rateLimiter() != null) {
// recoverySettings.rateLimiter().pause(size);
// }

RecoveryTranslogOperationsRequest translogOperationsRequest = new RecoveryTranslogOperationsRequest(request.recoveryId(), request.shardId(), operations);
transportService.submitRequest(request.targetNode(), RecoveryTarget.Actions.TRANSLOG_OPS, translogOperationsRequest, TransportRequestOptions.options().withCompress(recoverySettings.compress()).withType(TransportRequestOptions.Type.RECOVERY).withTimeout(internalActionLongTimeout), EmptyTransportResponseHandler.INSTANCE_SAME).txGet();

0 comments on commit b66885d

Please sign in to comment.
You can’t perform that action at this time.