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 Sep 2, 2024
1 parent b7f903b commit 54a837b
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 54a837b

Please sign in to comment.