FastRestoreApplier:Add trace to track applying status

This commit is contained in:
Meng Xu 2020-05-04 15:02:53 -07:00
parent 9000a4a548
commit 135f6443da
2 changed files with 12 additions and 2 deletions

View File

@ -463,10 +463,11 @@ ACTOR static Future<Void> handleApplyToDBRequest(RestoreVersionBatchRequest req,
state bool isDuplicated = true; state bool isDuplicated = true;
Reference<ApplierBatchData> batchData = self->batch[req.batchIndex]; Reference<ApplierBatchData> batchData = self->batch[req.batchIndex];
TraceEvent("FastRestoreApplierPhaseHandleApplyToDB", self->id()) TraceEvent("FastRestoreApplierPhaseHandleApplyToDBStart", self->id())
.detail("BatchIndex", req.batchIndex) .detail("BatchIndex", req.batchIndex)
.detail("FinishedBatch", self->finishedBatch.get()) .detail("FinishedBatch", self->finishedBatch.get())
.detail("HasStarted", batchData->dbApplier.present()) .detail("HasStarted", batchData->dbApplier.present())
.detail("WroteToDB", batchData->dbApplier.present() ? batchData->dbApplier.get().isReady() : "No")
.detail("PreviousVersionBatchState", batchData->vbState.get()); .detail("PreviousVersionBatchState", batchData->vbState.get());
batchData->vbState = ApplierVersionBatchState::WRITE_TO_DB; batchData->vbState = ApplierVersionBatchState::WRITE_TO_DB;
if (self->finishedBatch.get() == req.batchIndex - 1) { if (self->finishedBatch.get() == req.batchIndex - 1) {
@ -493,6 +494,14 @@ ACTOR static Future<Void> handleApplyToDBRequest(RestoreVersionBatchRequest req,
} }
req.reply.send(RestoreCommonReply(self->id(), isDuplicated)); req.reply.send(RestoreCommonReply(self->id(), isDuplicated));
TraceEvent("FastRestoreApplierPhaseHandleApplyToDBStart", self->id())
.detail("BatchIndex", req.batchIndex)
.detail("FinishedBatch", self->finishedBatch.get())
.detail("HasStarted", batchData->dbApplier.present())
.detail("WroteToDB", batchData->dbApplier.present() ? batchData->dbApplier.get().isReady() : "No")
.detail("PreviousVersionBatchState", batchData->vbState.get());
batchData->vbState = ApplierVersionBatchState::DONE;
return Void(); return Void();
} }

View File

@ -218,7 +218,8 @@ public:
static const int INIT = 1; static const int INIT = 1;
static const int RECEIVE_MUTATIONS = 2; static const int RECEIVE_MUTATIONS = 2;
static const int WRITE_TO_DB = 3; static const int WRITE_TO_DB = 3;
static const int INVALID = 4; static const int DONE = 4;
static const int INVALID = 5;
explicit ApplierVersionBatchState(int newState) { explicit ApplierVersionBatchState(int newState) {
vbState = newState; vbState = newState;