diff --git a/src/v/cloud_storage/partition_manifest.cc b/src/v/cloud_storage/partition_manifest.cc index 85b89df4e6ec1..cffc7aea0bb3e 100644 --- a/src/v/cloud_storage/partition_manifest.cc +++ b/src/v/cloud_storage/partition_manifest.cc @@ -730,7 +730,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 cab061378d374..d27db9dc00d6d 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));