From df1a21564b6ca7fa1ee2390ba50ba5cf5d0532ad Mon Sep 17 00:00:00 2001 From: Josh Slocum Date: Fri, 28 Jan 2022 06:21:07 -0600 Subject: [PATCH] Fixed Blob Worker Rollback issue --- fdbserver/BlobWorker.actor.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fdbserver/BlobWorker.actor.cpp b/fdbserver/BlobWorker.actor.cpp index 84b3c9c9c5..0dfabcb3e4 100644 --- a/fdbserver/BlobWorker.actor.cpp +++ b/fdbserver/BlobWorker.actor.cpp @@ -1039,10 +1039,16 @@ static Version doGranuleRollback(Reference metadata, // Track that this rollback happened, since we have to re-read mutations up to the rollback // Add this rollback to in progress, and put all completed ones back in progress rollbacksInProgress.push_back(std::pair(rollbackVersion, mutationVersion)); - for (int i = rollbacksCompleted.size() - 1; i >= 0; i--) { - rollbacksInProgress.push_front(rollbacksCompleted[i]); + while (!rollbacksCompleted.empty()) { + if (rollbacksCompleted.back().first >= cfRollbackVersion) { + rollbacksInProgress.push_front(rollbacksCompleted.back()); + rollbacksCompleted.pop_back(); + } else { + // some rollbacks in completed could still have a delta file in flight after this rollback, they should + // remain in completed + break; + } } - rollbacksCompleted.clear(); } else { // No pending delta files to discard, just in-memory mutations