Ignore file identifier mismatches during 7.0 -> 6.3 downgrade

This commit is contained in:
sfc-gh-tclinkenbeard 2020-07-20 18:45:28 -07:00
parent de2b35f727
commit 92ac2a99b9
1 changed files with 13 additions and 2 deletions

View File

@ -80,8 +80,19 @@ public:
const uint8_t* data = static_cast<ReaderImpl*>(this)->data();
LoadContext<ReaderImpl> context(static_cast<ReaderImpl*>(this));
if(read_file_identifier(data) != file_identifier) {
TraceEvent(SevError, "MismatchedFileIdentifier").detail("Expected", file_identifier).detail("Read", read_file_identifier(data));
ASSERT(false);
// Some file identifiers are changed in 7.0, so file identifier mismatches
// are expected during a downgrade from 7.0 to 6.3
bool expectMismatch = mProtocolVersion >= ProtocolVersion(0x0FDB00B070000000LL);
{
TraceEvent te(expectMismatch ? SevInfo : SevError, "MismatchedFileIdentifier");
if (expectMismatch) {
te.suppressFor(1.0);
}
te.detail("Expected", file_identifier).detail("Read", read_file_identifier(data));
}
if (!expectMismatch) {
ASSERT(false);
}
}
load_members(data, context, items...);
}