Skip to content

Commit

Permalink
Abort TLogWrite requests properly (#11665)
Browse files Browse the repository at this point in the history
  • Loading branch information
va-kuznecov authored Nov 15, 2024
1 parent 6bf263a commit b2ab948
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
9 changes: 9 additions & 0 deletions ydb/core/blobstorage/pdisk/blobstorage_pdisk_requestimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ void TRequestBase::AbortDelete(TRequestBase* request, TActorSystem* actorSystem)
request->Abort(actorSystem);
break;
}
case ERequestType::RequestLogWrite:
{
auto* log = static_cast<TLogWrite*>(request);
while (log) {
auto batch = log->PopFromBatch();
log->Abort(actorSystem);
log = batch;
}
}
default:
request->Abort(actorSystem);
delete request;
Expand Down
4 changes: 3 additions & 1 deletion ydb/core/blobstorage/pdisk/blobstorage_pdisk_requestimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ class TLogWrite : public TRequestBase {
}

void Abort(TActorSystem* actorSystem) override {
actorSystem->Send(Sender, new NPDisk::TEvLogResult(NKikimrProto::CORRUPTED, 0, "TLogWrite is being aborted"));
auto *result = new NPDisk::TEvLogResult(NKikimrProto::CORRUPTED, 0, "TLogWrite is being aborted");
result->Results.emplace_back(Lsn, Cookie);
actorSystem->Send(Sender, result);
}

TString ToString() const {
Expand Down
6 changes: 1 addition & 5 deletions ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,11 +1023,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {

for (ui32 i = 0; i < 100;) {
auto result = testCtx.Recv<NPDisk::TEvLogResult>();
if (result->Status == NKikimrProto::OK) {
i += result->Results.size();
} else {
++i;
}
i += result->Results.size();
}
Cerr << "all log writes are received" << Endl;
}
Expand Down

0 comments on commit b2ab948

Please sign in to comment.