Skip to content

Commit

Permalink
c/migrations: logging improvements
Browse files Browse the repository at this point in the history
log when a migrated partition changes leader
  • Loading branch information
bashtanov committed Aug 29, 2024
1 parent 69cd3ee commit 323f56f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/v/cluster/data_migration_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ ss::future<> worker::handle_operation_result(

void worker::handle_leadership_update(const model::ntp& ntp, bool is_leader) {
auto it = _managed_ntps.find(ntp);
vlog(
dm_log.info,
"got leadership update regarding ntp={}, is_leader={}",
ntp,
is_leader);
if (it == _managed_ntps.end() || it->second.is_leader == is_leader) {
return;
}
Expand Down Expand Up @@ -275,6 +280,11 @@ ss::future<errc> worker::do_work(

void worker::spawn_work_if_leader(managed_ntp_it it) {
vassert(!it->second.is_running, "work already running");
vlog(
dm_log.info,
"attempting to spawn work for ntp={}, is_leader={}",
it->first,
it->second.is_leader);
if (!it->second.is_leader) {
return;
}
Expand Down

0 comments on commit 323f56f

Please sign in to comment.