Skip to content

Commit

Permalink
fix empty receiving shards
Browse files Browse the repository at this point in the history
  • Loading branch information
zverevgeny committed Jan 7, 2025
1 parent d0e1889 commit b27f421
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions ydb/core/tx/columnshard/columnshard__write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class TCommitOperation {
using TPtr = std::shared_ptr<TCommitOperation>;

bool NeedSyncLocks() const {
return SendingShards.size() && ReceivingShards.size();
return SendingShards.size() || ReceivingShards.size();
}

bool IsPrimary() const {
Expand Down Expand Up @@ -355,7 +355,6 @@ class TCommitOperation {

std::unique_ptr<NColumnShard::TEvWriteCommitSyncTransactionOperator> CreateTxOperator(
const NKikimrTxColumnShard::ETransactionKind kind) const {
AFL_VERIFY(ReceivingShards.size());
if (IsPrimary()) {
return std::make_unique<NColumnShard::TEvWriteCommitPrimaryTransactionOperator>(
TFullTxInfo::BuildFake(kind), LockId, ReceivingShards, SendingShards);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b27f421

Please sign in to comment.