Skip to content

Commit 9b73d07

Browse files
When detecting search module confirm all indices are preloaded (#171)
* [fix] fixed property_group len calculation based on type within merge_default_and_specific_properties_dict_type * [fix] When detecting search module confirm all indices are preloaded * Bumping version from 0.3.10 to 0.3.11
1 parent 817327e commit 9b73d07

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
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.3.10"
3+
version = "0.3.11"
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/common.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import datetime as dt
99
import logging
1010
import os
11-
11+
import time
1212
import redis
1313

1414
from redisbench_admin.run.aibench_run_inference_redisai_vision.aibench_run_inference_redisai_vision import (
@@ -360,6 +360,32 @@ def run_redis_pre_steps(benchmark_config, r, required_modules):
360360
execute_init_commands_duration_seconds
361361
)
362362
)
363+
if "search" in module_names:
364+
logging.info(
365+
"Given redisearch was detected, checking for any index that is still indexing."
366+
)
367+
loading_indices = r.execute_command("ft._list")
368+
logging.info("Detected {} indices.".format(len(loading_indices)))
369+
while len(loading_indices) > 0:
370+
logging.info(
371+
"There are still {} indices loading. {}".format(
372+
len(loading_indices), loading_indices
373+
)
374+
)
375+
for index_pos, fts_indexname in enumerate(loading_indices, start=0):
376+
if type(fts_indexname) == bytes:
377+
fts_indexname = fts_indexname.decode()
378+
ft_info = r.execute_command("ft.info {}".format(fts_indexname))
379+
is_indexing = None
380+
for arraypos, arrayval in enumerate(ft_info, start=0):
381+
if arrayval == b"indexing" or arrayval == "indexing":
382+
is_indexing = ft_info[arraypos + 1]
383+
if is_indexing == "0" or is_indexing == b"0":
384+
loading_indices.pop(index_pos)
385+
386+
time.sleep(1)
387+
logging.info("Loaded all secondary indices.")
388+
363389
return artifact_versions[0]
364390

365391

0 commit comments

Comments
 (0)