6
6
7
7
#include < ydb/core/change_exchange/change_sender_common_ops.h>
8
8
#include < ydb/core/change_exchange/change_sender_monitoring.h>
9
+ #include < ydb/core/change_exchange/util.h>
9
10
#include < ydb/core/persqueue/writer/source_id_encoding.h>
10
11
#include < ydb/core/persqueue/writer/writer.h>
11
12
#include < ydb/core/tx/scheme_cache/helpers.h>
@@ -390,16 +391,6 @@ class TCdcChangeSenderMain
390
391
return false ;
391
392
}
392
393
393
- static TVector<ui64> MakePartitionIds (const TVector<NKikimr::TKeyDesc::TPartitionInfo>& partitions) {
394
- TVector<ui64> result (Reserve (partitions.size ()));
395
-
396
- for (const auto & partition : partitions) {
397
- result.push_back (partition.ShardId );
398
- }
399
-
400
- return result;
401
- }
402
-
403
394
// / ResolveCdcStream
404
395
405
396
void ResolveCdcStream () {
@@ -521,6 +512,14 @@ class TCdcChangeSenderMain
521
512
return ;
522
513
}
523
514
515
+ const auto topicVersion = entry.Self ->Info .GetVersion ().GetGeneralVersion ();
516
+ if (TopicVersion && TopicVersion == topicVersion) {
517
+ CreateSenders ();
518
+ return Become (&TThis::StateMain);
519
+ }
520
+
521
+ TopicVersion = topicVersion;
522
+
524
523
const auto & pqDesc = entry.PQGroupInfo ->Description ;
525
524
const auto & pqConfig = pqDesc.GetPQTabletConfig ();
526
525
@@ -529,16 +528,12 @@ class TCdcChangeSenderMain
529
528
PartitionToShard.emplace (partition.GetPartitionId (), partition.GetTabletId ());
530
529
}
531
530
532
- const auto topicVersion = entry.Self ->Info .GetVersion ().GetGeneralVersion ();
533
- const bool versionChanged = !TopicVersion || TopicVersion != topicVersion;
534
- TopicVersion = topicVersion;
535
-
536
531
Y_ABORT_UNLESS (entry.PQGroupInfo ->Schema );
537
532
KeyDesc = NKikimr::TKeyDesc::CreateMiniKeyDesc (entry.PQGroupInfo ->Schema );
538
533
Y_ABORT_UNLESS (entry.PQGroupInfo ->Partitioning );
539
534
KeyDesc->Partitioning = std::make_shared<TVector<NKikimr::TKeyDesc::TPartitionInfo>>(entry.PQGroupInfo ->Partitioning );
540
535
541
- CreateSenders (MakePartitionIds (*KeyDesc->Partitioning ), versionChanged );
536
+ CreateSenders (NChangeExchange:: MakePartitionIds (*KeyDesc->Partitioning ));
542
537
Become (&TThis::StateMain);
543
538
}
544
539
0 commit comments