mirror of
https://github.com/apple/foundationdb.git
synced 2025-06-03 03:41:53 +08:00
removed an unnecessary try/catch
This commit is contained in:
parent
f298436db7
commit
dbdf6ddbd7
@ -874,28 +874,24 @@ ACTOR Future<Version> waitForVersionActor(StorageServer* data, Version version)
|
||||
}
|
||||
|
||||
Future<Version> waitForVersion(StorageServer* data, Version version) {
|
||||
try {
|
||||
if (version == latestVersion) {
|
||||
version = std::max(Version(1), data->version.get());
|
||||
}
|
||||
|
||||
if (version < data->oldestVersion.get() || version <= 0) {
|
||||
throw transaction_too_old();
|
||||
} else if (version <= data->version.get()) {
|
||||
return version;
|
||||
}
|
||||
|
||||
if ((data->behind || data->versionBehind) && version > data->version.get()) {
|
||||
throw process_behind();
|
||||
}
|
||||
|
||||
if (deterministicRandom()->random01() < 0.001) {
|
||||
TraceEvent("WaitForVersion1000x");
|
||||
}
|
||||
return waitForVersionActor(data, version);
|
||||
} catch (Error& e) {
|
||||
return Future<Version>(e);
|
||||
if (version == latestVersion) {
|
||||
version = std::max(Version(1), data->version.get());
|
||||
}
|
||||
|
||||
if (version < data->oldestVersion.get() || version <= 0) {
|
||||
return transaction_too_old();
|
||||
} else if (version <= data->version.get()) {
|
||||
return version;
|
||||
}
|
||||
|
||||
if ((data->behind || data->versionBehind) && version > data->version.get()) {
|
||||
return process_behind();
|
||||
}
|
||||
|
||||
if (deterministicRandom()->random01() < 0.001) {
|
||||
TraceEvent("WaitForVersion1000x");
|
||||
}
|
||||
return waitForVersionActor(data, version);
|
||||
}
|
||||
|
||||
ACTOR Future<Version> waitForVersionNoTooOld( StorageServer* data, Version version ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user