@@ -113,6 +113,10 @@ class TRangeGet : public TActorBootstrapped<TRangeGet> {
113
113
LOG_NOTICE (ctx, NActorsServices::TEST,
114
114
" RANGE READ: from=%s to=%s\n " , ReadFrom.ToString ().data (), ReadTo.ToString ().data ());
115
115
116
+ SendRequest ();
117
+ }
118
+
119
+ void SendRequest () {
116
120
auto req = TEvBlobStorage::TEvVGet::CreateRangeIndexQuery (VDiskInfo.VDiskID ,
117
121
TInstant::Max (),
118
122
NKikimrBlobStorage::EGetHandleClass::FastRead,
@@ -122,7 +126,7 @@ class TRangeGet : public TActorBootstrapped<TRangeGet> {
122
126
ReadTo,
123
127
MaxResults);
124
128
125
- ctx. Send (VDiskInfo.ActorID , req.release ());
129
+ Send (VDiskInfo.ActorID , req.release (), IEventHandle::FlagTrackDelivery );
126
130
}
127
131
128
132
void CheckOrder (const NKikimrBlobStorage::TEvVGetResult &rec,
@@ -163,6 +167,7 @@ class TRangeGet : public TActorBootstrapped<TRangeGet> {
163
167
STRICT_STFUNC (StateFunc,
164
168
HFunc (TEvBlobStorage::TEvVGetResult, Handle);
165
169
IgnoreFunc (TEvBlobStorage::TEvVWindowChange);
170
+ cFunc (TEvents::TEvUndelivered::EventType, SendRequest);
166
171
)
167
172
168
173
public:
@@ -581,14 +586,18 @@ class TManyGets : public TActorBootstrapped<TManyGets> {
581
586
// get logo blob
582
587
if (Step % 100 == 0 )
583
588
LOG_NOTICE (ctx, NActorsServices::TEST, " GET Step=%u" , Step);
589
+ SendRequest ();
590
+ }
591
+
592
+ void SendRequest () {
584
593
TLogoBlobID logoBlobID (TabletId, Gen, Step, Channel, MsgData.size (), 0 , 1 );
585
594
auto req = TEvBlobStorage::TEvVGet::CreateExtremeDataQuery (VDiskInfo.VDiskID ,
586
595
TInstant::Max (),
587
596
NKikimrBlobStorage::EGetHandleClass::AsyncRead,
588
597
TEvBlobStorage::TEvVGet::EFlags::None,
589
598
{},
590
599
{logoBlobID});
591
- ctx. Send (VDiskInfo.ActorID , req.release ());
600
+ Send (VDiskInfo.ActorID , req.release (), IEventHandle::FlagTrackDelivery );
592
601
}
593
602
594
603
void Check (const TActorContext &ctx, const NKikimrBlobStorage::TEvVGetResult &rec, const TEvBlobStorage::TEvVGetResult& ev) {
@@ -626,6 +635,7 @@ class TManyGets : public TActorBootstrapped<TManyGets> {
626
635
STRICT_STFUNC (StateReadFunc,
627
636
HFunc (TEvBlobStorage::TEvVGetResult, Handle);
628
637
IgnoreFunc (TEvBlobStorage::TEvVWindowChange);
638
+ cFunc (TEvents::TEvUndelivered::EventType, SendRequest);
629
639
)
630
640
631
641
public:
@@ -816,12 +826,9 @@ class TPutGC : public TActorBootstrapped<TPutGC> {
816
826
817
827
friend class TActorBootstrapped <TPutGC>;
818
828
819
- void Bootstrap (const TActorContext &ctx ) {
829
+ void Bootstrap (const TActorContext& ) {
820
830
TThis::Become (&TThis::StateFunc);
821
- ctx.Send (VDiskInfo.ActorID ,
822
- new TEvBlobStorage::TEvVCollectGarbage (TabletID, RecGen, RecGenCounter, Channel, Collect, CollectGen,
823
- CollectStep, false , Keep.Get (), DoNotKeep.Get (), VDiskInfo.VDiskID ,
824
- TInstant::Max ()));
831
+ SendRequest ();
825
832
}
826
833
827
834
void Handle (TEvBlobStorage::TEvVCollectGarbageResult::TPtr &ev, const TActorContext &ctx) {
@@ -831,9 +838,18 @@ class TPutGC : public TActorBootstrapped<TPutGC> {
831
838
TThis::Die (ctx);
832
839
}
833
840
841
+ void SendRequest () {
842
+ Send (VDiskInfo.ActorID ,
843
+ new TEvBlobStorage::TEvVCollectGarbage (TabletID, RecGen, RecGenCounter, Channel, Collect, CollectGen,
844
+ CollectStep, false , Keep.Get (), DoNotKeep.Get (), VDiskInfo.VDiskID ,
845
+ TInstant::Max ()),
846
+ IEventHandle::FlagTrackDelivery);
847
+ }
848
+
834
849
STRICT_STFUNC (StateFunc,
835
850
HFunc (TEvBlobStorage::TEvVCollectGarbageResult, Handle);
836
851
IgnoreFunc (TEvBlobStorage::TEvVWindowChange);
852
+ cFunc (TEvents::TEvUndelivered::EventType, SendRequest);
837
853
)
838
854
839
855
public:
@@ -872,23 +888,30 @@ class TWaitForCompactionOneDisk : public TActorBootstrapped<TWaitForCompactionOn
872
888
873
889
friend class TActorBootstrapped <TWaitForCompactionOneDisk>;
874
890
875
- void Bootstrap (const TActorContext &ctx ) {
891
+ void Bootstrap (const TActorContext& ) {
876
892
Become (&TThis::StateSchedule);
877
- ctx.Send (VDiskInfo.ActorID ,
878
- new TEvBlobStorage::TEvVCompact (VDiskInfo.VDiskID , NKikimrBlobStorage::TEvVCompact::ASYNC));
893
+ SendVCompact ();
879
894
}
880
895
881
- void Handle (TEvBlobStorage::TEvVCompactResult::TPtr &ev, const TActorContext &ctx ) {
896
+ void Handle (TEvBlobStorage::TEvVCompactResult::TPtr &ev) {
882
897
if (ev->Get ()->Record .GetStatus () == NKikimrProto::OK) {
883
898
Become (&TThis::StateWait);
884
- ctx. Send (VDiskInfo. ActorID , new TEvBlobStorage::TEvVStatus (VDiskInfo. VDiskID ) );
899
+ SendVStatus ( );
885
900
} else {
886
- ctx.Send (VDiskInfo.ActorID ,
887
- new TEvBlobStorage::TEvVCompact (VDiskInfo.VDiskID , NKikimrBlobStorage::TEvVCompact::ASYNC));
901
+ SendVCompact ();
888
902
}
889
903
}
890
904
891
- void Handle (TEvBlobStorage::TEvVStatusResult::TPtr &ev, const TActorContext &ctx) {
905
+ void SendVCompact () {
906
+ Send (VDiskInfo.ActorID , new TEvBlobStorage::TEvVCompact (VDiskInfo.VDiskID ,
907
+ NKikimrBlobStorage::TEvVCompact::ASYNC), IEventHandle::FlagTrackDelivery);
908
+ }
909
+
910
+ void SendVStatus () {
911
+ Send (VDiskInfo.ActorID , new TEvBlobStorage::TEvVStatus (VDiskInfo.VDiskID ), IEventHandle::FlagTrackDelivery);
912
+ }
913
+
914
+ void Handle (TEvBlobStorage::TEvVStatusResult::TPtr &ev) {
892
915
Y_ABORT_UNLESS (ev->Get ()->Record .GetStatus () == NKikimrProto::OK);
893
916
const NKikimrBlobStorage::TEvVStatusResult &record = ev->Get ()->Record ;
894
917
@@ -898,21 +921,22 @@ class TWaitForCompactionOneDisk : public TActorBootstrapped<TWaitForCompactionOn
898
921
899
922
if (logoBlobsCompacted && blocksCompacted && barriersCompacted) {
900
923
// Finished
901
- ctx. Send (NotifyID, new TEvents::TEvCompleted ());
902
- Die (ctx );
924
+ Send (NotifyID, new TEvents::TEvCompleted ());
925
+ PassAway ( );
903
926
} else {
904
927
Become (&TThis::StateSchedule);
905
- ctx.Send (VDiskInfo.ActorID ,
906
- new TEvBlobStorage::TEvVCompact (VDiskInfo.VDiskID , NKikimrBlobStorage::TEvVCompact::ASYNC));
928
+ SendVCompact ();
907
929
}
908
930
}
909
931
910
932
STRICT_STFUNC (StateSchedule,
911
- HFunc (TEvBlobStorage::TEvVCompactResult, Handle);
933
+ hFunc (TEvBlobStorage::TEvVCompactResult, Handle);
934
+ cFunc (TEvents::TEvUndelivered::EventType, SendVCompact)
912
935
)
913
936
914
937
STRICT_STFUNC(StateWait,
915
- HFunc (TEvBlobStorage::TEvVStatusResult, Handle);
938
+ hFunc (TEvBlobStorage::TEvVStatusResult, Handle);
939
+ cFunc (TEvents::TEvUndelivered::EventType, SendVStatus);
916
940
)
917
941
918
942
public:
@@ -981,9 +1005,14 @@ class TWaitForDefragOneDisk : public TActorBootstrapped<TWaitForDefragOneDisk> {
981
1005
982
1006
friend class TActorBootstrapped <TWaitForDefragOneDisk>;
983
1007
984
- void Bootstrap (const TActorContext &ctx ) {
1008
+ void Bootstrap (const TActorContext& ) {
985
1009
Become (&TThis::StateFunc);
986
- ctx.Send (VDiskInfo.ActorID , new TEvBlobStorage::TEvVDefrag (VDiskInfo.VDiskID , Full));
1010
+ SendRequest ();
1011
+ }
1012
+
1013
+ void SendRequest () {
1014
+ Send (VDiskInfo.ActorID , new TEvBlobStorage::TEvVDefrag (VDiskInfo.VDiskID , Full),
1015
+ IEventHandle::FlagTrackDelivery);
987
1016
}
988
1017
989
1018
void Handle (TEvBlobStorage::TEvVDefragResult::TPtr &ev, const TActorContext &ctx) {
@@ -993,12 +1022,13 @@ class TWaitForDefragOneDisk : public TActorBootstrapped<TWaitForDefragOneDisk> {
993
1022
ctx.Send (NotifyID, new TEvents::TEvCompleted ());
994
1023
Die (ctx);
995
1024
} else {
996
- ctx. Send (VDiskInfo. ActorID , new TEvBlobStorage::TEvVDefrag (VDiskInfo. VDiskID , Full) );
1025
+ SendRequest ( );
997
1026
}
998
1027
}
999
1028
1000
1029
STRICT_STFUNC (StateFunc,
1001
1030
HFunc (TEvBlobStorage::TEvVDefragResult, Handle);
1031
+ cFunc (TEvents::TEvUndelivered::EventType, SendRequest);
1002
1032
)
1003
1033
1004
1034
public:
@@ -1198,23 +1228,32 @@ class TWaitForSync : public TActorBootstrapped<TWaitForSync> {
1198
1228
TActorId NotifyID;
1199
1229
ui32 Counter = 0 ;
1200
1230
TMutualSyncState MutualSyncState;
1231
+ std::vector<std::pair<TActorId, TVDiskID>> VStatusSent;
1201
1232
1202
1233
friend class TActorBootstrapped <TWaitForSync>;
1203
1234
1204
- void Bootstrap (const TActorContext &ctx ) {
1235
+ void Bootstrap (const TActorContext& ) {
1205
1236
Become (&TThis::StateFunc);
1206
- GetStatuses (ctx );
1237
+ GetStatuses ();
1207
1238
}
1208
1239
1209
- void GetStatuses (const TActorContext &ctx ) {
1240
+ void GetStatuses () {
1210
1241
// send TEvVStatus to all working VDisks
1211
- auto sendFunc = [&ctx] (const TInfo &info) {
1212
- ctx.Send (info.ActorId , new TEvBlobStorage::TEvVStatus (info.VDiskId ));
1242
+ VStatusSent.clear ();
1243
+ auto sendFunc = [this ] (const TInfo &info) {
1244
+ ui32 idx = VStatusSent.size ();
1245
+ VStatusSent.emplace_back (info.ActorId , info.VDiskId );
1246
+ SendVStatus (idx);
1213
1247
};
1214
1248
MutualSyncState.ForEach (sendFunc);
1215
1249
Counter = MutualSyncState.InfoVecSize ();
1216
1250
}
1217
1251
1252
+ void SendVStatus (ui32 idx) {
1253
+ const auto & [actorId, vdiskId] = VStatusSent[idx];
1254
+ Send (actorId, new TEvBlobStorage::TEvVStatus (vdiskId), IEventHandle::FlagTrackDelivery, idx);
1255
+ }
1256
+
1218
1257
void Handle (TEvBlobStorage::TEvVStatusResult::TPtr &ev, const TActorContext &ctx) {
1219
1258
Y_ABORT_UNLESS (ev->Get ()->Record .GetStatus () == NKikimrProto::OK);
1220
1259
const NKikimrBlobStorage::TEvVStatusResult &record = ev->Get ()->Record ;
@@ -1230,13 +1269,18 @@ class TWaitForSync : public TActorBootstrapped<TWaitForSync> {
1230
1269
} else {
1231
1270
// Retry
1232
1271
MutualSyncState.Clear ();
1233
- GetStatuses (ctx );
1272
+ GetStatuses ();
1234
1273
}
1235
1274
}
1236
1275
}
1237
1276
1277
+ void Handle (const TEvents::TEvUndelivered::TPtr& ev) {
1278
+ SendVStatus (ev->Cookie );
1279
+ }
1280
+
1238
1281
STRICT_STFUNC (StateFunc,
1239
1282
HFunc (TEvBlobStorage::TEvVStatusResult, Handle);
1283
+ hFunc (TEvents::TEvUndelivered, Handle);
1240
1284
)
1241
1285
1242
1286
public:
@@ -1262,10 +1306,9 @@ class TCheckDbEmptynessActor : public TActorBootstrapped<TCheckDbEmptynessActor>
1262
1306
1263
1307
friend class TActorBootstrapped <TCheckDbEmptynessActor>;
1264
1308
1265
- void Bootstrap (const TActorContext &ctx ) {
1309
+ void Bootstrap (const TActorContext& ) {
1266
1310
Become (&TThis::StateFunc);
1267
- ctx.Send (VDiskInfo.ActorID ,
1268
- new TEvBlobStorage::TEvVStatus (VDiskInfo.VDiskID ));
1311
+ SendVStatus ();
1269
1312
}
1270
1313
1271
1314
void Handle (TEvBlobStorage::TEvVStatusResult::TPtr &ev, const TActorContext &ctx) {
@@ -1280,8 +1323,14 @@ class TCheckDbEmptynessActor : public TActorBootstrapped<TCheckDbEmptynessActor>
1280
1323
TThis::Die (ctx);
1281
1324
}
1282
1325
1326
+ void SendVStatus () {
1327
+ Send (VDiskInfo.ActorID , new TEvBlobStorage::TEvVStatus (VDiskInfo.VDiskID ),
1328
+ IEventHandle::FlagTrackDelivery);
1329
+ }
1330
+
1283
1331
STRICT_STFUNC (StateFunc,
1284
1332
HFunc (TEvBlobStorage::TEvVStatusResult, Handle);
1333
+ cFunc (TEvents::TEvUndelivered::EventType, SendVStatus);
1285
1334
)
1286
1335
1287
1336
public:
@@ -1318,22 +1367,29 @@ class TPutGCToCorrespondingVDisksActor : public TActorBootstrapped<TPutGCToCorre
1318
1367
1319
1368
friend class TActorBootstrapped <TPutGCToCorrespondingVDisksActor>;
1320
1369
1321
- void Bootstrap (const TActorContext &ctx ) {
1370
+ void Bootstrap (const TActorContext& ) {
1322
1371
TThis::Become (&TThis::StateFunc);
1323
1372
1324
1373
ui32 total = Conf->GroupInfo ->GetTotalVDisksNum ();
1325
1374
for (ui32 i = 0 ; i < total; i++) {
1326
1375
TAllVDisks::TVDiskInstance &instance = Conf->VDisks ->Get (i);
1327
1376
if (instance.Initialized ) {
1328
- ctx.Send (instance.ActorID ,
1329
- new TEvBlobStorage::TEvVCollectGarbage (TabletID, RecGen, RecGenCounter, Channel, Collect,
1330
- CollectGen, CollectStep, false , Keep.Get (),
1331
- DoNotKeep.Get (), instance.VDiskID , TInstant::Max ()));
1377
+ SendRequest (i);
1332
1378
Counter++;
1333
1379
}
1334
1380
}
1335
1381
}
1336
1382
1383
+ void SendRequest (ui32 idx) {
1384
+ TAllVDisks::TVDiskInstance &instance = Conf->VDisks ->Get (idx);
1385
+ Send (instance.ActorID ,
1386
+ new TEvBlobStorage::TEvVCollectGarbage (TabletID, RecGen, RecGenCounter, Channel, Collect,
1387
+ CollectGen, CollectStep, false , Keep.Get (),
1388
+ DoNotKeep.Get (), instance.VDiskID , TInstant::Max ()),
1389
+ IEventHandle::FlagTrackDelivery,
1390
+ /* cookie=*/ idx);
1391
+ }
1392
+
1337
1393
void Handle (TEvBlobStorage::TEvVCollectGarbageResult::TPtr &ev, const TActorContext &ctx) {
1338
1394
Y_ABORT_UNLESS (ev->Get ()->Record .GetStatus () == NKikimrProto::OK, " Status=%d" , ev->Get ()->Record .GetStatus ());
1339
1395
LOG_NOTICE (ctx, NActorsServices::TEST, " TEvVCollectGarbageResult succeded" );
@@ -1346,9 +1402,14 @@ class TPutGCToCorrespondingVDisksActor : public TActorBootstrapped<TPutGCToCorre
1346
1402
}
1347
1403
}
1348
1404
1405
+ void Handle (const TEvents::TEvUndelivered::TPtr& ev) {
1406
+ SendRequest (ev->Cookie );
1407
+ }
1408
+
1349
1409
STRICT_STFUNC (StateFunc,
1350
1410
HFunc (TEvBlobStorage::TEvVCollectGarbageResult, Handle);
1351
1411
IgnoreFunc (TEvBlobStorage::TEvVWindowChange);
1412
+ hFunc (TEvents::TEvUndelivered, Handle);
1352
1413
)
1353
1414
1354
1415
public:
@@ -1605,16 +1666,20 @@ class TCheckDataSnapshotActor : public TActorBootstrapped<TCheckDataSnapshotActo
1605
1666
TThis::Die (ctx);
1606
1667
} else {
1607
1668
// send read
1608
- auto req = TEvBlobStorage::TEvVGet::CreateExtremeDataQuery (Cur->VDiskID ,
1609
- TInstant::Max (),
1610
- NKikimrBlobStorage::EGetHandleClass::AsyncRead,
1611
- TEvBlobStorage::TEvVGet::EFlags::ShowInternals,
1612
- {},
1613
- {TLogoBlobID (Cur->Id , 0 )});
1614
- ctx.Send (Cur->ServiceID , req.release ());
1669
+ SendRequest ();
1615
1670
}
1616
1671
}
1617
1672
1673
+ void SendRequest () {
1674
+ auto req = TEvBlobStorage::TEvVGet::CreateExtremeDataQuery (Cur->VDiskID ,
1675
+ TInstant::Max (),
1676
+ NKikimrBlobStorage::EGetHandleClass::AsyncRead,
1677
+ TEvBlobStorage::TEvVGet::EFlags::ShowInternals,
1678
+ {},
1679
+ {TLogoBlobID (Cur->Id , 0 )});
1680
+ Send (Cur->ServiceID , req.release (), IEventHandle::FlagTrackDelivery);
1681
+ }
1682
+
1618
1683
void Handle (TEvBlobStorage::TEvVGetResult::TPtr &ev, const TActorContext &ctx) {
1619
1684
if ((*PDiskGetStatusHandler)(ctx, NotifyID, ev)) {
1620
1685
TThis::Die (ctx);
@@ -1665,6 +1730,7 @@ class TCheckDataSnapshotActor : public TActorBootstrapped<TCheckDataSnapshotActo
1665
1730
STRICT_STFUNC (StateFunc,
1666
1731
HFunc (TEvBlobStorage::TEvVGetResult, Handle);
1667
1732
IgnoreFunc (TEvBlobStorage::TEvVWindowChange);
1733
+ cFunc (TEvents::TEvUndelivered::EventType, SendRequest);
1668
1734
)
1669
1735
1670
1736
public:
@@ -1925,12 +1991,16 @@ class TManyPutsToOneVDiskActor : public TActorBootstrapped<TManyPutsToOneVDiskAc
1925
1991
1926
1992
void SendRequest (const TActorContext &ctx) {
1927
1993
Y_ASSERT (Counter == 0 );
1928
- PutLogoBlobToVDisk (ctx, VDiskInfo.ActorID , VDiskInfo.VDiskID , TLogoBlobID (Cur->Get ()->Id , PartId),
1929
- Cur->Get ()->Data , HandleClass);
1994
+ SendPut (ctx);
1930
1995
Counter = 1 ;
1931
1996
Cur->Next ();
1932
1997
}
1933
1998
1999
+ void SendPut (const TActorContext& ctx) {
2000
+ PutLogoBlobToVDisk (ctx, VDiskInfo.ActorID , VDiskInfo.VDiskID , TLogoBlobID (Cur->Get ()->Id , PartId),
2001
+ Cur->Get ()->Data , HandleClass);
2002
+ }
2003
+
1934
2004
void Handle (TEvBlobStorage::TEvVPutResult::TPtr &ev, const TActorContext &ctx) {
1935
2005
Y_ABORT_UNLESS (ev->Get ()->Record .GetStatus () == NKikimrProto::OK, " Status=%d" , ev->Get ()->Record .GetStatus ());
1936
2006
LOG_DEBUG (ctx, NActorsServices::TEST, " TEvVPutResult succeded" );
@@ -1950,6 +2020,7 @@ class TManyPutsToOneVDiskActor : public TActorBootstrapped<TManyPutsToOneVDiskAc
1950
2020
STRICT_STFUNC (StateFunc,
1951
2021
HFunc (TEvBlobStorage::TEvVPutResult, Handle);
1952
2022
IgnoreFunc (TEvBlobStorage::TEvVWindowChange);
2023
+ CFunc (TEvents::TEvUndelivered::EventType, SendPut);
1953
2024
)
1954
2025
1955
2026
public:
0 commit comments