Skip to content

Commit

Permalink
archival: rename upload_context::last_offset to end_offset_exclusive
Browse files Browse the repository at this point in the history
This communicates better the type of offset. No functional
changes/cosmetic only.
  • Loading branch information
nvartolomei committed May 8, 2024
1 parent ff358cc commit 2647d9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/v/archival/ntp_archiver_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,7 @@ ntp_archiver::do_schedule_single_upload(
ss::future<ntp_archiver::scheduled_upload>
ntp_archiver::schedule_single_upload(const upload_context& upload_ctx) {
auto start_upload_offset = upload_ctx.start_offset;
auto last_stable_offset = upload_ctx.last_offset;
auto last_stable_offset = upload_ctx.end_offset_exclusive;

auto log = _parent.log();

Expand Down Expand Up @@ -1642,7 +1642,7 @@ ntp_archiver::schedule_uploads(model::offset max_offset_exclusive) {
params.push_back({
.upload_kind = segment_upload_kind::non_compacted,
.start_offset = start_upload_offset,
.last_offset = max_offset_exclusive,
.end_offset_exclusive = max_offset_exclusive,
.allow_reuploads = allow_reuploads_t::no,
.archiver_term = _start_term,
});
Expand All @@ -1653,7 +1653,7 @@ ntp_archiver::schedule_uploads(model::offset max_offset_exclusive) {
params.push_back({
.upload_kind = segment_upload_kind::compacted,
.start_offset = compacted_segments_upload_start,
.last_offset = model::offset::max(),
.end_offset_exclusive = model::offset::max(),
.allow_reuploads = allow_reuploads_t::yes,
.archiver_term = _start_term,
});
Expand All @@ -1674,7 +1674,7 @@ ntp_archiver::schedule_uploads(std::vector<upload_context> loop_contexts) {
"offset: {}, last offset: {}, uploads remaining: {}",
ctx.upload_kind,
ctx.start_offset,
ctx.last_offset,
ctx.end_offset_exclusive,
uploads_remaining);
break;
}
Expand All @@ -1684,13 +1684,13 @@ ntp_archiver::schedule_uploads(std::vector<upload_context> loop_contexts) {
"scheduling uploads, start offset: {}, last offset: {}, upload kind: "
"{}, uploads remaining: {}",
ctx.start_offset,
ctx.last_offset,
ctx.end_offset_exclusive,
ctx.upload_kind,
uploads_remaining);

// this metric is only relevant for non compacted uploads.
if (ctx.upload_kind == segment_upload_kind::non_compacted) {
_probe->upload_lag(ctx.last_offset - ctx.start_offset);
_probe->upload_lag(ctx.end_offset_exclusive - ctx.start_offset);
}

std::exception_ptr ep;
Expand Down
2 changes: 1 addition & 1 deletion src/v/archival/ntp_archiver_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class ntp_archiver {
/// The next scheduled upload will start from this offset
model::offset start_offset;
/// Uploads will stop at this offset
model::offset last_offset;
model::offset end_offset_exclusive;
/// Controls checks for reuploads, compacted segments have this
/// check disabled
allow_reuploads_t allow_reuploads;
Expand Down

0 comments on commit 2647d9f

Please sign in to comment.