Skip to content

Commit

Permalink
Merge pull request #5769 from abhijat/use-correct-leadership-check-in…
Browse files Browse the repository at this point in the history
…-segment-upload

cloud_storage: use is_elected_leader for leadership query
  • Loading branch information
abhijat committed Aug 2, 2022
2 parents 831c838 + 62e6648 commit 157f418
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/v/archival/ntp_archiver_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ ss::future<> ntp_archiver::upload_loop() {
vlog(
_rtclog.debug,
"Cancelled upload of {} segments",
result.num_succeded);
result.num_cancelled);
}

if (!upload_loop_can_continue()) {
Expand Down Expand Up @@ -339,13 +339,13 @@ ntp_archiver::upload_segment(upload_candidate candidate) {
"current term: {}, "
"original term: {}",
[this, original_term](cloud_storage::lazy_abort_source& las) {
auto lost_leadership = !_partition->is_leader()
auto lost_leadership = !_partition->is_elected_leader()
|| _partition->term() != original_term;
if (unlikely(lost_leadership)) {
std::string reason{las.abort_reason()};
las.abort_reason(fmt::format(
fmt::runtime(reason),
_partition->is_leader(),
_partition->is_elected_leader(),
_partition->term(),
original_term));
}
Expand Down

0 comments on commit 157f418

Please sign in to comment.