@@ -714,7 +714,6 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
714714 return builder;
715715 }()
716716 << " , Cookie=" << ev->Cookie );
717- UpdateStats (ev->Get ()->Record .GetTxStats ());
718717
719718 TxManager->AddParticipantNode (ev->Sender .NodeId ());
720719
@@ -743,6 +742,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
743742 << " ShardID=" << ev->Get ()->Record .GetOrigin () << " ,"
744743 << " Sink=" << this ->SelfId () << " ."
745744 << getIssues ().ToOneLineString ());
745+ UpdateStats (ev->Get ()->Record .GetTxStats ());
746746 TxManager->SetError (ev->Get ()->Record .GetOrigin ());
747747 RuntimeError (
748748 NYql::NDqProto::StatusIds::UNSPECIFIED,
@@ -766,6 +766,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
766766 << " ShardID=" << ev->Get ()->Record .GetOrigin () << " ,"
767767 << " Sink=" << this ->SelfId () << " ."
768768 << getIssues ().ToOneLineString ());
769+ UpdateStats (ev->Get ()->Record .GetTxStats ());
769770 TxManager->SetError (ev->Get ()->Record .GetOrigin ());
770771 RuntimeError (
771772 NYql::NDqProto::StatusIds::ABORTED,
@@ -785,6 +786,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
785786 ResetShardRetries (ev->Get ()->Record .GetOrigin (), ev->Cookie );
786787 RetryResolve ();
787788 } else {
789+ UpdateStats (ev->Get ()->Record .GetTxStats ());
788790 TxManager->SetError (ev->Get ()->Record .GetOrigin ());
789791 RuntimeError (
790792 NYql::NDqProto::StatusIds::UNAVAILABLE,
@@ -800,6 +802,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
800802 << " ShardID=" << ev->Get ()->Record .GetOrigin () << " ,"
801803 << " Sink=" << this ->SelfId () << " ."
802804 << getIssues ().ToOneLineString ());
805+ UpdateStats (ev->Get ()->Record .GetTxStats ());
803806 TxManager->SetError (ev->Get ()->Record .GetOrigin ());
804807 RuntimeError (
805808 NYql::NDqProto::StatusIds::INTERNAL_ERROR,
@@ -814,6 +817,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
814817 << " ShardID=" << ev->Get ()->Record .GetOrigin () << " ,"
815818 << " Sink=" << this ->SelfId () << " ."
816819 << getIssues ().ToOneLineString ());
820+ UpdateStats (ev->Get ()->Record .GetTxStats ());
817821 TxManager->SetError (ev->Get ()->Record .GetOrigin ());
818822 RuntimeError (
819823 NYql::NDqProto::StatusIds::UNAVAILABLE,
@@ -832,6 +836,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
832836 << getIssues ().ToOneLineString ());
833837 // TODO: support waiting
834838 if (!InconsistentTx) {
839+ UpdateStats (ev->Get ()->Record .GetTxStats ());
835840 TxManager->SetError (ev->Get ()->Record .GetOrigin ());
836841 RuntimeError (
837842 NYql::NDqProto::StatusIds::OVERLOADED,
@@ -851,6 +856,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
851856 << getIssues ().ToOneLineString ());
852857 // TODO: support waiting
853858 if (!InconsistentTx) {
859+ UpdateStats (ev->Get ()->Record .GetTxStats ());
854860 TxManager->SetError (ev->Get ()->Record .GetOrigin ());
855861 RuntimeError (
856862 NYql::NDqProto::StatusIds::OVERLOADED,
@@ -868,6 +874,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
868874 << " ShardID=" << ev->Get ()->Record .GetOrigin () << " ,"
869875 << " Sink=" << this ->SelfId () << " ."
870876 << getIssues ().ToOneLineString ());
877+ UpdateStats (ev->Get ()->Record .GetTxStats ());
871878 TxManager->SetError (ev->Get ()->Record .GetOrigin ());
872879 RuntimeError (
873880 NYql::NDqProto::StatusIds::CANCELLED,
@@ -882,6 +889,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
882889 << " ShardID=" << ev->Get ()->Record .GetOrigin () << " ,"
883890 << " Sink=" << this ->SelfId () << " ."
884891 << getIssues ().ToOneLineString ());
892+ UpdateStats (ev->Get ()->Record .GetTxStats ());
885893 TxManager->SetError (ev->Get ()->Record .GetOrigin ());
886894 RuntimeError (
887895 NYql::NDqProto::StatusIds::BAD_REQUEST,
@@ -901,6 +909,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
901909 ResetShardRetries (ev->Get ()->Record .GetOrigin (), ev->Cookie );
902910 RetryResolve ();
903911 } else {
912+ UpdateStats (ev->Get ()->Record .GetTxStats ());
904913 TxManager->SetError (ev->Get ()->Record .GetOrigin ());
905914 RuntimeError (
906915 NYql::NDqProto::StatusIds::SCHEME_ERROR,
@@ -918,6 +927,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
918927 << " Sink=" << this ->SelfId () << " ."
919928 << getIssues ().ToOneLineString ());
920929
930+ UpdateStats (ev->Get ()->Record .GetTxStats ());
921931 TxManager->BreakLock (ev->Get ()->Record .GetOrigin ());
922932 YQL_ENSURE (TxManager->BrokenLocks ());
923933 TxManager->SetError (ev->Get ()->Record .GetOrigin ());
@@ -934,6 +944,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
934944 << " ShardID=" << ev->Get ()->Record .GetOrigin () << " ,"
935945 << " Sink=" << this ->SelfId () << " ."
936946 << getIssues ().ToOneLineString ());
947+ UpdateStats (ev->Get ()->Record .GetTxStats ());
937948 TxManager->SetError (ev->Get ()->Record .GetOrigin ());
938949 RuntimeError (
939950 NYql::NDqProto::StatusIds::PRECONDITION_FAILED,
@@ -951,6 +962,8 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
951962 const auto & record = ev->Get ()->Record ;
952963 AFL_ENSURE (record.GetTxLocks ().empty ());
953964
965+ UpdateStats (record.GetTxStats ());
966+
954967 IKqpTransactionManager::TPrepareResult preparedInfo;
955968 preparedInfo.ShardId = record.GetOrigin ();
956969 preparedInfo.MinStep = record.GetMinStep ();
@@ -988,6 +1001,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
9881001 if (Mode == EMode::WRITE) {
9891002 for (const auto & lock : ev->Get ()->Record .GetTxLocks ()) {
9901003 if (!TxManager->AddLock (ev->Get ()->Record .GetOrigin (), lock)) {
1004+ UpdateStats (ev->Get ()->Record .GetTxStats ());
9911005 YQL_ENSURE (TxManager->BrokenLocks ());
9921006 NYql::TIssues issues;
9931007 issues.AddIssue (*TxManager->GetLockIssue ());
@@ -1000,6 +1014,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
10001014 }
10011015
10021016 if (Mode == EMode::COMMIT) {
1017+ UpdateStats (ev->Get ()->Record .GetTxStats ());
10031018 Callbacks->OnCommitted (ev->Get ()->Record .GetOrigin (), 0 );
10041019 return ;
10051020 }
@@ -1008,9 +1023,11 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
10081023 const auto result = ShardedWriteController->OnMessageAcknowledged (
10091024 ev->Get ()->Record .GetOrigin (), ev->Cookie );
10101025 if (result && result->IsShardEmpty && Mode == EMode::IMMEDIATE_COMMIT) {
1026+ UpdateStats (ev->Get ()->Record .GetTxStats ());
10111027 Callbacks->OnCommitted (ev->Get ()->Record .GetOrigin (), result->DataSize );
10121028 } else if (result) {
10131029 AFL_ENSURE (Mode == EMode::WRITE);
1030+ UpdateStats (ev->Get ()->Record .GetTxStats ());
10141031 Callbacks->OnMessageAcknowledged (result->DataSize );
10151032 }
10161033 }
0 commit comments