This commit is contained in:
alesapin 2023-02-06 22:30:31 +01:00
parent aac5da77e8
commit dd3a98e88d
4 changed files with 5 additions and 3 deletions

View File

@ -150,6 +150,7 @@ void ReplicatedMergeTreeAttachThread::runImpl()
if (replica_metadata_version_exists)
{
StorageInMemoryMetadata metadata_with_new_version(*metadata_snapshot);
metadata_with_new_version.setMetadataVersion(parse<int>(replica_metadata_version));
storage.setInMemoryMetadata(metadata_with_new_version);
}

View File

@ -50,7 +50,7 @@ struct StorageInMemoryMetadata
String comment;
int32_t metadata_version;
int32_t metadata_version = 0;
StorageInMemoryMetadata() = default;

View File

@ -5018,6 +5018,7 @@ bool StorageReplicatedMergeTree::executeMetadataAlter(const StorageReplicatedMer
auto metadata_diff = ReplicatedMergeTreeTableMetadata(*this, getInMemoryMetadataPtr()).checkAndFindDiff(metadata_from_entry, getInMemoryMetadataPtr()->getColumns(), getContext());
setTableStructure(table_id, alter_context, std::move(columns_from_entry), metadata_diff, entry.alter_version);
current_metadata = getInMemoryMetadataPtr();
LOG_INFO(log, "Applied changes to the metadata of the table. Current metadata version: {}", current_metadata->getMetadataVersion());
}

View File

@ -44,8 +44,8 @@ for i in {1..100}; do
")"
# Non retriable errors
if [[ $FileSync -ne 7 ]]; then
echo "FileSync: $FileSync != 11" >&2
if [[ $FileSync -ne 8 ]]; then
echo "FileSync: $FileSync != 8" >&2
exit 2
fi
# Check that all files was synced