Skip to content

Fixed describe of the paused state of the transfer #22553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions ydb/core/transfer/ut/functional/transfer_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,41 @@ Y_UNIT_TEST_SUITE(Transfer)
testCase.DropTopic();
}

Y_UNIT_TEST(DescribeTransferWithErrorTopicNotFound)
{
MainTestCase testCase;
testCase.CreateTable(R"(
CREATE TABLE `%s` (
Key Uint64 NOT NULL,
Message Utf8,
PRIMARY KEY (Key)
) WITH (
STORE = %s
);
)");

testCase.CreateTransfer(R"(
$l = ($x) -> {
return [
<|
Key:CAST($x._offset AS Uint64),
Message:CAST($x._data AS Utf8)
|>
];
};
)", MainTestCase::CreateTransferSettings::WithLocalTopic(false));

testCase.CheckTransferStateError("Path not found");

auto d = testCase.DescribeTransfer();
UNIT_ASSERT_VALUES_EQUAL(d.GetTransferDescription().GetState(), TTransferDescription::EState::Error);
UNIT_ASSERT_VALUES_EQUAL(d.GetTransferDescription().GetSrcPath(), TStringBuilder() << "local/" << testCase.TopicName);
UNIT_ASSERT_VALUES_EQUAL(d.GetTransferDescription().GetDstPath(), TStringBuilder() << "/local/" << testCase.TableName);

testCase.DropTransfer();
testCase.DropTable();
}

Y_UNIT_TEST(CustomConsumer)
{
MainTestCase testCase;
Expand Down
14 changes: 10 additions & 4 deletions ydb/core/tx/replication/controller/tx_describe_replication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ class TController::TTxDescribeReplication: public TTxBase {
}

bool isTransfer = replication->GetConfig().HasTransferSpecific();
if (isTransfer) {
auto& specific = replication->GetConfig().GetTransferSpecific();

auto& transferSpecific = *Result->Record.MutableTransferSpecific();
transferSpecific.MutableTarget()->SetSrcPath(specific.GetTarget().GetSrcPath());
transferSpecific.MutableTarget()->SetDstPath(specific.GetTarget().GetDstPath());
transferSpecific.MutableTarget()->SetTransformLambda(specific.GetTarget().GetTransformLambda());
transferSpecific.MutableBatching()->CopyFrom(specific.GetBatching());
}

for (ui64 tid = 0; tid < replication->GetNextTargetId(); ++tid) {
auto* target = replication->FindTarget(tid);
if (!target) {
Expand All @@ -209,11 +219,7 @@ class TController::TTxDescribeReplication: public TTxBase {
auto& specific = replication->GetConfig().GetTransferSpecific();

auto& transferSpecific = *Result->Record.MutableTransferSpecific();
transferSpecific.MutableTarget()->SetSrcPath(target->GetSrcPath());
transferSpecific.MutableTarget()->SetDstPath(target->GetDstPath());
transferSpecific.MutableTarget()->SetConsumerName(target->GetStreamConsumerName() ? target->GetStreamConsumerName() : specific.GetTarget().GetConsumerName());
transferSpecific.MutableTarget()->SetTransformLambda(specific.GetTarget().GetTransformLambda());
transferSpecific.MutableBatching()->CopyFrom(specific.GetBatching());
}

auto& item = *Result->Record.AddTargets();
Expand Down
1 change: 1 addition & 0 deletions ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ int TCommandDescribe::PrintTransferResponsePretty(const NYdb::NReplication::TDes
Cout << Endl << "State: ";
switch (desc.GetState()) {
case NReplication::TTransferDescription::EState::Running:
case NReplication::TTransferDescription::EState::Paused:
Cout << desc.GetState();
break;
case NReplication::TTransferDescription::EState::Error:
Expand Down
Loading