Repository navigation
Closed
Closed
Copy link
Labels
flaky testflaky test found by CI
Description
[gw4] linux -- Python 3.10.12 /usr/bin/python3
cluster = <helpers.cluster.ClickHouseCluster object at 0x7f2aa4d354b0>
def test_drop_table(cluster):
node = list(cluster.instances.values())[0]
node2 = list(cluster.instances.values())[1]
# We are checking log entries in this test, so it should be empty before the execution.
node.rotate_logs()
node2.rotate_logs()
# drop table .. sync, doesn't removes replica from zk immediately. Prevent race contition by removing old nodes from zk.
remove_leftovers_from_zk(node, node2, "1")
remove_leftovers_from_zk(node2, node, "2")
node.query(
"create table test_drop_table (n int) engine=ReplicatedMergeTree('/test/drop_table', '1') order by n partition by n % 99 settings storage_policy='s3'"
)
node2.query(
"create table test_drop_table (n int) engine=ReplicatedMergeTree('/test/drop_table', '2') order by n partition by n % 99 settings storage_policy='s3'"
)
node.query("insert into test_drop_table select * from numbers(1000)")
node2.query("system sync replica test_drop_table")
with PartitionManager() as pm:
pm._add_rule(
{
"probability": 0.01,
"destination": node.ip_address,
"source_port": 2181,
"action": "REJECT --reject-with tcp-reset",
}
)
pm._add_rule(
{
"probability": 0.01,
"source": node.ip_address,
"destination_port": 2181,
"action": "REJECT --reject-with tcp-reset",
}
)
# Will drop in background with retries
node.query("drop table test_drop_table")
# It should not be possible to create a replica with the same path until the previous one is completely dropped
for i in range(0, 100):
> node.query_and_get_answer_with_error(
"create table if not exists test_drop_table (n int) "
"engine=ReplicatedMergeTree('/test/drop_table', '1') "
"order by n partition by n % 99 settings storage_policy='s3'"
)
test_replicated_merge_tree_s3_zero_copy/test.py:206:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
helpers/cluster.py:3788: in query_and_get_answer_with_error
return self.client.query_and_get_answer_with_error(
helpers/client.py:39: in wrap
return func(self, *args, **kwargs)
helpers/client.py:165: in query_and_get_answer_with_error
).get_answer_and_error()
helpers/client.py:292: in get_answer_and_error
self.process.wait(timeout=DEFAULT_QUERY_TIMEOUT)
/usr/lib/python3.10/subprocess.py:1209: in wait
return self._wait(timeout=timeout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Popen: returncode: None args: ['/clickhouse', 'client', '--host', '172.16.3...>
timeout = 600
def _wait(self, timeout):
"""Internal implementation of wait() on POSIX."""
if self.returncode is not None:
return self.returncode
if timeout is not None:
endtime = _time() + timeout
# Enter a busy loop if we have a timeout. This busy loop was
# cribbed from Lib/threading.py in Thread.wait() at r71065.
delay = 0.0005 # 500 us -> initial delay of 1 ms
while True:
if self._waitpid_lock.acquire(False):
try:
if self.returncode is not None:
break # Another thread waited.
(pid, sts) = self._try_wait(os.WNOHANG)
assert pid == self.pid or pid == 0
if pid == self.pid:
self._handle_exitstatus(sts)
break
finally:
self._waitpid_lock.release()
remaining = self._remaining_time(endtime)
if remaining <= 0:
raise TimeoutExpired(self.args, timeout)
delay = min(delay * 2, remaining, .05)
> time.sleep(delay)
E Failed: Timeout >900.0s
/usr/lib/python3.10/subprocess.py:1953: Failed
Metadata
Metadata
Assignees
Labels
flaky testflaky test found by CI
Activity
tuanpach commentedon Dec 11, 2024
When the keep session expires, the merge tree table tries to restore metadata from Keeper. With the default settings (
keeper_max_retries=10, keeper_retry_initial_backoff_ms=100, keeper_retry_max_backoff_ms=5000), the query might take up to 25s.We run the test 5 times, and loop number is 100; the total processing time might exceed the test timeout which is 900s.
Possible solution:
keeper_max_retriesfrom10to3,keeper_retry_max_backoff_msfrom5000to500in the query settings.