Skip to content

Commit

Permalink
archival: Log collection status
Browse files Browse the repository at this point in the history
The upload candidate collection status is logged at different levels. An
offset inside batch is logged on warn level while all other statuses are
logged at debug.
  • Loading branch information
abhijat committed Nov 17, 2023
1 parent 325723e commit 50cf0b7
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/v/archival/ntp_archiver_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1478,12 +1478,25 @@ ntp_archiver::schedule_single_upload(const upload_context& upload_ctx) {
upload.sources.empty()
&& upload_ctx.upload_kind == segment_upload_kind::compacted
&& model::offset{} != upload.final_offset) {
vlog(
_rtclog.warn,
"Upload skipped for range: {}-{} because these offsets lie inside "
"batches or the reupload is not smaller than the current segment",
const auto log_msg = fmt::format(
"Upload skipped for range: {}-{}, reason: {}",
upload.starting_offset,
upload.final_offset);
upload.final_offset,
upload.status);

switch (upload.status) {
case upload_candidate::creation_status::success:
// we should never end up here
break;
case upload_candidate::creation_status::err_offset_inside_batch:
vlog(_rtclog.warn, "{}", log_msg);
break;
case upload_candidate::creation_status::err_size_unchanged:
case upload_candidate::creation_status::err_no_segments:
case upload_candidate::creation_status::err_missing_head_seek:
case upload_candidate::creation_status::err_missing_tail_seek:
vlog(_rtclog.debug, "{}", log_msg);
}
co_return scheduled_upload{
.result = std::nullopt,
.inclusive_last_offset = upload.final_offset,
Expand Down

0 comments on commit 50cf0b7

Please sign in to comment.