File tree Expand file tree Collapse file tree 3 files changed +46
-4
lines changed
tx/replication/controller
public/lib/ydb_cli/commands Expand file tree Collapse file tree 3 files changed +46
-4
lines changed Original file line number Diff line number Diff line change @@ -570,6 +570,41 @@ Y_UNIT_TEST_SUITE(Transfer)
570
570
testCase.DropTopic ();
571
571
}
572
572
573
+ Y_UNIT_TEST (DescribeTransferWithErrorTopicNotFound)
574
+ {
575
+ MainTestCase testCase;
576
+ testCase.CreateTable (R"(
577
+ CREATE TABLE `%s` (
578
+ Key Uint64 NOT NULL,
579
+ Message Utf8,
580
+ PRIMARY KEY (Key)
581
+ ) WITH (
582
+ STORE = %s
583
+ );
584
+ )" );
585
+
586
+ testCase.CreateTransfer (R"(
587
+ $l = ($x) -> {
588
+ return [
589
+ <|
590
+ Key:CAST($x._offset AS Uint64),
591
+ Message:CAST($x._data AS Utf8)
592
+ |>
593
+ ];
594
+ };
595
+ )" , MainTestCase::CreateTransferSettings::WithLocalTopic (false ));
596
+
597
+ testCase.CheckTransferStateError (" Path not found" );
598
+
599
+ auto d = testCase.DescribeTransfer ();
600
+ UNIT_ASSERT_VALUES_EQUAL (d.GetTransferDescription ().GetState (), TTransferDescription::EState::Error);
601
+ UNIT_ASSERT_VALUES_EQUAL (d.GetTransferDescription ().GetSrcPath (), TStringBuilder () << " local/" << testCase.TopicName );
602
+ UNIT_ASSERT_VALUES_EQUAL (d.GetTransferDescription ().GetDstPath (), TStringBuilder () << " /local/" << testCase.TableName );
603
+
604
+ testCase.DropTransfer ();
605
+ testCase.DropTable ();
606
+ }
607
+
573
608
Y_UNIT_TEST (CustomConsumer)
574
609
{
575
610
MainTestCase testCase;
Original file line number Diff line number Diff line change @@ -198,6 +198,16 @@ class TController::TTxDescribeReplication: public TTxBase {
198
198
}
199
199
200
200
bool isTransfer = replication->GetConfig ().HasTransferSpecific ();
201
+ if (isTransfer) {
202
+ auto & specific = replication->GetConfig ().GetTransferSpecific ();
203
+
204
+ auto & transferSpecific = *Result->Record .MutableTransferSpecific ();
205
+ transferSpecific.MutableTarget ()->SetSrcPath (specific.GetTarget ().GetSrcPath ());
206
+ transferSpecific.MutableTarget ()->SetDstPath (specific.GetTarget ().GetDstPath ());
207
+ transferSpecific.MutableTarget ()->SetTransformLambda (specific.GetTarget ().GetTransformLambda ());
208
+ transferSpecific.MutableBatching ()->CopyFrom (specific.GetBatching ());
209
+ }
210
+
201
211
for (ui64 tid = 0 ; tid < replication->GetNextTargetId (); ++tid) {
202
212
auto * target = replication->FindTarget (tid);
203
213
if (!target) {
@@ -209,11 +219,7 @@ class TController::TTxDescribeReplication: public TTxBase {
209
219
auto & specific = replication->GetConfig ().GetTransferSpecific ();
210
220
211
221
auto & transferSpecific = *Result->Record .MutableTransferSpecific ();
212
- transferSpecific.MutableTarget ()->SetSrcPath (target->GetSrcPath ());
213
- transferSpecific.MutableTarget ()->SetDstPath (target->GetDstPath ());
214
222
transferSpecific.MutableTarget ()->SetConsumerName (target->GetStreamConsumerName () ? target->GetStreamConsumerName () : specific.GetTarget ().GetConsumerName ());
215
- transferSpecific.MutableTarget ()->SetTransformLambda (specific.GetTarget ().GetTransformLambda ());
216
- transferSpecific.MutableBatching ()->CopyFrom (specific.GetBatching ());
217
223
}
218
224
219
225
auto & item = *Result->Record .AddTargets ();
Original file line number Diff line number Diff line change @@ -613,6 +613,7 @@ int TCommandDescribe::PrintTransferResponsePretty(const NYdb::NReplication::TDes
613
613
Cout << Endl << " State: " ;
614
614
switch (desc.GetState ()) {
615
615
case NReplication::TTransferDescription::EState::Running:
616
+ case NReplication::TTransferDescription::EState::Paused:
616
617
Cout << desc.GetState ();
617
618
break ;
618
619
case NReplication::TTransferDescription::EState::Error:
You can’t perform that action at this time.
0 commit comments