summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlek5andr-Kotov <[email protected]>2024-02-29 10:23:26 +0300
committerGitHub <[email protected]>2024-02-29 10:23:26 +0300
commit652ecefcb71424d2a7f2514f4748f7fdae89a201 (patch)
tree3048ac729131ba407f1689a26915819e78c2b3ef
parentc54e54dd210eb62a8a30ab3dc264aa0ea0474a1b (diff)
config for the service partition (#1807)
-rw-r--r--ydb/core/persqueue/partition.cpp5
-rw-r--r--ydb/core/persqueue/partition.h2
-rw-r--r--ydb/core/persqueue/pq_impl.cpp17
-rw-r--r--ydb/core/persqueue/pq_impl.h1
4 files changed, 24 insertions, 1 deletions
diff --git a/ydb/core/persqueue/partition.cpp b/ydb/core/persqueue/partition.cpp
index 1162ff585eb..d8c03bc4f82 100644
--- a/ydb/core/persqueue/partition.cpp
+++ b/ydb/core/persqueue/partition.cpp
@@ -2661,4 +2661,9 @@ const NKikimrPQ::TPQTabletConfig::TPartition* TPartition::GetPartitionConfig(con
return NPQ::GetPartitionConfig(config, Partition.OriginalPartitionId);
}
+bool TPartition::IsSupportive() const
+{
+ return Partition.IsSupportivePartition();
+}
+
} // namespace NKikimr::NPQ
diff --git a/ydb/core/persqueue/partition.h b/ydb/core/persqueue/partition.h
index cb8f2ea872d..40d1f8e28b4 100644
--- a/ydb/core/persqueue/partition.h
+++ b/ydb/core/persqueue/partition.h
@@ -779,6 +779,8 @@ private:
const NKikimrPQ::TPQTabletConfig::TPartition* GetPartitionConfig(const NKikimrPQ::TPQTabletConfig& config);
bool ClosedInternalPartition = false;
+
+ bool IsSupportive() const;
};
} // namespace NKikimr::NPQ
diff --git a/ydb/core/persqueue/pq_impl.cpp b/ydb/core/persqueue/pq_impl.cpp
index 9e989af4cb8..f026d3b3653 100644
--- a/ydb/core/persqueue/pq_impl.cpp
+++ b/ydb/core/persqueue/pq_impl.cpp
@@ -928,6 +928,21 @@ void TPersQueue::AddSupportivePartition(const TPartitionId& partitionId)
NewSupportivePartitions.insert(partitionId);
}
+NKikimrPQ::TPQTabletConfig TPersQueue::MakeSupportivePartitionConfig() const
+{
+ NKikimrPQ::TPQTabletConfig partitionConfig = Config;
+
+ partitionConfig.MutableReadRules()->Clear();
+ partitionConfig.MutableReadFromTimestampsMs()->Clear();
+ partitionConfig.MutableConsumerFormatVersions()->Clear();
+ partitionConfig.MutableConsumerCodecs()->Clear();
+ partitionConfig.MutableReadRuleServiceTypes()->Clear();
+ partitionConfig.MutableReadRuleVersions()->Clear();
+ partitionConfig.MutableReadRuleGenerations()->Clear();
+
+ return partitionConfig;
+}
+
void TPersQueue::CreateSupportivePartitionActor(const TPartitionId& partitionId,
const TActorContext& ctx)
{
@@ -936,7 +951,7 @@ void TPersQueue::CreateSupportivePartitionActor(const TPartitionId& partitionId,
TPartitionInfo& partition = Partitions.at(partitionId);
partition.Actor = ctx.Register(CreatePartitionActor(partitionId,
TopicConverter,
- Config,
+ MakeSupportivePartitionConfig(),
true,
ctx));
}
diff --git a/ydb/core/persqueue/pq_impl.h b/ydb/core/persqueue/pq_impl.h
index f8b786f28c6..7aba9376c58 100644
--- a/ydb/core/persqueue/pq_impl.h
+++ b/ydb/core/persqueue/pq_impl.h
@@ -473,6 +473,7 @@ private:
void AddSupportivePartition(const TPartitionId& shadowPartitionId);
void CreateSupportivePartitionActors(const TActorContext& ctx);
void CreateSupportivePartitionActor(const TPartitionId& shadowPartitionId, const TActorContext& ctx);
+ NKikimrPQ::TPQTabletConfig MakeSupportivePartitionConfig() const;
void SubscribeWriteId(ui64 writeId, const TActorContext& ctx);
bool AllOriginalPartitionsInited() const;