Merge pull request #56594 from CheSema/inline-data

hide VERSION_INLINE_DATA under feature flag
This commit is contained in:
Sema Checherinda 2023-11-11 12:06:42 +01:00 committed by GitHub
commit ed2bb53eec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -117,6 +117,9 @@ void DiskObjectStorageMetadata::serialize(WriteBuffer & buf, bool sync) const
if (storage_metadata_write_full_object_key)
write_version = VERSION_FULL_OBJECT_KEY;
if (!inline_data.empty() && write_version < VERSION_INLINE_DATA)
write_version = VERSION_INLINE_DATA;
chassert(write_version >= VERSION_ABSOLUTE_PATHS && write_version <= VERSION_FULL_OBJECT_KEY);
writeIntText(write_version, buf);
writeChar('\n', buf);
@ -153,8 +156,11 @@ void DiskObjectStorageMetadata::serialize(WriteBuffer & buf, bool sync) const
writeBoolText(read_only, buf);
writeChar('\n', buf);
writeEscapedString(inline_data, buf);
writeChar('\n', buf);
if (write_version >= VERSION_INLINE_DATA)
{
writeEscapedString(inline_data, buf);
writeChar('\n', buf);
}
buf.finalize();
if (sync)

View File

@ -19,7 +19,7 @@ private:
static constexpr UInt32 VERSION_INLINE_DATA = 4;
static constexpr UInt32 VERSION_FULL_OBJECT_KEY = 5; /// only for reading data
UInt32 version = VERSION_INLINE_DATA;
UInt32 version = VERSION_READ_ONLY_FLAG;
/// Absolute paths of blobs
ObjectKeysWithMetadata keys_with_meta;