From c89a62b9351e61bf613a4fa1102889e9cec999a0 Mon Sep 17 00:00:00 2001 From: Meng Xu Date: Fri, 7 Aug 2020 16:52:07 -0700 Subject: [PATCH] FR:SampleBackup:Assert req.batchIndex < controller batch size --- fdbserver/RestoreController.actor.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/fdbserver/RestoreController.actor.cpp b/fdbserver/RestoreController.actor.cpp index 5743674665..7f231b2de0 100644 --- a/fdbserver/RestoreController.actor.cpp +++ b/fdbserver/RestoreController.actor.cpp @@ -81,12 +81,8 @@ ACTOR Future sampleBackups(Reference 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 batch = self->batch[req.batchIndex]; if (batch->sampleMsgs.find(req.id) != batch->sampleMsgs.end()) { req.reply.send(RestoreCommonReply(req.id));