@@ -552,6 +552,54 @@ class TDone: public TSubOperationState {
552
552
553
553
namespace NPQState {
554
554
555
+ class TBootstrapConfigWrapper: public NKikimrPQ::TBootstrapConfig {
556
+ struct TSerializedProposeTransaction {
557
+ TString Value;
558
+
559
+ static TSerializedProposeTransaction Serialize(const NKikimrPQ::TBootstrapConfig& value) {
560
+ NKikimrPQ::TEvProposeTransaction record;
561
+ record.MutableConfig()->MutableBootstrapConfig()->CopyFrom(value);
562
+ return {record.SerializeAsString()};
563
+ }
564
+ };
565
+
566
+ struct TSerializedUpdateConfig {
567
+ TString Value;
568
+
569
+ static TSerializedUpdateConfig Serialize(const NKikimrPQ::TBootstrapConfig& value) {
570
+ NKikimrPQ::TUpdateConfig record;
571
+ record.MutableBootstrapConfig()->CopyFrom(value);
572
+ return {record.SerializeAsString()};
573
+ }
574
+ };
575
+
576
+ mutable std::optional<std::variant<
577
+ TSerializedProposeTransaction,
578
+ TSerializedUpdateConfig
579
+ >> PreSerialized;
580
+
581
+ template <typename T>
582
+ const TString& Get() const {
583
+ if (!PreSerialized) {
584
+ PreSerialized.emplace(T::Serialize(*this));
585
+ }
586
+
587
+ const auto* value = std::get_if<T>(&PreSerialized.value());
588
+ Y_ABORT_UNLESS(value);
589
+
590
+ return value->Value;
591
+ }
592
+
593
+ public:
594
+ const TString& GetPreSerializedProposeTransaction() const {
595
+ return Get<TSerializedProposeTransaction>();
596
+ }
597
+
598
+ const TString& GetPreSerializedUpdateConfig() const {
599
+ return Get<TSerializedUpdateConfig>();
600
+ }
601
+ };
602
+
555
603
class TConfigureParts: public TSubOperationState {
556
604
private:
557
605
TOperationId OperationId;
@@ -627,7 +675,6 @@ class TConfigureParts: public TSubOperationState {
627
675
return false;
628
676
}
629
677
630
-
631
678
bool ProgressState(TOperationContext& context) override {
632
679
TTabletId ssId = context.SS->SelfTabletId();
633
680
@@ -669,7 +716,7 @@ class TConfigureParts: public TSubOperationState {
669
716
TString databasePath = TPath::Init(context.SS->RootPathId(), context.SS).PathString();
670
717
auto topicPath = TPath::Init(txState->TargetPathId, context.SS);
671
718
672
- std::optional<NKikimrPQ::TBootstrapConfig > bootstrapConfig;
719
+ std::optional<TBootstrapConfigWrapper > bootstrapConfig;
673
720
if (txState->TxType == TTxState::TxCreatePQGroup && topicPath.Parent().IsCdcStream()) {
674
721
bootstrapConfig.emplace();
675
722
@@ -918,7 +965,7 @@ class TConfigureParts: public TSubOperationState {
918
965
const TTopicTabletInfo& pqShard,
919
966
const TString& topicName,
920
967
const TString& topicPath,
921
- const std::optional<NKikimrPQ::TBootstrapConfig >& bootstrapConfig,
968
+ const std::optional<TBootstrapConfigWrapper >& bootstrapConfig,
922
969
const TString& cloudId,
923
970
const TString& folderId,
924
971
const TString& databaseId,
@@ -931,7 +978,7 @@ class TConfigureParts: public TSubOperationState {
931
978
const TTopicTabletInfo& pqShard,
932
979
const TString& topicName,
933
980
const TString& topicPath,
934
- const std::optional<NKikimrPQ::TBootstrapConfig >& bootstrapConfig,
981
+ const std::optional<TBootstrapConfigWrapper >& bootstrapConfig,
935
982
const TString& cloudId,
936
983
const TString& folderId,
937
984
const TString& databaseId,
0 commit comments