@@ -177,7 +177,7 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
177177 Signature[cookie] = Max<ui64>();
178178 ++RepliesMerged;
179179
180- ReplicaSelection->MergeReply (TStateStorageInfo::TSelection::StatusNoInfo , &ReplyStatus, cookie, false );
180+ ReplicaSelection->MergeReply (TStateStorageInfo::TSelection::StatusUnavailable , &ReplyStatus, cookie, false );
181181 }
182182 }
183183
@@ -192,7 +192,8 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
192192 ++RepliesMerged;
193193 ++SignaturesMerged;
194194
195- if (status == NKikimrProto::OK) {
195+ switch (status) {
196+ case NKikimrProto::OK: {
196197 const ui32 gen = record.GetCurrentGeneration ();
197198 const ui32 step = record.GetCurrentStep ();
198199 const TActorId leader = ActorIdFromProto (record.GetCurrentLeader ());
@@ -221,9 +222,14 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
221222
222223 ReplicaSelection->MergeReply (TStateStorageInfo::TSelection::StatusOk, &ReplyStatus, cookie, reset);
223224 }
224- } else if (status == NKikimrProto::ERROR) {
225+ break ;
226+ }
227+ // NOTE: replicas currently reply with ERROR when there is no data for the tablet
228+ case NKikimrProto::ERROR:
229+ case NKikimrProto::NODATA:
225230 ReplicaSelection->MergeReply (TStateStorageInfo::TSelection::StatusNoInfo, &ReplyStatus, cookie, false );
226- } else {
231+ break ;
232+ default :
227233 Y_ABORT ();
228234 }
229235
@@ -307,11 +313,14 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
307313 ReplyAndDie (NKikimrProto::OK);
308314 return ;
309315 case TStateStorageInfo::TSelection::StatusNoInfo:
310- ReplyAndDie (NKikimrProto::ERROR );
316+ ReplyAndDie (NKikimrProto::NODATA );
311317 return ;
312318 case TStateStorageInfo::TSelection::StatusOutdated:
313319 ReplyAndDie (NKikimrProto::RACE);
314320 return ;
321+ case TStateStorageInfo::TSelection::StatusUnavailable:
322+ ReplyAndDie (NKikimrProto::ERROR);
323+ return ;
315324 }
316325 Y_DEBUG_ABORT_UNLESS (false );
317326 PassAway ();
@@ -332,12 +341,15 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
332341 return ;
333342 case TStateStorageInfo::TSelection::StatusNoInfo:
334343 if (RepliesMerged == Replicas) { // for negative response always waits for full reply set to avoid herding of good replicas by fast retry cycle
335- ReplyAndSig (NKikimrProto::ERROR );
344+ ReplyAndSig (NKikimrProto::NODATA );
336345 }
337346 return ;
338347 case TStateStorageInfo::TSelection::StatusOutdated:
339348 ReplyAndSig (NKikimrProto::RACE);
340349 return ;
350+ case TStateStorageInfo::TSelection::StatusUnavailable:
351+ ReplyAndSig (NKikimrProto::ERROR);
352+ return ;
341353 }
342354 }
343355 }
@@ -379,6 +391,8 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
379391 }
380392 return ;
381393 case TStateStorageInfo::TSelection::StatusNoInfo:
394+ case TStateStorageInfo::TSelection::StatusUnavailable:
395+ // Note: StatusNoInfo shouldn't really happen for update queries
382396 ReplyAndDie (NKikimrProto::ERROR);
383397 return ;
384398 case TStateStorageInfo::TSelection::StatusOutdated:
@@ -404,7 +418,8 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
404418 }
405419 return ;
406420 case TStateStorageInfo::TSelection::StatusNoInfo:
407- // should not happens for update queries
421+ case TStateStorageInfo::TSelection::StatusUnavailable:
422+ // Note: StatusNoInfo shouldn't really happen for update queries
408423 ReplyAndSig (NKikimrProto::ERROR);
409424 return ;
410425 case TStateStorageInfo::TSelection::StatusOutdated:
0 commit comments