made the style consistent

This commit is contained in:
Evan Tschannen 2020-05-09 15:17:22 -07:00
parent d497910fa2
commit f298436db7
1 changed files with 10 additions and 4 deletions

View File

@ -875,17 +875,23 @@ 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)
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())
} 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");
if (deterministicRandom()->random01() < 0.001) {
TraceEvent("WaitForVersion1000x");
}
return waitForVersionActor(data, version);
} catch (Error& e) {
return Future<Version>(e);