Use ObjectWriter to write storage cache data

This allows deserialization of the on disk data in lower FDB versions
that don't contain fields added in main.
This commit is contained in:
Lukas Joswiak 2022-01-25 17:52:12 -08:00
parent 9fba84bc45
commit e2e853a30b
1 changed files with 5 additions and 3 deletions

View File

@ -228,9 +228,11 @@ const Key storageCacheServerKey(UID id) {
}
const Value storageCacheServerValue(const StorageServerInterface& ssi) {
BinaryWriter wr(IncludeVersion());
wr << ssi;
return wr.toValue();
auto protocolVersion = currentProtocolVersion;
protocolVersion.addObjectSerializerFlag();
ObjectWriter writer(IncludeVersion(protocolVersion));
writer.serialize(ssi);
return writer.toStringRef();
}
const KeyRangeRef ddStatsRange = KeyRangeRef(LiteralStringRef("\xff\xff/metrics/data_distribution_stats/"),