From adda2b5e8a4369ce8e7e90e28cd749a8c2ec1561 Mon Sep 17 00:00:00 2001 From: Alexander Kotov Date: Sat, 6 Dec 2025 00:34:36 +0300 Subject: [PATCH 1/2] [-] heap-use-after-free --- ydb/core/persqueue/pqtablet/pq_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/core/persqueue/pqtablet/pq_impl.cpp b/ydb/core/persqueue/pqtablet/pq_impl.cpp index e9f503f17fb2..a87b03b04504 100644 --- a/ydb/core/persqueue/pqtablet/pq_impl.cpp +++ b/ydb/core/persqueue/pqtablet/pq_impl.cpp @@ -5217,6 +5217,7 @@ void TPersQueue::BeginDeletePartitions(const TWriteId& writeId, TTxWriteInfo& wr PQ_LOG_TX_D("Already deleting WriteInfo"); return; } + writeInfo.Deleting = true; if (writeInfo.Partitions.empty()) { TryDeleteWriteId(writeId, writeInfo, ActorContext()); } else { @@ -5227,7 +5228,6 @@ void TPersQueue::BeginDeletePartitions(const TWriteId& writeId, TTxWriteInfo& wr Send(partition.Actor, new TEvPQ::TEvDeletePartition); } } - writeInfo.Deleting = true; } void TPersQueue::BeginDeletePartitions(const TDistributedTransaction& tx) From 78f09a782b22d3794f4ee2dad4d3e79efb877e84 Mon Sep 17 00:00:00 2001 From: Alexander Kotov Date: Sat, 6 Dec 2025 12:20:26 +0300 Subject: [PATCH 2/2] [-] flag TxWritesChanged --- ydb/core/persqueue/pqtablet/pq_impl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ydb/core/persqueue/pqtablet/pq_impl.cpp b/ydb/core/persqueue/pqtablet/pq_impl.cpp index a87b03b04504..3f10d4943609 100644 --- a/ydb/core/persqueue/pqtablet/pq_impl.cpp +++ b/ydb/core/persqueue/pqtablet/pq_impl.cpp @@ -5220,6 +5220,7 @@ void TPersQueue::BeginDeletePartitions(const TWriteId& writeId, TTxWriteInfo& wr writeInfo.Deleting = true; if (writeInfo.Partitions.empty()) { TryDeleteWriteId(writeId, writeInfo, ActorContext()); + TxWritesChanged = true; } else { for (auto& [_, partitionId] : writeInfo.Partitions) { PQ_ENSURE(Partitions.contains(partitionId));