diff --git a/src/v/archival/ntp_archiver_service.cc b/src/v/archival/ntp_archiver_service.cc index a3f26eb8f007..fa85fe12bd40 100644 --- a/src/v/archival/ntp_archiver_service.cc +++ b/src/v/archival/ntp_archiver_service.cc @@ -2036,9 +2036,9 @@ model::offset ntp_archiver::max_uploadable_offset_exclusive() const { } ss::future ntp_archiver::upload_next_candidates( - std::optional max_offset_override_exclusive) { - auto max_offset_exclusive = max_offset_override_exclusive - ? *max_offset_override_exclusive + std::optional unsafe_max_offset_override_exclusive) { + auto max_offset_exclusive = unsafe_max_offset_override_exclusive + ? *unsafe_max_offset_override_exclusive : max_uploadable_offset_exclusive(); vlog( _rtclog.debug, diff --git a/src/v/archival/ntp_archiver_service.h b/src/v/archival/ntp_archiver_service.h index 39d75f23c7c4..a7bbbde43b64 100644 --- a/src/v/archival/ntp_archiver_service.h +++ b/src/v/archival/ntp_archiver_service.h @@ -187,12 +187,14 @@ class ntp_archiver { /// will pick not more than '_concurrency' candidates and start /// uploading them. /// - /// \param max_offset_override_exclusive Overrides the maximum offset - /// that can be uploaded. If nullopt, the maximum offset is - /// calculated automatically. + /// \param unsafe_max_offset_override_exclusive Overrides the maximum offset + /// that can be uploaded. ONLY FOR TESTING. It is not clamped to a + /// safe value/committed offset as some tests work directly with + /// segments bypassing the raft thus not advancing the committed + /// offset. /// \return future that returns number of uploaded/failed segments virtual ss::future upload_next_candidates( - std::optional max_offset_override_exclusive + std::optional unsafe_max_offset_override_exclusive = std::nullopt); ss::future sync_manifest();