@@ -535,25 +535,38 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
535
535
getIssues ());
536
536
return ;
537
537
}
538
- case NKikimrDataEvents::TEvWriteResult::STATUS_INTERNAL_ERROR: {
539
- CA_LOG_E (" Got INTERNAL ERROR for table `"
538
+ case NKikimrDataEvents::TEvWriteResult::STATUS_WRONG_SHARD_STATE:
539
+ CA_LOG_E (" Got WRONG SHARD STATE for table `"
540
540
<< SchemeEntry->TableId .PathId .ToString () << " `."
541
541
<< " ShardID=" << ev->Get ()->Record .GetOrigin () << " ,"
542
542
<< " Sink=" << this ->SelfId () << " ."
543
543
<< getIssues ().ToOneLineString ());
544
- // TODO: Add new status for splits in datashard. This is tmp solution.
545
- if (getIssues (). ToOneLineString (). Contains ( " in a pre/offline state assuming this is due to a finished split (wrong shard state) " ) ) {
544
+
545
+ if (InconsistentTx ) {
546
546
ResetShardRetries (ev->Get ()->Record .GetOrigin (), ev->Cookie );
547
547
RetryResolveTable ();
548
548
} else {
549
549
RuntimeError (
550
- TStringBuilder () << " Internal error for table `"
550
+ TStringBuilder () << " Wrong shard state for table `"
551
551
<< TablePath << " `. "
552
552
<< getIssues ().ToOneLineString (),
553
- NYql::NDqProto::StatusIds::INTERNAL_ERROR ,
553
+ NYql::NDqProto::StatusIds::PRECONDITION_FAILED ,
554
554
getIssues ());
555
555
}
556
556
return ;
557
+ case NKikimrDataEvents::TEvWriteResult::STATUS_INTERNAL_ERROR: {
558
+ CA_LOG_E (" Got INTERNAL ERROR for table `"
559
+ << SchemeEntry->TableId .PathId .ToString () << " `."
560
+ << " ShardID=" << ev->Get ()->Record .GetOrigin () << " ,"
561
+ << " Sink=" << this ->SelfId () << " ."
562
+ << getIssues ().ToOneLineString ());
563
+ RuntimeError (
564
+ TStringBuilder () << " Internal error for table `"
565
+ << TablePath << " `. "
566
+ << getIssues ().ToOneLineString (),
567
+ NYql::NDqProto::StatusIds::INTERNAL_ERROR,
568
+ getIssues ());
569
+ return ;
557
570
}
558
571
case NKikimrDataEvents::TEvWriteResult::STATUS_DISK_SPACE_EXHAUSTED: {
559
572
CA_LOG_E (" Got DISK_SPACE_EXHAUSTED for table `"
@@ -1798,6 +1811,18 @@ class TKqpBufferWriteActor :public TActorBootstrapped<TKqpBufferWriteActor>, pub
1798
1811
getIssues ());
1799
1812
return ;
1800
1813
}
1814
+ case NKikimrDataEvents::TEvWriteResult::STATUS_WRONG_SHARD_STATE: {
1815
+ CA_LOG_E (" Got WRONG SHARD STATE for table."
1816
+ << " ShardID=" << ev->Get ()->Record .GetOrigin () << " ,"
1817
+ << " Sink=" << this ->SelfId () << " ."
1818
+ << getIssues ().ToOneLineString ());
1819
+ ReplyErrorAndDie (
1820
+ TStringBuilder () << " Wrong shard state for table. "
1821
+ << getIssues ().ToOneLineString (),
1822
+ NYql::NDqProto::StatusIds::INTERNAL_ERROR,
1823
+ getIssues ());
1824
+ return ;
1825
+ }
1801
1826
case NKikimrDataEvents::TEvWriteResult::STATUS_INTERNAL_ERROR: {
1802
1827
CA_LOG_E (" Got INTERNAL ERROR for table."
1803
1828
<< " ShardID=" << ev->Get ()->Record .GetOrigin () << " ,"
0 commit comments