rename RETRY stage in recovery to THROTTLE
This commit is contained in:
parent
0c72bb2125
commit
e12bdd9faf
|
@ -30,7 +30,7 @@ public class GatewayRecoveryStatus {
|
|||
|
||||
public enum Stage {
|
||||
INIT((byte) 0),
|
||||
RETRY((byte) 1),
|
||||
THROTTLE((byte) 1),
|
||||
INDEX((byte) 2),
|
||||
TRANSLOG((byte) 3),
|
||||
FINALIZE((byte) 4),
|
||||
|
@ -50,7 +50,7 @@ public class GatewayRecoveryStatus {
|
|||
if (value == 0) {
|
||||
return INIT;
|
||||
} else if (value == 1) {
|
||||
return RETRY;
|
||||
return THROTTLE;
|
||||
} else if (value == 2) {
|
||||
return INDEX;
|
||||
} else if (value == 3) {
|
||||
|
|
|
@ -30,7 +30,7 @@ public class PeerRecoveryStatus {
|
|||
|
||||
public enum Stage {
|
||||
INIT((byte) 0),
|
||||
RETRY((byte) 1),
|
||||
THROTTLE((byte) 1),
|
||||
INDEX((byte) 2),
|
||||
TRANSLOG((byte) 3),
|
||||
FINALIZE((byte) 4),
|
||||
|
@ -50,7 +50,7 @@ public class PeerRecoveryStatus {
|
|||
if (value == 0) {
|
||||
return INIT;
|
||||
} else if (value == 1) {
|
||||
return RETRY;
|
||||
return THROTTLE;
|
||||
} else if (value == 2) {
|
||||
return INDEX;
|
||||
} else if (value == 3) {
|
||||
|
|
|
@ -177,8 +177,8 @@ public class TransportIndicesStatusAction extends TransportBroadcastOperationAct
|
|||
case TRANSLOG:
|
||||
stage = PeerRecoveryStatus.Stage.TRANSLOG;
|
||||
break;
|
||||
case RETRY:
|
||||
stage = PeerRecoveryStatus.Stage.RETRY;
|
||||
case THROTTLE:
|
||||
stage = PeerRecoveryStatus.Stage.THROTTLE;
|
||||
break;
|
||||
case FINALIZE:
|
||||
stage = PeerRecoveryStatus.Stage.FINALIZE;
|
||||
|
@ -208,8 +208,8 @@ public class TransportIndicesStatusAction extends TransportBroadcastOperationAct
|
|||
case TRANSLOG:
|
||||
stage = GatewayRecoveryStatus.Stage.TRANSLOG;
|
||||
break;
|
||||
case RETRY:
|
||||
stage = GatewayRecoveryStatus.Stage.RETRY;
|
||||
case THROTTLE:
|
||||
stage = GatewayRecoveryStatus.Stage.THROTTLE;
|
||||
break;
|
||||
case DONE:
|
||||
stage = GatewayRecoveryStatus.Stage.DONE;
|
||||
|
|
|
@ -152,7 +152,7 @@ public class IndexShardGatewayService extends AbstractIndexShardComponent implem
|
|||
listener.onIgnoreRecovery("ignoring recovery while waiting on retry, closed");
|
||||
return;
|
||||
}
|
||||
recoveryStatus.updateStage(RecoveryStatus.Stage.RETRY);
|
||||
recoveryStatus.updateStage(RecoveryStatus.Stage.THROTTLE);
|
||||
try {
|
||||
Thread.sleep(recoveryThrottler.throttleInterval().millis());
|
||||
recoveryStatus.retryTime(System.currentTimeMillis() - recoveryStatus.startTime());
|
||||
|
|
|
@ -28,7 +28,7 @@ public class RecoveryStatus {
|
|||
|
||||
public static enum Stage {
|
||||
INIT,
|
||||
RETRY,
|
||||
THROTTLE,
|
||||
INDEX,
|
||||
TRANSLOG,
|
||||
DONE
|
||||
|
|
|
@ -33,7 +33,7 @@ public class RecoveryStatus {
|
|||
|
||||
public static enum Stage {
|
||||
INIT,
|
||||
RETRY,
|
||||
THROTTLE,
|
||||
INDEX,
|
||||
TRANSLOG,
|
||||
FINALIZE,
|
||||
|
|
|
@ -168,7 +168,7 @@ public class RecoveryTarget extends AbstractComponent {
|
|||
}
|
||||
|
||||
if (!recoveryThrottler.tryRecovery(shard.shardId(), "peer recovery target")) {
|
||||
recovery.stage = RecoveryStatus.Stage.RETRY;
|
||||
recovery.stage = RecoveryStatus.Stage.THROTTLE;
|
||||
recovery.retryTime = System.currentTimeMillis() - recovery.startTime;
|
||||
listener.onRetryRecovery(recoveryThrottler.throttleInterval());
|
||||
return;
|
||||
|
@ -189,7 +189,7 @@ public class RecoveryTarget extends AbstractComponent {
|
|||
return;
|
||||
}
|
||||
logger.trace("[{}][{}] retrying recovery in [{}], source shard is busy", request.shardId().index().name(), request.shardId().id(), recoveryThrottler.throttleInterval());
|
||||
recovery.stage = RecoveryStatus.Stage.RETRY;
|
||||
recovery.stage = RecoveryStatus.Stage.THROTTLE;
|
||||
recovery.retryTime = System.currentTimeMillis() - recovery.startTime;
|
||||
listener.onRetryRecovery(recoveryThrottler.throttleInterval());
|
||||
return;
|
||||
|
@ -231,7 +231,7 @@ public class RecoveryTarget extends AbstractComponent {
|
|||
}
|
||||
|
||||
if (cause instanceof IndexShardNotStartedException || cause instanceof IndexMissingException || cause instanceof IndexShardMissingException) {
|
||||
recovery.stage = RecoveryStatus.Stage.RETRY;
|
||||
recovery.stage = RecoveryStatus.Stage.THROTTLE;
|
||||
recovery.retryTime = System.currentTimeMillis() - recovery.startTime;
|
||||
listener.onRetryRecovery(recoveryThrottler.throttleInterval());
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue