mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
fix removing is_active node after re-creation
This commit is contained in:
parent
d93dd98b66
commit
e2317477f7
@ -75,6 +75,8 @@ void DatabaseReplicatedDDLWorker::initializeReplication()
|
||||
String active_path = fs::path(database->replica_path) / "active";
|
||||
String active_id = toString(ServerUUID::get());
|
||||
zookeeper->deleteEphemeralNodeIfContentMatches(active_path, active_id);
|
||||
if (active_node_holder)
|
||||
active_node_holder->setAlreadyRemoved();
|
||||
zookeeper->create(active_path, active_id, zkutil::CreateMode::Ephemeral);
|
||||
active_node_holder.reset();
|
||||
active_node_holder_zookeeper = zookeeper;
|
||||
|
@ -1141,6 +1141,8 @@ def test_sync_replica(started_cluster):
|
||||
|
||||
dummy_node.query("SYSTEM SYNC DATABASE REPLICA test_sync_database")
|
||||
|
||||
assert "2\n" == main_node.query("SELECT sum(is_active) FROM system.clusters WHERE cluster='test_sync_database'")
|
||||
|
||||
assert dummy_node.query(
|
||||
"SELECT count() FROM system.tables where database='test_sync_database'"
|
||||
).strip() == str(number_of_tables)
|
||||
|
Loading…
Reference in New Issue
Block a user