mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Remove exception if shared ID already created
This commit is contained in:
parent
2c7377be92
commit
0e5e58bed9
@ -182,6 +182,7 @@ void ReplicatedMergeTreeAttachThread::runImpl()
|
||||
storage.createNewZooKeeperNodes();
|
||||
storage.syncPinnedPartUUIDs();
|
||||
|
||||
std::lock_guard lock(storage.table_shared_id_mutex);
|
||||
storage.createTableSharedID();
|
||||
};
|
||||
|
||||
|
@ -7609,8 +7609,6 @@ std::unique_ptr<MergeTreeSettings> StorageReplicatedMergeTree::getDefaultSetting
|
||||
|
||||
String StorageReplicatedMergeTree::getTableSharedID() const
|
||||
{
|
||||
/// Lock is not required in other places because createTableSharedID()
|
||||
/// can be called only during table initialization
|
||||
std::lock_guard lock(table_shared_id_mutex);
|
||||
|
||||
/// Can happen if table was partially initialized before drop by DatabaseCatalog
|
||||
@ -7637,8 +7635,12 @@ String StorageReplicatedMergeTree::getTableSharedID() const
|
||||
void StorageReplicatedMergeTree::createTableSharedID() const
|
||||
{
|
||||
LOG_DEBUG(log, "Creating shared ID for table {}", getStorageID().getNameForLogs());
|
||||
// can be set by the call to getTableSharedID
|
||||
if (table_shared_id != UUIDHelpers::Nil)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Table shared id already initialized");
|
||||
{
|
||||
LOG_INFO(log, "Shared ID already set to {}", table_shared_id);
|
||||
return;
|
||||
}
|
||||
|
||||
auto zookeeper = getZooKeeper();
|
||||
String zookeeper_table_id_path = fs::path(zookeeper_path) / "table_shared_id";
|
||||
|
Loading…
Reference in New Issue
Block a user