MCPcopy Create free account
hub / github.com/apple/foundationdb / validateVersion

Method validateVersion

fdbclient/NativeAPI.actor.cpp:456–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

454}
455
456void DatabaseContext::validateVersion(Version version) const {
457 // Version could be 0 if the INITIALIZE_NEW_DATABASE option is set. In that case, it is illegal to perform any
458 // reads. We throw client_invalid_operation because the caller didn't directly set the version, so the
459 // version_invalid error might be confusing.
460 if (version == 0) {
461 throw client_invalid_operation();
462 }
463 if (switchable && version < minAcceptableReadVersion) {
464 CODE_PROBE(true, "Attempted to read a version lower than any this client has seen from the current cluster");
465 throw transaction_too_old();
466 }
467
468 ASSERT(version > 0 || version == latestVersion);
469}
470
471void validateOptionValuePresent(Optional<StringRef> value) {
472 if (!value.present()) {

Callers 4

getRangeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected