From 839004042a08f9f405f53b19250e02478f3e5626 Mon Sep 17 00:00:00 2001 From: Michal Maslanka Date: Mon, 20 Nov 2023 08:28:25 +0100 Subject: [PATCH 1/3] r/stm_manager: do not log shutdown exception when applying snapshot Signed-off-by: Michal Maslanka --- src/v/raft/state_machine_manager.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/v/raft/state_machine_manager.cc b/src/v/raft/state_machine_manager.cc index f8e6ddd1f31b6..3fbe9bb3b0a37 100644 --- a/src/v/raft/state_machine_manager.cc +++ b/src/v/raft/state_machine_manager.cc @@ -215,7 +215,10 @@ ss::future<> state_machine_manager::apply_raft_snapshot() { co_await snapshot->reader.close(); if (fut.failed()) { const auto e = fut.get_exception(); - vlog(_log.error, "error applying raft snapshot - {}", e); + // do not log known shutdown exceptions as errors + if (!ssx::is_shutdown_exception(e)) { + vlog(_log.error, "error applying raft snapshot - {}", e); + } std::rethrow_exception(e); } } From 456fbc757f409ccf07443e8892c297056329a7a7 Mon Sep 17 00:00:00 2001 From: Michal Maslanka Date: Mon, 20 Nov 2023 11:42:16 +0100 Subject: [PATCH 2/3] tests: fixed random node operations log allowed list Signed-off-by: Michal Maslanka --- tests/rptest/tests/random_node_operations_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/rptest/tests/random_node_operations_test.py b/tests/rptest/tests/random_node_operations_test.py index a6b3f7de9cd60..a81cf2948ce6b 100644 --- a/tests/rptest/tests/random_node_operations_test.py +++ b/tests/rptest/tests/random_node_operations_test.py @@ -29,9 +29,11 @@ from rptest.clients.offline_log_viewer import OfflineLogViewer TS_LOG_ALLOW_LIST = [ - re.compile("archival_stm.*Replication wait for archival STM timed out"), + re.compile( + ".*archival_metadata_stm.*Replication wait for archival STM timed out" + ), # topic deletion may happen before data were uploaded - re.compile("cloud_storage.*Failed to fetch manifest during finalize().*") + re.compile(".*cloud_storage.*Failed to fetch manifest during finalize().*") ] From b1c1d014a1b6b263a465f5796e9586a9ba9150cf Mon Sep 17 00:00:00 2001 From: Michal Maslanka Date: Mon, 20 Nov 2023 17:08:06 +0100 Subject: [PATCH 3/3] cs/manifest: allow updating kafka start offset with the same offset Previously validation was failing when `_kafka_start_offset` was overridden with the same offset. Since re-setting the offset to the same number doesn't change anything we may relax the validation here. Signed-off-by: Michal Maslanka --- src/v/cloud_storage/partition_manifest.cc | 2 +- src/v/cloud_storage/tests/partition_manifest_test.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/v/cloud_storage/partition_manifest.cc b/src/v/cloud_storage/partition_manifest.cc index fb048579f0f30..68a5b9d4c9458 100644 --- a/src/v/cloud_storage/partition_manifest.cc +++ b/src/v/cloud_storage/partition_manifest.cc @@ -744,7 +744,7 @@ void partition_manifest::set_archive_clean_offset( bool partition_manifest::advance_start_kafka_offset( kafka::offset new_start_offset) { - if (_start_kafka_offset_override >= new_start_offset) { + if (_start_kafka_offset_override > new_start_offset) { return false; } _start_kafka_offset_override = new_start_offset; diff --git a/src/v/cloud_storage/tests/partition_manifest_test.cc b/src/v/cloud_storage/tests/partition_manifest_test.cc index 1308fc901fd29..5cd2851c534b2 100644 --- a/src/v/cloud_storage/tests/partition_manifest_test.cc +++ b/src/v/cloud_storage/tests/partition_manifest_test.cc @@ -1431,9 +1431,9 @@ SEASTAR_THREAD_TEST_CASE(test_partition_manifest_start_kafka_offset_advance) { m.get_start_kafka_offset_override(), kafka::offset(370)); BOOST_REQUIRE_EQUAL(m.get_start_offset(), model::offset(100)); BOOST_REQUIRE_EQUAL(m.get_start_kafka_offset(), kafka::offset(90)); - + // Allow update with the same value + BOOST_REQUIRE(m.advance_start_kafka_offset(kafka::offset(370))); // If trying to move back, it should no-op. - BOOST_REQUIRE(!m.advance_start_kafka_offset(kafka::offset(370))); BOOST_REQUIRE(!m.advance_start_kafka_offset(kafka::offset(369))); BOOST_REQUIRE_EQUAL( m.get_start_kafka_offset_override(), kafka::offset(370));