From b27f421fd839c8d0337531ace89ed98c9c682784 Mon Sep 17 00:00:00 2001 From: Evgeny Zverev Date: Tue, 7 Jan 2025 07:58:32 +0000 Subject: [PATCH] fix empty receiving shards --- ydb/core/tx/columnshard/columnshard__write.cpp | 3 +-- .../tx/columnshard/transactions/operators/ev_write/primary.h | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ydb/core/tx/columnshard/columnshard__write.cpp b/ydb/core/tx/columnshard/columnshard__write.cpp index 4e3e565952fb..bea7766dc3c8 100644 --- a/ydb/core/tx/columnshard/columnshard__write.cpp +++ b/ydb/core/tx/columnshard/columnshard__write.cpp @@ -304,7 +304,7 @@ class TCommitOperation { using TPtr = std::shared_ptr; bool NeedSyncLocks() const { - return SendingShards.size() && ReceivingShards.size(); + return SendingShards.size() || ReceivingShards.size(); } bool IsPrimary() const { @@ -355,7 +355,6 @@ class TCommitOperation { std::unique_ptr CreateTxOperator( const NKikimrTxColumnShard::ETransactionKind kind) const { - AFL_VERIFY(ReceivingShards.size()); if (IsPrimary()) { return std::make_unique( TFullTxInfo::BuildFake(kind), LockId, ReceivingShards, SendingShards); diff --git a/ydb/core/tx/columnshard/transactions/operators/ev_write/primary.h b/ydb/core/tx/columnshard/transactions/operators/ev_write/primary.h index 0a8137fd9d31..8fc19f3c8587 100644 --- a/ydb/core/tx/columnshard/transactions/operators/ev_write/primary.h +++ b/ydb/core/tx/columnshard/transactions/operators/ev_write/primary.h @@ -63,7 +63,6 @@ class TEvWriteCommitPrimaryTransactionOperator: public TEvWriteCommitSyncTransac for (auto&& i : protoData.GetWaitShardsResultAck()) { WaitShardsResultAck.emplace(i); } - AFL_VERIFY(ReceivingShards.empty() == SendingShards.empty()); if (protoData.HasTxBroken()) { TxBroken = protoData.GetTxBroken(); } @@ -160,8 +159,7 @@ class TEvWriteCommitPrimaryTransactionOperator: public TEvWriteCommitSyncTransac }; virtual bool IsTxBroken() const override { - AFL_VERIFY(TxBroken); - return *TxBroken; + return TxBroken.value_or(false); } void InitializeRequests(TColumnShard& owner) {