mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-28 02:48:09 +08:00
FastRestore:Fix segmentation fault
This commit is contained in:
parent
d71361245b
commit
d16db8e733
@ -187,6 +187,13 @@ ACTOR static Future<Void> applyClearRangeMutations(Standalone<VectorRef<KeyRange
|
||||
.detail("BatchIndex", batchIndex)
|
||||
.detail("Ranges", ranges.size())
|
||||
.detail("DelayTime", delayTime);
|
||||
if (SERVER_KNOBS->FASTRESTORE_NOT_WRITE_DB) {
|
||||
TraceEvent("FastRestoreApplierClearRangeMutationsNotWriteDB", applierID)
|
||||
.detail("BatchIndex", batchIndex)
|
||||
.detail("Ranges", ranges.size());
|
||||
return Void();
|
||||
}
|
||||
|
||||
loop {
|
||||
try {
|
||||
tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS);
|
||||
|
@ -378,7 +378,7 @@ struct RestoreApplierData : RestoreRoleData, public ReferenceCounted<RestoreAppl
|
||||
// even when no version batch has been started.
|
||||
int getVersionBatchState(int batchIndex) final {
|
||||
std::map<int, Reference<ApplierBatchData>>::iterator item = batch.find(batchIndex);
|
||||
if (item == batch.end()) { // Simply caller's effort in when it can call this func.
|
||||
if (item == batch.end()) { // Batch has not been initialized when we blindly profile the state
|
||||
return ApplierVersionBatchState::INVALID;
|
||||
} else {
|
||||
return item->second->vbState.get();
|
||||
|
@ -158,7 +158,7 @@ struct RestoreLoaderData : RestoreRoleData, public ReferenceCounted<RestoreLoade
|
||||
|
||||
int getVersionBatchState(int batchIndex) final {
|
||||
std::map<int, Reference<LoaderBatchData>>::iterator item = batch.find(batchIndex);
|
||||
if (item != batch.end()) { // Simply caller's effort in when it can call this func.
|
||||
if (item == batch.end()) { // Batch has not been initialized when we blindly profile the state
|
||||
return LoaderVersionBatchState::INVALID;
|
||||
} else {
|
||||
return item->second->vbState.get();
|
||||
|
Loading…
x
Reference in New Issue
Block a user