@@ -149,12 +149,11 @@ void TPartitionActor::MakeCommit(const TActorContext& ctx) {
149
149
TPartitionActor::~TPartitionActor () = default ;
150
150
151
151
152
- void TPartitionActor::Bootstrap (const TActorContext&) {
153
-
152
+ void TPartitionActor::Bootstrap (const TActorContext& ctx) {
154
153
Become (&TThis::StateFunc);
154
+ ctx.Schedule (PREWAIT_DATA, new TEvents::TEvWakeup ());
155
155
}
156
156
157
-
158
157
void TPartitionActor::SendCommit (const ui64 readId, const ui64 offset, const TActorContext& ctx) {
159
158
NKikimrClient::TPersQueueRequest request;
160
159
request.MutablePartitionRequest ()->SetTopic (Topic->GetPrimaryPath ());
@@ -1014,7 +1013,6 @@ void TPartitionActor::WaitDataInPartition(const TActorContext& ctx) {
1014
1013
1015
1014
NTabletPipe::SendData (ctx, PipeClient, event.Release ());
1016
1015
1017
- ctx.Schedule (PREWAIT_DATA, new TEvents::TEvWakeup ());
1018
1016
ctx.Schedule (WAIT_DATA, new TEvPQProxy::TEvDeadlineExceeded (WaitDataCookie));
1019
1017
1020
1018
WaitDataInfly.insert (WaitDataCookie);
@@ -1213,13 +1211,18 @@ void TPartitionActor::HandlePoison(TEvents::TEvPoisonPill::TPtr&, const TActorCo
1213
1211
}
1214
1212
1215
1213
void TPartitionActor::Handle (TEvPQProxy::TEvDeadlineExceeded::TPtr& ev, const TActorContext& ctx) {
1216
- WaitDataInfly.erase (ev->Get ()->Cookie );
1217
- HandleWakeup (ctx);
1214
+ if (WaitDataInfly.erase (ev->Get ()->Cookie )) {
1215
+ DoWakeup (ctx);
1216
+ }
1218
1217
}
1219
1218
1220
1219
void TPartitionActor::HandleWakeup (const TActorContext& ctx) {
1221
- if (ReadOffset >= EndOffset && WaitDataInfly.size () <= 1 && PipeClient) { // send one more
1222
- Y_ABORT_UNLESS (WaitForData);
1220
+ DoWakeup (ctx);
1221
+ ctx.Schedule (PREWAIT_DATA, new TEvents::TEvWakeup ());
1222
+ }
1223
+
1224
+ void TPartitionActor::DoWakeup (const TActorContext& ctx) {
1225
+ if (WaitForData && ReadOffset >= EndOffset && WaitDataInfly.size () <= 1 && PipeClient) { // send one more
1223
1226
WaitDataInPartition (ctx);
1224
1227
}
1225
1228
}
0 commit comments