@@ -315,18 +315,20 @@ class TCommitOperation {
315315 LockId = lock.GetLockId ();
316316 SendingShards = std::set<ui64>(locks.GetSendingShards ().begin (), locks.GetSendingShards ().end ());
317317 ReceivingShards = std::set<ui64>(locks.GetReceivingShards ().begin (), locks.GetReceivingShards ().end ());
318- const bool singleShardTx = SendingShards.empty () && ReceivingShards.empty ();
319- if (!singleShardTx) {
318+ if (SendingShards.empty () != ReceivingShards.empty ()) {
319+ return TConclusionStatus::Fail (" incorrect synchronization data (send/receiving lists)" );
320+ }
321+ if (ReceivingShards.size () && SendingShards.size ()) {
320322 if (!ReceivingShards.contains (TabletId) && !SendingShards.contains (TabletId)) {
321- return TConclusionStatus::Fail (" shard is absent in sending and receiving lists" );
323+ return TConclusionStatus::Fail (" current tablet_id is absent in sending and receiving lists" );
322324 }
323- if (locks.HasArbiterColumnShard ()) {
324- ArbiterColumnShard = locks.GetArbiterColumnShard ();
325- } else {
326- AFL_VERIFY (!ReceivingShards.empty ());
327- ArbiterColumnShard = *ReceivingShards.begin ();
325+ if (!locks.HasArbiterColumnShard ()) {
326+ return TConclusionStatus::Fail (" no arbiter info in request" );
327+ }
328+ ArbiterColumnShard = locks.GetArbiterColumnShard ();
329+ if (!ReceivingShards.contains (ArbiterColumnShard)) {
330+ return TConclusionStatus::Fail (" arbiter is absent in receiving lists: " + ::ToString (ArbiterColumnShard) + " in [" + JoinSeq (" , " , ReceivingShards) + " ]" );
328331 }
329- AFL_VERIFY (ArbiterColumnShard);
330332 }
331333
332334 Generation = lock.GetGeneration ();
0 commit comments