blob manager range assignment race fixes

This commit is contained in:
Josh Slocum 2022-02-28 16:11:59 -06:00
parent f277662419
commit 642aab2b8b
1 changed files with 5 additions and 0 deletions

View File

@ -570,6 +570,11 @@ ACTOR Future<Void> rangeAssigner(Reference<BlobManagerData> bmData) {
if (bmData->workerStats.count(assignment.worker.get())) {
bmData->workerStats[assignment.worker.get()].numGranulesAssigned -= 1;
}
// if this revoke matches the worker assignment state, mark the range as unassigned
auto existingRange = bmData->workerAssignments.rangeContaining(assignment.keyRange.begin);
if (existingRange.range() == assignment.keyRange && existingRange.cvalue() == assignment.worker.get()) {
bmData->workerAssignments.insert(assignment.keyRange, UID());
}
bmData->addActor.send(doRangeAssignment(bmData, assignment, assignment.worker.get(), seqNo));
} else {
auto currentAssignments = bmData->workerAssignments.intersectingRanges(assignment.keyRange);