Skip to content

Commit

Permalink
c/topic_table: add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtanov committed Sep 12, 2024
1 parent a694869 commit a4c92ac
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/v/cluster/data_migration_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "cloud_storage/topic_mount_handler.h"
#include "cluster/partition_leaders_table.h"
#include "config/node_config.h"
#include "container/printable_range.h"
#include "data_migration_frontend.h"
#include "data_migration_types.h"
#include "data_migration_worker.h"
Expand Down Expand Up @@ -193,6 +194,7 @@ ss::future<> backend::loop_once() {
}

ss::future<> backend::work_once() {
vlog(dm_log.info, "begin backend work cycle");
// process pending deltas
auto unprocessed_deltas = std::move(_unprocessed_deltas);
for (auto&& delta : unprocessed_deltas) {
Expand Down Expand Up @@ -307,6 +309,7 @@ ss::future<> backend::work_once() {
} else {
_timer.rearm(next_tick);
}
vlog(dm_log.info, "end backend work cycle");
}

void backend::wakeup() { _sem.signal(1 - _sem.available_units()); }
Expand Down Expand Up @@ -762,6 +765,12 @@ void backend::to_advance_if_done(
ar_it->second = advance_info(sought_state);
}
_migration_states.erase(it);
} else {
vlog(
dm_log.trace,
"outstanding topics for migration {}: {}",
it->first,
printable_range(rs.outstanding_topics | std::views::keys));
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/v/cluster/data_migration_frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,15 @@ ss::future<std::error_code> frontend::do_remove_migration(id id) {
validate_migration_shard();
auto ec = co_await insert_barrier();
if (ec) {
vlog(dm_log.warn, "failed waiting for barrier: {}", ec);
co_return ec;
}
/**
* preliminary validation of migration existence
*/
auto migration = _table.get_migration(id);
if (!migration) {
vlog(dm_log.warn, "migration {} id not found", id);
co_return errc::data_migration_not_exists;
}

Expand All @@ -383,8 +385,10 @@ ss::future<std::error_code> frontend::do_remove_migration(id id) {
_operation_timeout + model::timeout_clock::now());

if (ec) {
vlog(dm_log.warn, "failed to send remove_data_migration_cmd: {}", ec);
co_return ec;
}
vlog(dm_log.debug, "successfully sent migration {} delete request", id);

co_return errc::success;
}
Expand Down
5 changes: 5 additions & 0 deletions src/v/cluster/topic_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ ss::future<std::error_code>
topic_table::apply(create_partition_cmd cmd, model::offset offset) {
auto const migration_state = _migrated_resources.get_topic_state(
cmd.value.cfg.tp_ns);
vlog(
clusterlog.trace,
"attempting to create a partition in {}, migration state = {}",
cmd.value.cfg.tp_ns,
migration_state);
if (
migration_state
!= data_migrations::migrated_resource_state::non_restricted) {
Expand Down

0 comments on commit a4c92ac

Please sign in to comment.