Fix open granule races
This commit is contained in:
parent
269dfb79cf
commit
558779d782
|
@ -30,17 +30,8 @@
|
|||
// Gets the latest granule history node for range that was persisted
|
||||
ACTOR Future<Optional<GranuleHistory>> getLatestGranuleHistory(Transaction* tr, KeyRange range) {
|
||||
state KeyRange historyRange = blobGranuleHistoryKeyRangeFor(range);
|
||||
state RangeResult result;
|
||||
state RangeResult result = wait(tr->getRange(historyRange, 1, Snapshot::False, Reverse::True));
|
||||
|
||||
loop {
|
||||
try {
|
||||
RangeResult _result = wait(tr->getRange(historyRange, 1, Snapshot::False, Reverse::True));
|
||||
result = _result;
|
||||
break;
|
||||
} catch (Error& e) {
|
||||
wait(tr->onError(e));
|
||||
}
|
||||
}
|
||||
ASSERT(result.size() <= 1);
|
||||
|
||||
Optional<GranuleHistory> history;
|
||||
|
|
|
@ -119,6 +119,8 @@ struct GranuleRangeMetadata {
|
|||
activeMetadata->cancelled.send(Void());
|
||||
}
|
||||
activeMetadata.clear();
|
||||
assignFuture.cancel();
|
||||
historyLoaderFuture.cancel();
|
||||
}
|
||||
|
||||
GranuleRangeMetadata() : lastEpoch(0), lastSeqno(0) {}
|
||||
|
|
Loading…
Reference in New Issue