@@ -208,13 +208,6 @@ class TKqpDataExecuter : public TKqpExecuterBase<TKqpDataExecuter, EExecType::Da
208208 void Finalize () {
209209 YQL_ENSURE (!AlreadyReplied);
210210
211- if (LocksBroken) {
212- TString message = " Transaction locks invalidated." ;
213-
214- return ReplyErrorAndDie (Ydb::StatusIds::ABORTED,
215- YqlIssue ({}, TIssuesIds::KIKIMR_LOCKS_INVALIDATED, message));
216- }
217-
218211 ResponseEv->Record .MutableResponse ()->SetStatus (Ydb::StatusIds::SUCCESS);
219212 Counters->TxProxyMon ->ReportStatusOK ->Inc ();
220213
@@ -1167,30 +1160,12 @@ class TKqpDataExecuter : public TKqpExecuterBase<TKqpDataExecuter, EExecType::Da
11671160 YQL_ENSURE (shardState->State == TShardState::EState::Executing);
11681161 shardState->State = TShardState::EState::Finished;
11691162 Counters->TxProxyMon ->TxResultAborted ->Inc ();
1170- LocksBroken = true ;
11711163
1172- TMaybe<TString> tableName;
11731164 if (!res->Record .GetTxLocks ().empty ()) {
1174- auto & lock = res->Record .GetTxLocks (0 );
1175- auto tableId = TTableId (lock.GetSchemeShard (), lock.GetPathId ());
1176- auto it = FindIf (TasksGraph.GetStagesInfo (), [tableId](const auto & x){ return x.second .Meta .TableId .HasSamePath (tableId); });
1177- if (it != TasksGraph.GetStagesInfo ().end ()) {
1178- tableName = it->second .Meta .TableConstInfo ->Path ;
1179- }
1165+ ResponseEv->BrokenLockPathId = res->Record .GetTxLocks (0 ).GetPathId ();
11801166 }
11811167
1182- // Reply as soon as we know which table had locks invalidated
1183- if (tableName) {
1184- auto message = TStringBuilder ()
1185- << " Transaction locks invalidated. Table: " << *tableName;
1186-
1187- return ReplyErrorAndDie (Ydb::StatusIds::ABORTED,
1188- YqlIssue ({}, TIssuesIds::KIKIMR_LOCKS_INVALIDATED, message));
1189- }
1190-
1191-
1192- CheckExecutionComplete ();
1193- return ;
1168+ return ReplyErrorAndDie (Ydb::StatusIds::ABORTED, {});
11941169 }
11951170 default :
11961171 {
@@ -1245,30 +1220,11 @@ class TKqpDataExecuter : public TKqpExecuterBase<TKqpDataExecuter, EExecType::Da
12451220
12461221 Counters->TxProxyMon ->TxResultAborted ->Inc (); // TODO: dedicated counter?
12471222
1248- LocksBroken = true ;
1249-
1250- TMaybe<TString> tableName;
12511223 if (!res->Record .GetTxLocks ().empty ()) {
1252- auto & lock = res->Record .GetTxLocks (0 );
1253- auto tableId = TTableId (lock.GetSchemeShard (), lock.GetPathId ());
1254- auto it = FindIf (TasksGraph.GetStagesInfo (), [tableId](const auto & x){ return x.second .Meta .TableId .HasSamePath (tableId); });
1255- if (it != TasksGraph.GetStagesInfo ().end ()) {
1256- tableName = it->second .Meta .TableConstInfo ->Path ;
1257- }
1258- }
1259-
1260- // Reply as soon as we know which table had locks invalidated
1261- if (tableName) {
1262- auto message = TStringBuilder ()
1263- << " Transaction locks invalidated. Table: " << *tableName;
1264-
1265- return ReplyErrorAndDie (Ydb::StatusIds::ABORTED,
1266- YqlIssue ({}, TIssuesIds::KIKIMR_LOCKS_INVALIDATED, message));
1224+ ResponseEv->BrokenLockPathId = res->Record .GetTxLocks (0 ).GetPathId ();
12671225 }
12681226
1269- // Receive more replies from other shards
1270- CheckExecutionComplete ();
1271- return ;
1227+ return ReplyErrorAndDie (Ydb::StatusIds::ABORTED, {});
12721228 }
12731229 case NKikimrTxDataShard::TEvProposeTransactionResult::PREPARED: {
12741230 YQL_ENSURE (false );
@@ -2806,7 +2762,6 @@ class TKqpDataExecuter : public TKqpExecuterBase<TKqpDataExecuter, EExecType::Da
28062762 bool VolatileTx = false ;
28072763 bool ImmediateTx = false ;
28082764 bool TxPlanned = false ;
2809- bool LocksBroken = false ;
28102765
28112766 TInstant FirstPrepareReply;
28122767 TInstant LastPrepareReply;
0 commit comments