Skip to content

Commit d9456d2

Browse files
committed
microbench:string 索引补 name(10)(Nebula 3.x),compact 超时与诊断对齐 harness。
1 parent 5291fe0 commit d9456d2

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

microbench/lookup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ def load_lookup_data(suite: MicrobenchSuite) -> None:
3232
suite.wait_space_ready(LOOKUP_SPACE)
3333
resp = suite.execute("CREATE TAG IF NOT EXISTS person(name string, age int)")
3434
suite.check_resp_succeeded(resp)
35+
# 原版为 person(name);Nebula 3.x 变长 string 索引必须带长度(与 YIELD 同类适配)。
36+
# length=10 对齐 data_generate.random_string(10)。
3537
resp = suite.execute(
36-
"CREATE TAG INDEX IF NOT EXISTS personName ON person(name)"
38+
"CREATE TAG INDEX IF NOT EXISTS personName ON person(name(10))"
3739
)
3840
suite.check_resp_succeeded(resp)
3941
resp = suite.execute(

microbench/suite.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,11 @@ def record_storage_stage(self, stage: str) -> dict[str, Any]:
329329
def run_compact_job(
330330
self,
331331
space: str,
332-
timeout_sec: float = 1800.0,
332+
timeout_sec: Optional[float] = None,
333333
poll_interval: float = 2.0,
334334
) -> dict[str, Any]:
335+
if timeout_sec is None:
336+
timeout_sec = float(os.environ.get("MICROBENCH_COMPACT_TIMEOUT", "3600"))
335337
started = time.monotonic()
336338
self.check_resp_succeeded(self.execute(f"USE `{space}`"))
337339
resp = self.execute("SUBMIT JOB COMPACT")
@@ -364,8 +366,24 @@ def run_compact_job(
364366
break
365367
time.sleep(poll_interval)
366368
else:
369+
# Harness diagnostics only; do not alter compact semantics.
370+
jobs_diag = ""
371+
try:
372+
all_jobs = self.execute("SHOW JOBS")
373+
if all_jobs.is_succeeded():
374+
rows = []
375+
jkeys = _keys(all_jobs)
376+
for i in range(min(all_jobs.row_size(), 20)):
377+
cells = _row_cells(all_jobs.row_values(i))
378+
rows.append(
379+
{jkeys[j]: _cell_str(cells[j]) for j in range(len(jkeys))}
380+
)
381+
jobs_diag = f" SHOW JOBS(sample)={rows}"
382+
except Exception as exc: # noqa: BLE001
383+
jobs_diag = f" SHOW JOBS failed: {exc}"
367384
raise RuntimeError(
368385
f"timeout waiting for COMPACT job {job_id} last={last_status}"
386+
f"{jobs_diag}"
369387
)
370388
if last_status != "FINISHED":
371389
raise RuntimeError(f"COMPACT job {job_id} ended with {last_status}")

0 commit comments

Comments
 (0)