Skip to content

Commit 2fdfe89

Browse files
authored
Stability testing: workload_log (#13804)
1 parent 062fa7b commit 2fdfe89

File tree

3 files changed

+58
-2
lines changed

3 files changed

+58
-2
lines changed

ydb/tests/stability/library/__main__.py

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def __init__(self, ssh_username, cluster_path, ydbd_path, ydbd_next_path=None):
3939
self._unpack_resource('simple_queue'),
4040
self._unpack_resource('olap_workload'),
4141
self._unpack_resource('statistics_workload'),
42+
self._unpack_resource('ydb_cli'),
4243
)
4344

4445
self.kikimr_cluster = ExternalKiKiMRCluster(
@@ -193,7 +194,7 @@ def cleanup(self, mode='all'):
193194
if mode in ['all', 'dumps']:
194195
node.ssh_command('sudo rm -rf /coredumps/*', raise_on_error=False)
195196
if mode in ['all', 'logs']:
196-
node.ssh_command('sudo rm -rf /Berkanavt/kikimr_31003/logs/*', raise_on_error=False)
197+
node.ssh_command('sudo rm -rf /Berkanavt/kikimr_31*/logs/*', raise_on_error=False)
197198
node.ssh_command('sudo rm -rf /Berkanavt/kikimr/logs/*', raise_on_error=False)
198199
node.ssh_command('sudo rm -rf /Berkanavt/nemesis/log/*', raise_on_error=False)
199200
if mode == 'all':
@@ -291,6 +292,7 @@ def parse_args():
291292
"start_workload_simple_queue_row",
292293
"start_workload_simple_queue_column",
293294
"start_workload_olap_workload",
295+
"start_workload_log",
294296
"stop_workloads",
295297
"perform_checks",
296298
],
@@ -341,6 +343,49 @@ def main():
341343
'screen -d -m bash -c "while true; do /Berkanavt/nemesis/bin/simple_queue --database /Root/db1 --mode row; done"',
342344
raise_on_error=True
343345
)
346+
if action == "start_workload_log":
347+
for node_id, node in enumerate(stability_cluster.kikimr_cluster.nodes.values()):
348+
if node_id == 1:
349+
node.ssh_command([
350+
'/Berkanavt/nemesis/bin/ydb_cli',
351+
'--endpoint', f'grpc://localhost:{node.grpc_port}',
352+
'--database', '/Root/db1',
353+
'workload', 'log', 'clean'
354+
],
355+
raise_on_error=True
356+
)
357+
node.ssh_command([
358+
'/Berkanavt/nemesis/bin/ydb_cli',
359+
'--endpoint', f'grpc://localhost:{node.grpc_port}',
360+
'--database', '/Root/db1',
361+
'workload', 'log', 'init',
362+
'--len', '1000',
363+
'--int-cols', '20',
364+
'--key-cols', '20',
365+
'--min-partitions', '100',
366+
'--partition-size', '10',
367+
'--auto-partition', '0',
368+
'--ttl', '3600'
369+
],
370+
raise_on_error=True
371+
)
372+
for node_id, node in enumerate(stability_cluster.kikimr_cluster.nodes.values()):
373+
node.ssh_command([
374+
'screen -s workload_log -d -m bash -c "while true; do',
375+
'/Berkanavt/nemesis/bin/ydb_cli',
376+
'--endpoint', f'grpc://localhost:{node.grpc_port}',
377+
'--database', '/Root/db1',
378+
'workload', 'log', 'run', 'bulk_upsert',
379+
'--len', '1000',
380+
'--int-cols', '20',
381+
'--key-cols', '20',
382+
'--threads', '2000',
383+
'--timestamp_deviation', '180',
384+
'--seconds', '86400',
385+
'; done"'
386+
],
387+
raise_on_error=True
388+
)
344389
if action == "start_workload_simple_queue_column":
345390
for node_id, node in enumerate(stability_cluster.kikimr_cluster.nodes.values()):
346391
node.ssh_command(

ydb/tests/stability/library/how_to.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
- `start_workload_simple_queue_row`
2121
- `start_workload_simple_queue_column`
2222
- `start_workload_olap_workload`
23+
24+
not included in `start_all_workloads`:
25+
- `start_workload_log`
2326
2427
```
2528
./library start_all_workloads --cluster_path=<path_to_cluster.yaml> --ydbd_path=<repo_root>/ydb/apps/ydbd/ydbd
@@ -48,7 +51,7 @@
4851
``yq '.hosts[].name' <path_to_cluster.yaml> > ~/hosts.txt``
4952
2) check status
5053
```
51-
parallel-ssh -h ~/hosts.txt -i '
54+
parallel-ssh -h ~/hosts.txt -i -x "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" '
5255
if systemctl is-active --quiet nemesis; then
5356
echo "nemesis: Active"
5457
else
@@ -69,6 +72,11 @@
6972
else
7073
echo "simple_queue_column: Stopped"
7174
fi
75+
if ps aux | grep "/Berkanavt/nemesis/bin/ydb_cli" | grep -v grep > /dev/null; then
76+
echo "log workload: Running"
77+
else
78+
echo "log workload: Stopped"
79+
fi
7280
'
7381
```
7482
8) check cluster stability

ydb/tests/stability/library/ya.make

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ DATA(
99
)
1010

1111
DEPENDS(
12+
ydb/apps/ydb
1213
ydb/tools/cfg/bin
1314
ydb/tests/tools/nemesis/driver
1415
)
@@ -19,9 +20,11 @@ BUNDLE(
1920
ydb/tests/stress/statistics_workload NAME statistics_workload
2021
ydb/tools/cfg/bin NAME cfg
2122
ydb/tests/tools/nemesis/driver NAME nemesis
23+
ydb/apps/ydb NAME ydb_cli
2224
)
2325

2426
RESOURCE(
27+
ydb_cli ydb_cli
2528
simple_queue simple_queue
2629
olap_workload olap_workload
2730
statistics_workload statistics_workload

0 commit comments

Comments
 (0)