FastRestore:ensure setVersionBatchState after version batch is initialized

This commit is contained in:
Meng Xu 2020-02-27 23:50:09 -08:00
parent 22b34bc609
commit eaf340652f
1 changed files with 1 additions and 1 deletions

View File

@ -60,9 +60,9 @@ ACTOR Future<Void> handleInitVersionBatchRequest(RestoreVersionBatchRequest req,
// batchId is continuous. (req.batchIndex-1) is the id of the just finished batch.
wait(self->versionBatchId.whenAtLeast(req.batchIndex - 1));
self->setVersionBatchState(req.batchIndex, ApplierVersionBatchState::INIT);
if (self->versionBatchId.get() == req.batchIndex - 1) {
self->initVersionBatch(req.batchIndex);
self->setVersionBatchState(req.batchIndex, ApplierVersionBatchState::INIT);
TraceEvent("FastRestoreInitVersionBatch")
.detail("BatchIndex", req.batchIndex)
.detail("Role", getRoleStr(self->role))