@@ -177,7 +177,7 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
177
177
Signature[cookie] = Max<ui64>();
178
178
++RepliesMerged;
179
179
180
- ReplicaSelection->MergeReply (TStateStorageInfo::TSelection::StatusNoInfo , &ReplyStatus, cookie, false );
180
+ ReplicaSelection->MergeReply (TStateStorageInfo::TSelection::StatusUnavailable , &ReplyStatus, cookie, false );
181
181
}
182
182
}
183
183
@@ -192,7 +192,8 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
192
192
++RepliesMerged;
193
193
++SignaturesMerged;
194
194
195
- if (status == NKikimrProto::OK) {
195
+ switch (status) {
196
+ case NKikimrProto::OK: {
196
197
const ui32 gen = record.GetCurrentGeneration ();
197
198
const ui32 step = record.GetCurrentStep ();
198
199
const TActorId leader = ActorIdFromProto (record.GetCurrentLeader ());
@@ -221,9 +222,14 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
221
222
222
223
ReplicaSelection->MergeReply (TStateStorageInfo::TSelection::StatusOk, &ReplyStatus, cookie, reset);
223
224
}
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:
225
230
ReplicaSelection->MergeReply (TStateStorageInfo::TSelection::StatusNoInfo, &ReplyStatus, cookie, false );
226
- } else {
231
+ break ;
232
+ default :
227
233
Y_ABORT ();
228
234
}
229
235
@@ -307,11 +313,14 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
307
313
ReplyAndDie (NKikimrProto::OK);
308
314
return ;
309
315
case TStateStorageInfo::TSelection::StatusNoInfo:
310
- ReplyAndDie (NKikimrProto::ERROR );
316
+ ReplyAndDie (NKikimrProto::NODATA );
311
317
return ;
312
318
case TStateStorageInfo::TSelection::StatusOutdated:
313
319
ReplyAndDie (NKikimrProto::RACE);
314
320
return ;
321
+ case TStateStorageInfo::TSelection::StatusUnavailable:
322
+ ReplyAndDie (NKikimrProto::ERROR);
323
+ return ;
315
324
}
316
325
Y_DEBUG_ABORT_UNLESS (false );
317
326
PassAway ();
@@ -332,12 +341,15 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
332
341
return ;
333
342
case TStateStorageInfo::TSelection::StatusNoInfo:
334
343
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 );
336
345
}
337
346
return ;
338
347
case TStateStorageInfo::TSelection::StatusOutdated:
339
348
ReplyAndSig (NKikimrProto::RACE);
340
349
return ;
350
+ case TStateStorageInfo::TSelection::StatusUnavailable:
351
+ ReplyAndSig (NKikimrProto::ERROR);
352
+ return ;
341
353
}
342
354
}
343
355
}
@@ -379,6 +391,8 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
379
391
}
380
392
return ;
381
393
case TStateStorageInfo::TSelection::StatusNoInfo:
394
+ case TStateStorageInfo::TSelection::StatusUnavailable:
395
+ // Note: StatusNoInfo shouldn't really happen for update queries
382
396
ReplyAndDie (NKikimrProto::ERROR);
383
397
return ;
384
398
case TStateStorageInfo::TSelection::StatusOutdated:
@@ -404,7 +418,8 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
404
418
}
405
419
return ;
406
420
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
408
423
ReplyAndSig (NKikimrProto::ERROR);
409
424
return ;
410
425
case TStateStorageInfo::TSelection::StatusOutdated:
0 commit comments