docs: private void resubmit(long commandSequence, OperationAttempt<?, ?> attempt) {
      // If the client's response sequence number is greater than the given command sequence number,
      // the cluster likely has a new leader, and we need to reset the sequencing in the leader by
      // sending a keep-alive request.
      // Ensure that the client doesn't resubmit many concurrent KeepAliveRequests by tracking the last
      // keep-alive response sequence number and only resubmitting if the sequence number has changed.
      long responseSequence = state.getCommandResponse();
      if (commandSequence < responseSequence && keepAliveIndex.get() != responseSequence) {
        keepAliveIndex.set(responseSequence);
        manager.resetIndexes(state.getSessionId()).whenCompleteAsync((result, error) -> {
          if (error == null) {
            resubmit(responseSequence, attempt);
          } else {
            keepAliveIndex.set(0);
            attempt.retry(Duration.ofSeconds(FIBONACCI[Math.min(attempt.attempt - 1, FIBONACCI.length - 1)]));
          }
        }, context);
      } else {
        for (Map.Entry<Long, OperationAttempt> entry : attempts.entrySet()) {
          OperationAttempt operation = entry.getValue();
          if (operation instanceof CommandAttempt && operation.request.sequenceNumber() > commandSequence && operation.attempt <= attempt.attempt) {
            operation.retry();
          }
        }
      }
    }