@@ -1125,14 +1125,22 @@ void TReadSessionActor::Handle(TEvPersQueue::TEvLockPartition::TPtr& ev, const T
1125
1125
ctx.Send (actorId, new TEvPQProxy::TEvLockPartition (0 , 0 , false , !ClientsideLocksAllowed));
1126
1126
}
1127
1127
1128
- void TReadSessionActor::Handle (TEvPQProxy::TEvPartitionStatus::TPtr& ev, const TActorContext&) {
1128
+ void TReadSessionActor::Handle (TEvPQProxy::TEvPartitionStatus::TPtr& ev, const TActorContext& ctx ) {
1129
1129
if (!ActualPartitionActor (ev->Sender ))
1130
1130
return ;
1131
1131
1132
1132
auto & evTopic = ev->Get ()->Topic ;
1133
1133
auto it = Partitions.find (std::make_pair (evTopic->GetClientsideName (), ev->Get ()->Partition ));
1134
1134
Y_ABORT_UNLESS (it != Partitions.end ());
1135
- Y_ABORT_UNLESS (it->second .LockGeneration );
1135
+ if (!it->second .LockGeneration ) {
1136
+ LOG_ALERT_S (ctx, NKikimrServices::PQ_READ_PROXY,
1137
+ PQ_LOG_PREFIX << " the unlocked partition " << ev->Get ()->Partition << " status has been requested" );
1138
+ CloseSession (
1139
+ TStringBuilder () << " Internal server error, the unlocked partition " << ev->Get ()->Partition << " status has been requested" ,
1140
+ NPersQueue::NErrorCode::ERROR, ctx
1141
+ );
1142
+ return ;
1143
+ }
1136
1144
1137
1145
if (it->second .Releasing ) // lock request for already released partition - ignore
1138
1146
return ;
@@ -1219,7 +1227,17 @@ void TReadSessionActor::Handle(TEvPersQueue::TEvReleasePartition::TPtr& ev, cons
1219
1227
return ;
1220
1228
}
1221
1229
1222
- Y_ABORT_UNLESS (!Partitions.empty ());
1230
+ auto onUnknownPartition = [&](auto & marker) {
1231
+ LOG_ALERT_S (ctx, NKikimrServices::PQ_READ_PROXY, PQ_LOG_PREFIX << " Releasing unknown partition: " << record.ShortDebugString () << " " << marker);
1232
+ CloseSession (
1233
+ TStringBuilder () << " Internal server error, releasing unknown partition: " << record.ShortDebugString () << " " << marker,
1234
+ NPersQueue::NErrorCode::ERROR, ctx
1235
+ );
1236
+ };
1237
+
1238
+ if (Partitions.empty ()) {
1239
+ return onUnknownPartition (" #PQv0.01" );
1240
+ }
1223
1241
1224
1242
TActorId actorId = TActorId{};
1225
1243
auto jt = Partitions.begin ();
@@ -1233,7 +1251,9 @@ void TReadSessionActor::Handle(TEvPersQueue::TEvReleasePartition::TPtr& ev, cons
1233
1251
}
1234
1252
}
1235
1253
}
1236
- Y_ABORT_UNLESS (actorId);
1254
+ if (!actorId) {
1255
+ return onUnknownPartition (" #PQv0.02" );
1256
+ }
1237
1257
1238
1258
{
1239
1259
auto it = TopicCounters.find (name);
0 commit comments