@@ -140,9 +140,13 @@ class TReadProxy : public TActorBootstrapped<TReadProxy> {
140
140
{
141
141
Y_ABORT_UNLESS (Response);
142
142
const auto & record = ev->Get ()->Record ;
143
- if (!record.HasPartitionResponse () || !record.GetPartitionResponse ().HasCmdReadResult () ||
144
- record.GetStatus () != NMsgBusProxy::MSTATUS_OK || record.GetErrorCode () != NPersQueue::NErrorCode::OK ||
145
- record.GetPartitionResponse ().GetCmdReadResult ().ResultSize () == 0 ) {
143
+ auto isDirectRead = DirectReadKey.ReadId != 0 ;
144
+ if (!record.HasPartitionResponse ()
145
+ || !record.GetPartitionResponse ().HasCmdReadResult ()
146
+ || record.GetStatus () != NMsgBusProxy::MSTATUS_OK
147
+ || record.GetErrorCode () != NPersQueue::NErrorCode::OK
148
+ || (record.GetPartitionResponse ().GetCmdReadResult ().ResultSize () == 0 && !isDirectRead)
149
+ ) {
146
150
147
151
Response->Record .CopyFrom (record);
148
152
ctx.Send (Sender, Response.Release ());
@@ -151,7 +155,6 @@ class TReadProxy : public TActorBootstrapped<TReadProxy> {
151
155
}
152
156
Y_ABORT_UNLESS (record.HasPartitionResponse () && record.GetPartitionResponse ().HasCmdReadResult ());
153
157
const auto & readResult = record.GetPartitionResponse ().GetCmdReadResult ();
154
- auto isDirectRead = DirectReadKey.ReadId != 0 ;
155
158
if (isDirectRead) {
156
159
if (!PreparedResponse) {
157
160
PreparedResponse = std::make_shared<NKikimrClient::TResponse>();
@@ -162,10 +165,12 @@ class TReadProxy : public TActorBootstrapped<TReadProxy> {
162
165
responseRecord.SetStatus (NMsgBusProxy::MSTATUS_OK);
163
166
responseRecord.SetErrorCode (NPersQueue::NErrorCode::OK);
164
167
165
- Y_ABORT_UNLESS (readResult.ResultSize () > 0 );
168
+ Y_ABORT_UNLESS (readResult.ResultSize () > 0 || isDirectRead );
166
169
bool isStart = false ;
167
170
if (!responseRecord.HasPartitionResponse ()) {
168
- Y_ABORT_UNLESS (!readResult.GetResult (0 ).HasPartNo () || readResult.GetResult (0 ).GetPartNo () == 0 ); // starts from begin of record
171
+ if (readResult.ResultSize () > 0 ) {
172
+ Y_ABORT_UNLESS (!readResult.GetResult (0 ).HasPartNo () || readResult.GetResult (0 ).GetPartNo () == 0 ); // starts from begin of record
173
+ }
169
174
auto partResp = responseRecord.MutablePartitionResponse ();
170
175
auto readRes = partResp->MutableCmdReadResult ();
171
176
readRes->SetBlobsFromDisk (readRes->GetBlobsFromDisk () + readResult.GetBlobsFromDisk ());
0 commit comments