Added minInvalidProtocolVersion
This commit is contained in:
parent
949a17359a
commit
e69f299a5c
|
@ -135,3 +135,6 @@ constexpr ProtocolVersion currentProtocolVersion(0x0FDB00B063010001LL);
|
|||
// This assert is intended to help prevent incrementing the leftmost digits accidentally. It will probably need to
|
||||
// change when we reach version 10.
|
||||
static_assert(currentProtocolVersion.version() < 0x0FDB00B100000000LL, "Unexpected protocol version");
|
||||
|
||||
// Downgrades are only supported for one minor version
|
||||
constexpr ProtocolVersion minInvalidProtocolVersion(0x0FDB00B071000000LL);
|
||||
|
|
|
@ -286,7 +286,12 @@ struct _IncludeVersion {
|
|||
TraceEvent(SevWarnAlways, "InvalidSerializationVersion").error(err).detailf("Version", "%llx", v.versionWithFlags());
|
||||
throw err;
|
||||
}
|
||||
// TODO: Add the add maximum readable version.
|
||||
if (v >= minInvalidProtocolVersion) {
|
||||
// Downgrades are only supported for one minor version
|
||||
auto err = incompatible_protocol_version();
|
||||
TraceEvent(SevError, "FutureProtocolVersion").error(err).detailf("Version", "%llx", v.versionWithFlags());
|
||||
throw err;
|
||||
}
|
||||
ar.setProtocolVersion(v);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue