File tree Expand file tree Collapse file tree 2 files changed +47
-4
lines changed
tx/replication/controller Expand file tree Collapse file tree 2 files changed +47
-4
lines changed Original file line number Diff line number Diff line change @@ -1311,5 +1311,42 @@ Y_UNIT_TEST_SUITE(Transfer)
1311
1311
testCase.DropTopic ();
1312
1312
testCase.DropTable ();
1313
1313
}
1314
+
1315
+ Y_UNIT_TEST (DescribeTransferWithErrorTopicNotFound)
1316
+ {
1317
+ MainTestCase testCase;
1318
+ testCase.CreateTable (R"(
1319
+ CREATE TABLE `%s` (
1320
+ Key Uint64 NOT NULL,
1321
+ Message Utf8,
1322
+ PRIMARY KEY (Key)
1323
+ ) WITH (
1324
+ STORE = %s
1325
+ );
1326
+ )" );
1327
+
1328
+ testCase.CreateTransfer (R"(
1329
+ $l = ($x) -> {
1330
+ return [
1331
+ <|
1332
+ Key:CAST($x._offset AS Uint64),
1333
+ Message:CAST($x._data AS Utf8)
1334
+ |>
1335
+ ];
1336
+ };
1337
+ )" , MainTestCase::CreateTransferSettings::WithLocalTopic (false ));
1338
+
1339
+ testCase.CheckTransferStateError (" Path not found" );
1340
+
1341
+ auto d = testCase.DescribeTransfer ();
1342
+ UNIT_ASSERT_VALUES_EQUAL (d.GetTransferDescription ().GetState (), TTransferDescription::EState::Error);
1343
+ UNIT_ASSERT_VALUES_EQUAL (d.GetTransferDescription ().GetSrcPath (), TStringBuilder () << " local/" << testCase.TopicName );
1344
+ UNIT_ASSERT_VALUES_EQUAL (d.GetTransferDescription ().GetDstPath (), TStringBuilder () << " /local/" << testCase.TableName );
1345
+
1346
+ testCase.DropTransfer ();
1347
+ testCase.DropTable ();
1348
+ }
1349
+
1350
+
1314
1351
}
1315
1352
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 ();
You can’t perform that action at this time.
0 commit comments