diff --git a/cloud/blockstore/libs/storage/api/volume.h b/cloud/blockstore/libs/storage/api/volume.h index 81749c1db4..123ce988ad 100644 --- a/cloud/blockstore/libs/storage/api/volume.h +++ b/cloud/blockstore/libs/storage/api/volume.h @@ -35,7 +35,7 @@ namespace NCloud::NBlockStore::NStorage { xxx(UpdateVolumeParams, __VA_ARGS__) \ xxx(ChangeStorageConfig, __VA_ARGS__) \ xxx(GetStorageConfig, __VA_ARGS__) \ - xxx(StopPartionBeforeVolumeDestruction, __VA_ARGS__) \ + xxx(StopPartitionBeforeVolumeDestruction, __VA_ARGS__) \ // BLOCKSTORE_VOLUME_REQUESTS @@ -332,8 +332,8 @@ struct TEvVolume EvGetStorageConfigRequest = EvBegin + 58, EvGetStorageConfigResponse = EvBegin + 59, - EvStopPartionBeforeVolumeDestructionRequest = EvBegin + 60, - EvStopPartionBeforeVolumeDestructionResponse = EvBegin + 61, + EvStopPartitionBeforeVolumeDestructionRequest = EvBegin + 60, + EvStopPartitionBeforeVolumeDestructionResponse = EvBegin + 61, EvEnd }; diff --git a/cloud/blockstore/libs/storage/protos/volume.proto b/cloud/blockstore/libs/storage/protos/volume.proto index ede25bb25b..03870cf824 100644 --- a/cloud/blockstore/libs/storage/protos/volume.proto +++ b/cloud/blockstore/libs/storage/protos/volume.proto @@ -654,9 +654,9 @@ message TGetStorageConfigResponse } //////////////////////////////////////////////////////////////////////////////// -// StopPartionBeforeVolumeDestruction request/response. +// StopPartitionBeforeVolumeDestruction request/response. -message TStopPartionBeforeVolumeDestructionRequest +message TStopPartitionBeforeVolumeDestructionRequest { // Optional request headers. THeaders Headers = 1; @@ -666,7 +666,7 @@ message TStopPartionBeforeVolumeDestructionRequest string DiskId = 2; } -message TStopPartionBeforeVolumeDestructionResponse +message TStopPartitionBeforeVolumeDestructionResponse { // Optional error, set only if error happened. NCloud.NProto.TError Error = 1; diff --git a/cloud/blockstore/libs/storage/service/service_actor_destroy.cpp b/cloud/blockstore/libs/storage/service/service_actor_destroy.cpp index 689843a863..dbb51e47b7 100644 --- a/cloud/blockstore/libs/storage/service/service_actor_destroy.cpp +++ b/cloud/blockstore/libs/storage/service/service_actor_destroy.cpp @@ -81,7 +81,7 @@ class TDestroyVolumeActor final const TActorContext& ctx); void HandleStopPartitions( - const TEvVolume::TEvStopPartionBeforeVolumeDestructionResponse::TPtr& + const TEvVolume::TEvStopPartitionBeforeVolumeDestructionResponse::TPtr& ev, const TActorContext& ctx); @@ -189,7 +189,7 @@ void TDestroyVolumeActor::DeallocateDisk(const TActorContext& ctx) void TDestroyVolumeActor::StopPartitions(const TActorContext& ctx) { auto stopPartReq = std::make_unique< - TEvVolume::TEvStopPartionBeforeVolumeDestructionRequest>(); + TEvVolume::TEvStopPartitionBeforeVolumeDestructionRequest>(); stopPartReq->Record.SetDiskId(DiskId); NCloud::Send(ctx, MakeVolumeProxyServiceId(), std::move(stopPartReq)); } @@ -398,7 +398,7 @@ void TDestroyVolumeActor::HandleStatVolumeResponse( } void TDestroyVolumeActor::HandleStopPartitions( - const TEvVolume::TEvStopPartionBeforeVolumeDestructionResponse::TPtr& ev, + const TEvVolume::TEvStopPartitionBeforeVolumeDestructionResponse::TPtr& ev, const TActorContext& ctx) { Y_UNUSED(ev); @@ -435,7 +435,7 @@ STFUNC(TDestroyVolumeActor::StateWork) HandleStatVolumeResponse); HFunc( - TEvVolume::TEvStopPartionBeforeVolumeDestructionResponse, + TEvVolume::TEvStopPartitionBeforeVolumeDestructionResponse, HandleStopPartitions); default: diff --git a/cloud/blockstore/libs/storage/volume/testlib/test_env.cpp b/cloud/blockstore/libs/storage/volume/testlib/test_env.cpp index b8e54e4fd6..1bbb1cac70 100644 --- a/cloud/blockstore/libs/storage/volume/testlib/test_env.cpp +++ b/cloud/blockstore/libs/storage/volume/testlib/test_env.cpp @@ -551,10 +551,10 @@ TVolumeClient::CreateReadMetaHistoryRequest() return std::make_unique(); } -std::unique_ptr -TVolumeClient::CreateStopPartionBeforeVolumeDestructionRequest() { +std::unique_ptr +TVolumeClient::CreateStopPartitionBeforeVolumeDestructionRequest() { return std::make_unique< - TEvVolume::TEvStopPartionBeforeVolumeDestructionRequest>(); + TEvVolume::TEvStopPartitionBeforeVolumeDestructionRequest>(); } void TVolumeClient::SendRemoteHttpInfo( diff --git a/cloud/blockstore/libs/storage/volume/testlib/test_env.h b/cloud/blockstore/libs/storage/volume/testlib/test_env.h index 21167d8aff..91406a0a52 100644 --- a/cloud/blockstore/libs/storage/volume/testlib/test_env.h +++ b/cloud/blockstore/libs/storage/volume/testlib/test_env.h @@ -460,8 +460,8 @@ class TVolumeClient std::unique_ptr CreateReadMetaHistoryRequest(); - std::unique_ptr - CreateStopPartionBeforeVolumeDestructionRequest(); + std::unique_ptr + CreateStopPartitionBeforeVolumeDestructionRequest(); void SendRemoteHttpInfo( const TString& params, diff --git a/cloud/blockstore/libs/storage/volume/volume_actor_startstop.cpp b/cloud/blockstore/libs/storage/volume/volume_actor_startstop.cpp index 7aefbddd8a..22b39dd291 100644 --- a/cloud/blockstore/libs/storage/volume/volume_actor_startstop.cpp +++ b/cloud/blockstore/libs/storage/volume/volume_actor_startstop.cpp @@ -341,15 +341,16 @@ void TVolumeActor::StartPartitionsForGc(const TActorContext& ctx) PartitionsStartedReason = EPartitionsStartedReason::STARTED_FOR_GC; } -void TVolumeActor::HandleStopPartionBeforeVolumeDestruction( - const TEvVolume::TEvStopPartionBeforeVolumeDestructionRequest::TPtr& ev, +void TVolumeActor::HandleStopPartitionBeforeVolumeDestruction( + const TEvVolume::TEvStopPartitionBeforeVolumeDestructionRequest::TPtr& ev, const TActorContext& ctx) { if (!State->GetDiskRegistryBasedPartitionActor()) { LOG_ERROR( ctx, TBlockStoreComponents::VOLUME, - "[%lu] StopPartionBeforeVolumeDestruction request was send to not " + "[%lu] StopPartitionBeforeVolumeDestruction request was send to " + "not " "DR based disk", TabletID()); @@ -357,7 +358,7 @@ void TVolumeActor::HandleStopPartionBeforeVolumeDestruction( ctx, *ev, std::make_unique< - TEvVolume::TEvStopPartionBeforeVolumeDestructionResponse>( + TEvVolume::TEvStopPartitionBeforeVolumeDestructionResponse>( MakeError(E_NOT_IMPLEMENTED, "request not supported"))); return; } @@ -368,8 +369,6 @@ void TVolumeActor::HandleStopPartionBeforeVolumeDestruction( "[%lu] Stop Partition before volume destruction", TabletID()); - CancelRequests(ctx); - auto reqInfo = CreateRequestInfo(ev->Sender, ev->Cookie, ev->Get()->CallContext); StopPartitions( @@ -381,8 +380,13 @@ void TVolumeActor::HandleStopPartionBeforeVolumeDestruction( *reqInfo, std::make_unique< TEvVolume:: - TEvStopPartionBeforeVolumeDestructionResponse>()); + TEvStopPartitionBeforeVolumeDestructionResponse>()); }); + + TerminateTransactions(ctx); + KillActors(ctx); + CancelRequests(ctx); + BecomeAux(ctx, STATE_ZOMBIE); } diff --git a/cloud/blockstore/libs/storage/volume/volume_ut.cpp b/cloud/blockstore/libs/storage/volume/volume_ut.cpp index c7647d697c..cfe4007830 100644 --- a/cloud/blockstore/libs/storage/volume/volume_ut.cpp +++ b/cloud/blockstore/libs/storage/volume/volume_ut.cpp @@ -8157,10 +8157,10 @@ Y_UNIT_TEST_SUITE(TVolumeTest) false); - volume.StopPartionBeforeVolumeDestruction(); + volume.StopPartitionBeforeVolumeDestruction(); UNIT_ASSERT(partitionsStopped); - // Check that volume after TEvStopPartionBeforeVolumeDestructionRequest + // Check that volume after TEvStopPartitionBeforeVolumeDestructionRequest // in zombie state and rejects requsts. volume.SendGetVolumeInfoRequest(); auto response = volume.RecvGetVolumeInfoResponse();