Trying to fix two flaky tests

This commit is contained in:
alesapin 2022-11-07 20:39:33 +01:00
parent 6e4daa67d5
commit 257e766e0e
2 changed files with 8 additions and 5 deletions

View File

@ -112,6 +112,8 @@ void ReplicatedMergeTreeMergeStrategyPicker::refreshState()
&& now - last_refresh_time < REFRESH_STATE_MINIMUM_INTERVAL_SECONDS)
return;
LOG_DEBUG(storage.log, "Updating strategy picker state");
auto zookeeper = storage.getZooKeeper();
auto all_replicas = zookeeper->getChildren(storage.zookeeper_path + "/replicas");
@ -154,6 +156,8 @@ void ReplicatedMergeTreeMergeStrategyPicker::refreshState()
last_refresh_time = now;
current_replica_index = current_replica_index_tmp;
active_replicas = active_replicas_tmp;
LOG_DEBUG(storage.log, "Strategy picker state updated, current replica: {}, active replicas: [{}]", current_replica_index, fmt::join(active_replicas, ", "));
}

View File

@ -7,6 +7,9 @@ from helpers.test_tools import assert_eq_with_retry
def fill_nodes(nodes):
for node in nodes:
node.query("DROP TABLE IF EXISTS test SYNC")
for node in nodes:
node.query(
"""
@ -29,11 +32,7 @@ nodes = [node_1, node_2, node_3]
def fill_table():
node_1.query("TRUNCATE TABLE test")
for node in nodes:
node.query("SYSTEM SYNC REPLICA test")
fill_nodes(nodes)
check_data(0, 0)
# it will create multiple parts in each partition and probably cause merges