fix: fail the restore stage when writes during backup fail
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -167,7 +167,7 @@ RESTORE_LABEL ?= restore
|
|||||||
bench_restore:
|
bench_restore:
|
||||||
$(KEEP_AWAKE) uv run python bench/run.py --profile restore --label $(RESTORE_LABEL)
|
$(KEEP_AWAKE) uv run python bench/run.py --profile restore --label $(RESTORE_LABEL)
|
||||||
|
|
||||||
# то же на малых размерах (самопроверка, сценарий защиты), ~2 мин; в git
|
# то же на малых размерах (самопроверка, сценарий защиты), ~1,5 мин; в git
|
||||||
# не идёт
|
# не идёт
|
||||||
.PHONY: bench_restore_quick
|
.PHONY: bench_restore_quick
|
||||||
bench_restore_quick:
|
bench_restore_quick:
|
||||||
|
|||||||
@@ -2532,6 +2532,16 @@ class Bench:
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
written = parse_summary(stand.work_dir / "last.json")
|
written = parse_summary(stand.work_dir / "last.json")
|
||||||
|
# backup не должен мешать записи: k6 выходит с 0 и при ошибках
|
||||||
|
if (
|
||||||
|
written["requests_failed"]
|
||||||
|
or written["requests_ok"] != p.restore_write_load
|
||||||
|
):
|
||||||
|
raise BenchError(
|
||||||
|
f"size {name}: writes during backup: "
|
||||||
|
f"{written['requests_ok']} of {p.restore_write_load} ok, "
|
||||||
|
f"{written['requests_failed']} failed",
|
||||||
|
)
|
||||||
dump_bytes = dump.stat().st_size
|
dump_bytes = dump.stat().st_size
|
||||||
counts_loaded = stand.table_counts()
|
counts_loaded = stand.table_counts()
|
||||||
self.say(
|
self.say(
|
||||||
|
|||||||
Reference in New Issue
Block a user