Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict writing data validation #13190

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions ydb/core/tx/columnshard/columnshard__write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,17 @@ class TCommitOperation {
LockId = lock.GetLockId();
SendingShards = std::set<ui64>(locks.GetSendingShards().begin(), locks.GetSendingShards().end());
ReceivingShards = std::set<ui64>(locks.GetReceivingShards().begin(), locks.GetReceivingShards().end());
const bool singleShardTx = SendingShards.empty() && ReceivingShards.empty();
if (!singleShardTx) {
if (SendingShards.empty() != ReceivingShards.empty()) {
return TConclusionStatus::Fail("incorrect synchronization data (send/receiving lists)");
}
if (ReceivingShards.size() && SendingShards.size()) {
if (!ReceivingShards.contains(TabletId) && !SendingShards.contains(TabletId)) {
return TConclusionStatus::Fail("shard is absent in sending and receiving lists");
return TConclusionStatus::Fail("shard is incorrect for sending/receiving lists");
}
if (locks.HasArbiterColumnShard()) {
ArbiterColumnShard = locks.GetArbiterColumnShard();
} else {
AFL_VERIFY(!ReceivingShards.empty());
if (!locks.HasArbiterColumnShard()) {
ArbiterColumnShard = *ReceivingShards.begin();
} else {
ArbiterColumnShard = locks.GetArbiterColumnShard();
}
AFL_VERIFY(ArbiterColumnShard);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ class TEvWriteCommitPrimaryTransactionOperator: public TEvWriteCommitSyncTransac
};

virtual bool IsTxBroken() const override {
return TxBroken.value_or(false);
AFL_VERIFY(TxBroken);
return *TxBroken;
}

void InitializeRequests(TColumnShard& owner) {
Expand Down
Loading