private void internalResetSequence(final byte[] seqKey, final CompletableFuture<Boolean> future,
                                       final int retriesLeft, final Errors lastCause) {
        final Region region = this.pdClient.findRegionByKey(seqKey, ErrorsHelper.isInvalidEpoch(lastCause));
        final RegionEngine regionEngine = getRegionEngine(region.getId(), true);
        final RetryRunner retryRunner = retryCause -> internalResetSequence(seqKey, future, retriesLeft - 1,
                retryCause);
        final FailoverClosure<Boolean> closure = new FailoverClosureImpl<>(future, retriesLeft, retryRunner);
        if (regionEngine != null) {
            if (ensureOnValidEpoch(region, regionEngine, closure)) {
                getRawKVStore(regionEngine).resetSequence(seqKey, closure);
            }
        } else {
            final ResetSequenceRequest request = new ResetSequenceRequest();
            request.setSeqKey(seqKey);
            request.setRegionId(region.getId());
            request.setRegionEpoch(region.getRegionEpoch());
            this.rheaKVRpcService.callAsyncWithRpc(request, closure, lastCause);
        }
    }
Returns a heap-allocated iterator over the contents of the
database.
<p>
Caller should close the iterator when it is no longer needed.
The returned iterator should be closed before this db is closed.
<p>
<pre>
    KVIterator it = unsafeLocalIterator();
    try {
        // do something
    } finally {
        it.close();
    }
<pre/>
jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/client/DefaultRheaKVStore.java