FR:SampleBackup:Assert req.batchIndex < controller batch size

This commit is contained in:
Meng Xu 2020-08-07 16:52:07 -07:00
parent c27542d4e9
commit c89a62b935
1 changed files with 2 additions and 6 deletions

View File

@ -81,12 +81,8 @@ ACTOR Future<Void> sampleBackups(Reference<RestoreControllerData> self, RestoreC
.detail("SampleID", req.id)
.detail("BatchIndex", req.batchIndex)
.detail("Samples", req.samples.size());
if (req.batchIndex > self->batch.size()) {
TraceEvent(SevError, "FastRestoreControllerSampleBackupsInvalidBatchIndex")
.detail("BatchIndex", req.batchIndex)
.detail("InitializedBatches", self->batch.size());
continue;
}
ASSERT(req.batchIndex < self->batch.size());
Reference<ControllerBatchData> batch = self->batch[req.batchIndex];
if (batch->sampleMsgs.find(req.id) != batch->sampleMsgs.end()) {
req.reply.send(RestoreCommonReply(req.id));