diff --git a/db/batchlog_manager.cc b/db/batchlog_manager.cc index 14e26e418c..e13a7ae79a 100644 --- a/db/batchlog_manager.cc +++ b/db/batchlog_manager.cc @@ -191,6 +191,7 @@ future db::batchlog_manager::replay_all_failed_batches if (utils::get_local_injector().is_enabled("skip_batch_replay")) { blogger.debug("Skipping batch replay due to skip_batch_replay injection"); + all_replayed = all_batches_replayed::no; co_return stop_iteration::no; } diff --git a/test/topology_custom/test_batchlog_manager.py b/test/topology_custom/test_batchlog_manager.py index b02031fa62..5d0a9cb82f 100644 --- a/test/topology_custom/test_batchlog_manager.py +++ b/test/topology_custom/test_batchlog_manager.py @@ -295,7 +295,8 @@ async def test_drop_mutations_for_dropped_table(manager: ManagerClient) -> None: @pytest.mark.asyncio @skip_mode("release", "error injections are not supported in release mode") -async def test_batchlog_replay_failure_during_repair(manager: ManagerClient) -> None: +@pytest.mark.parametrize("repair_cache", [True, False]) +async def test_batchlog_replay_failure_during_repair(manager: ManagerClient, repair_cache: bool) -> None: """ We want to verify that repair_time will not be updated if batchlog replay fails. @@ -315,7 +316,7 @@ async def test_batchlog_replay_failure_during_repair(manager: ManagerClient) -> cmdline=['--enable-cache', '0', "--hinted-handoff-enabled", "0", "--logger-log-level", "batchlog_manager=trace:repair=debug", - "--repair-hints-batchlog-flush-cache-time-in-ms", "0"] + "--repair-hints-batchlog-flush-cache-time-in-ms", "1000000" if repair_cache else "0"] config = {"error_injections_at_startup": ["short_batchlog_manager_replay_interval"], "write_request_timeout_in_ms": 2000, 'group0_tombstone_gc_refresh_interval_in_ms': 1000, @@ -390,6 +391,9 @@ async def test_batchlog_replay_failure_during_repair(manager: ManagerClient) -> # be triggered from now on (if it's present). await disable_injection("skip_batch_replay") + await s1_log.wait_for("Batchlog replay on shard 0: done", timeout=60, from_mark=s1_mark) + await s1_log.wait_for("Batchlog replay on shard 1: done", timeout=60, from_mark=s1_mark) + await manager.api.repair(s1.ip_addr, ks, "my_table") await manager.api.flush_keyspace(s1.ip_addr, ks)