Skip to content

Commit e237394

Browse files
[fix] oss-cluster local benchmarks (compatibility confirmed with RSCoordinator) (#177)
1 parent ea7b368 commit e237394

File tree

8 files changed

+32
-11
lines changed

8 files changed

+32
-11
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisbench-admin"
3-
version = "0.4.3"
3+
version = "0.4.4"
44
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
55
authors = ["filipecosta90 <[email protected]>"]
66
readme = "README.md"

redisbench_admin/run/cluster.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@
88
import redis
99

1010

11-
def cluster_init_steps(args, clusterconfig, local_module_file, r_conns, shard_count):
11+
def cluster_init_steps(
12+
args, clusterconfig, local_module_file, r_conns, shard_count, contains_dataset=True
13+
):
1214
startup_nodes = []
1315
for p in range(args.port, args.port + shard_count):
1416
primary_conn = redis.StrictRedis(port=p)
15-
primary_conn.execute_command("DEBUG RELOAD NOSAVE")
17+
if contains_dataset:
18+
# force debug reload nosave to replace the current database with the contents of an existing RDB file
19+
primary_conn.execute_command("DEBUG RELOAD NOSAVE")
1620
r_conns.append(primary_conn)
1721
startup_nodes.append({"host": "127.0.0.1", "port": "{}".format(p)})
1822
if clusterconfig is not None:

redisbench_admin/run/common.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,22 @@ def run_redis_pre_steps(benchmark_config, r, required_modules):
394394
fts_indexname = fts_indexname.decode()
395395
ft_info = r.execute_command("ft.info {}".format(fts_indexname))
396396
is_indexing = None
397+
percent_indexed = "0.0"
397398
for arraypos, arrayval in enumerate(ft_info, start=0):
399+
if arrayval == b"percent_indexed" or arrayval == "percent_indexed":
400+
percent_indexed = ft_info[arraypos + 1]
398401
if arrayval == b"indexing" or arrayval == "indexing":
399402
is_indexing = ft_info[arraypos + 1]
400-
if is_indexing == "0" or is_indexing == b"0":
403+
404+
logging.info(
405+
"indexing={} ; percent_indexed={}.".format(
406+
is_indexing, percent_indexed
407+
)
408+
)
409+
if is_indexing == "0" or is_indexing == b"0" or is_indexing == 0:
401410
loading_indices.pop(index_pos)
402411

403-
time.sleep(1)
412+
time.sleep(5)
404413
logging.info("Loaded all secondary indices.")
405414

406415
return artifact_versions[0]

redisbench_admin/run/ftsb/ftsb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def prepare_ftsb_benchmark_command(
3333
["--host", "{}:{}".format(server_private_ip, server_plaintext_port)]
3434
)
3535
if cluster_api_enabled is True:
36-
command_arr.extend(["--cluster"])
36+
command_arr.extend(["--cluster-mode"])
3737
if "parameters" in benchmark_config:
3838
for k in benchmark_config["parameters"]:
3939
if "input" in k:

redisbench_admin/run_local/run_local.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def run_local_command_logic(args, project_name, project_version):
193193
"CLUSTER SAVECONFIG"
194194
)
195195

196-
check_dataset_local_requirements(
196+
dataset, _, _ = check_dataset_local_requirements(
197197
benchmark_config,
198198
temporary_dir,
199199
dirname,
@@ -223,12 +223,16 @@ def run_local_command_logic(args, project_name, project_version):
223223
r = redis.StrictRedis(port=args.port)
224224

225225
if setup_type == "oss-cluster":
226+
contains_rdb = False
227+
if dataset is not None:
228+
contains_rdb = True
226229
startup_nodes = cluster_init_steps(
227230
args,
228231
clusterconfig,
229232
local_module_file,
230233
r_conns,
231234
shard_count,
235+
contains_rdb,
232236
)
233237

234238
rc = RedisCluster(

redisbench_admin/run_remote/run_remote.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def run_remote_command_logic(args, project_name, project_version):
264264
)
265265

266266
if setup_type == "oss-standalone":
267-
full_logfile = spin_up_standalone_remote_redis(
267+
full_logfile, dataset = spin_up_standalone_remote_redis(
268268
benchmark_config,
269269
server_public_ip,
270270
username,
@@ -306,12 +306,16 @@ def run_remote_command_logic(args, project_name, project_version):
306306
)
307307

308308
if setup_type == "oss-cluster":
309+
contains_rdb = False
310+
if dataset is not None:
311+
contains_rdb = True
309312
startup_nodes = cluster_init_steps(
310313
args,
311314
clusterconfig,
312315
local_module_file,
313316
r_conns,
314317
shard_count,
318+
contains_rdb,
315319
)
316320

317321
rc = RedisCluster(

redisbench_admin/run_remote/standalone.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def spin_up_standalone_remote_redis(
2828
dbdir_folder=None,
2929
):
3030
# copy the rdb to DB machine
31-
check_dataset_remote_requirements(
31+
_, dataset, _, _ = check_dataset_remote_requirements(
3232
benchmark_config,
3333
server_public_ip,
3434
username,
@@ -80,4 +80,4 @@ def spin_up_standalone_remote_redis(
8080
# start redis-server
8181
commands = [initial_redis_cmd]
8282
execute_remote_commands(server_public_ip, username, private_key, commands)
83-
return full_logfile
83+
return full_logfile, dataset

redisbench_admin/utils/remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def check_dataset_remote_requirements(
163163
remote_dataset_file,
164164
None,
165165
)
166-
return res
166+
return res, dataset, fullpath, tmppath
167167

168168

169169
def setup_remote_environment(

0 commit comments

Comments
 (0)