1
0
mirror of https://github.com/apple/foundationdb.git synced 2025-05-21 14:02:59 +08:00

FastRestore:fix:loader can receive reply from vb that has been processed and deleted

This commit is contained in:
Meng Xu 2020-08-19 10:39:49 -07:00
parent 22a2fac689
commit d9ea14ea6c
2 changed files with 16 additions and 6 deletions

@ -109,7 +109,7 @@ ACTOR Future<Void> restoreApplierCore(RestoreApplierInterface applierInterf, int
// Only one actor can process mutations from the same file.
ACTOR static Future<Void> handleSendMutationVectorRequest(RestoreSendVersionedMutationsRequest req,
Reference<RestoreApplierData> self) {
state Reference<ApplierBatchData> batchData; // initiallized as nullptr
state Reference<ApplierBatchData> batchData; // initialized as nullptr
state bool printTrace = false;
state NotifiedVersion* curMsgIndex = nullptr;

@ -834,11 +834,21 @@ ACTOR Future<Void> sendMutationsToApplier(
wait(waitForAll(fSends));
(*inflightSendLoadParamReqs)[batchIndex]--;
kvOps = VersionedMutationsMap(); // Free memory for parsed mutations at the restore asset.
TraceEvent("FastRestoreLoaderSendMutationToApplierDone")
.detail("BatchIndex", batchIndex)
.detail("RestoreAsset", asset.toString())
.detail("Mutations", kvCount);
if (batchIndex < finishedBatch->get()) {
kvOps = VersionedMutationsMap(); // Free memory for parsed mutations at the restore asset.
TraceEvent("FastRestoreLoaderSendMutationToApplierDone")
.detail("BatchIndex", batchIndex)
.detail("RestoreAsset", asset.toString())
.detail("Mutations", kvCount);
} else {
TraceEvent(SevWarnAlways, "FastRestoreLoaderSendMutationToApplierDoneTooLate")
.detail("BatchIndex", batchIndex)
.detail("FinishedBatchIndex", finishedBatch->get())
.detail("RestoreAsset", asset.toString())
.detail("Mutations", kvCount);
}
return Void();
}