Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always respond with E_REJECT when killing a volume tablet actor #1988

Merged
merged 4 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions cloud/blockstore/libs/storage/volume/multi_partition_requests.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ class TMultiPartitionRequestActor final
{
private:
const TRequestInfoPtr RequestInfo;
const NActors::TActorId VolumeActorId;
drbasic marked this conversation as resolved.
Show resolved Hide resolved
const ui64 VolumeRequestId;
const TBlockRange64 OriginalRange;
const ui32 BlocksPerStripe;
const ui32 BlockSize;
Expand All @@ -73,8 +71,6 @@ class TMultiPartitionRequestActor final
public:
TMultiPartitionRequestActor(
TRequestInfoPtr requestInfo,
NActors::TActorId volumeActorId,
ui64 volumeRequestId,
TBlockRange64 originalRange,
ui32 blocksPerStripe,
ui32 blockSize,
Expand Down Expand Up @@ -277,8 +273,6 @@ class TMultiPartitionRequestActor final
MergeCommonFields(src, dst);
}

void NotifyCompleted(const NActors::TActorContext& ctx);

void ForkTraces(TCallContextPtr callContext)
{
auto& cc = RequestInfo->CallContext;
Expand Down Expand Up @@ -306,17 +300,13 @@ class TMultiPartitionRequestActor final
template <typename TMethod>
TMultiPartitionRequestActor<TMethod>::TMultiPartitionRequestActor(
TRequestInfoPtr requestInfo,
NActors::TActorId volumeActorId,
ui64 volumeRequestId,
TBlockRange64 originalRange,
ui32 blocksPerStripe,
ui32 blockSize,
ui32 partitionsCount,
TVector<TPartitionRequest<TMethod>> partitionRequests,
TRequestTraceInfo traceInfo)
: RequestInfo(std::move(requestInfo))
, VolumeActorId(volumeActorId)
, VolumeRequestId(volumeRequestId)
, OriginalRange(originalRange)
, BlocksPerStripe(blocksPerStripe)
, BlockSize(blockSize)
Expand Down Expand Up @@ -369,26 +359,6 @@ void TMultiPartitionRequestActor<TMethod>::Prepare(

////////////////////////////////////////////////////////////////////////////////

template <typename TMethod>
void TMultiPartitionRequestActor<TMethod>::NotifyCompleted(
const NActors::TActorContext& ctx)
{
if constexpr (RequiresReadWriteAccess<TMethod>) {
using TEvent = TEvVolumePrivate::TEvMultipartitionWriteOrZeroCompleted;
auto ev = std::make_unique<TEvent>(
VolumeRequestId,
Record.GetError().GetCode());

NCloud::Send(
ctx,
VolumeActorId,
std::move(ev)
);
}
}

////////////////////////////////////////////////////////////////////////////////

template <typename TMethod>
void TMultiPartitionRequestActor<TMethod>::HandlePartitionResponse(
const typename TMethod::TResponse::TPtr& ev,
Expand Down Expand Up @@ -427,8 +397,6 @@ void TMultiPartitionRequestActor<TMethod>::HandlePartitionResponse(

NCloud::Reply(ctx, *RequestInfo, std::move(response));

NotifyCompleted(ctx);

TBase::Die(ctx);
}
}
Expand Down Expand Up @@ -457,8 +425,6 @@ void TMultiPartitionRequestActor<TMethod>::HandleUndelivery(

NCloud::Reply(ctx, *RequestInfo, std::move(response));

NotifyCompleted(ctx);

TBase::Die(ctx);
}

Expand Down
3 changes: 0 additions & 3 deletions cloud/blockstore/libs/storage/volume/volume_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,9 +1016,6 @@ STFUNC(TVolumeActor::StateWork)
HandleDiskRegistryBasedPartCounters);
HFunc(TEvStatsService::TEvVolumePartCounters, HandlePartCounters);
HFunc(TEvVolumePrivate::TEvPartStatsSaved, HandlePartStatsSaved);
HFunc(
TEvVolumePrivate::TEvMultipartitionWriteOrZeroCompleted,
HandleMultipartitionWriteOrZeroCompleted);
HFunc(
TEvVolumePrivate::TEvWriteOrZeroCompleted,
HandleWriteOrZeroCompleted);
Expand Down
41 changes: 28 additions & 13 deletions cloud/blockstore/libs/storage/volume/volume_actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,26 +139,29 @@ class TVolumeActor final
TCallContext& callContext,
NProto::TError error);

NActors::TActorId Caller;
ui64 CallerCookie;
TCallContextPtr CallContext;
TCallContextPtr ForkedContext;
ui64 ReceiveTime;
TCancelRoutine* CancelRoutine;
const NActors::TActorId Caller;
const ui64 CallerCookie;
const TCallContextPtr CallContext;
const TCallContextPtr ForkedContext;
const ui64 ReceiveTime;
TCancelRoutine* const CancelRoutine;
const bool IsMultipartitionWriteOrZero;
drbasic marked this conversation as resolved.
Show resolved Hide resolved

TVolumeRequest(
const NActors::TActorId& caller,
ui64 callerCookie,
TCallContextPtr callContext,
TCallContextPtr forkedContext,
ui64 receiveTime,
TCancelRoutine cancelRoutine)
TCancelRoutine cancelRoutine,
bool isMultipartitionWriteOrZero)
: Caller(caller)
, CallerCookie(callerCookie)
, CallContext(std::move(callContext))
, ForkedContext(std::move(forkedContext))
, ReceiveTime(receiveTime)
, CancelRoutine(cancelRoutine)
, IsMultipartitionWriteOrZero(isMultipartitionWriteOrZero)
{}

void CancelRequest(
Expand Down Expand Up @@ -644,14 +647,18 @@ class TVolumeActor final
const TEvVolumePrivate::TEvPartStatsSaved::TPtr& ev,
const NActors::TActorContext& ctx);

void HandleMultipartitionWriteOrZeroCompleted(
const TEvVolumePrivate::TEvMultipartitionWriteOrZeroCompleted::TPtr& ev,
const NActors::TActorContext& ctx);

void HandleWriteOrZeroCompleted(
const TEvVolumePrivate::TEvWriteOrZeroCompleted::TPtr& ev,
const NActors::TActorContext& ctx);

template <typename TMethod>
bool ReplyToOriginalRequest(
const NActors::TActorContext& ctx,
NActors::TActorId sender,
NActors::IEventHandle::TEventFlags flags,
ui64 volumeRequestId,
std::unique_ptr<typename TMethod::TResponse> response);

void ReplyToDuplicateRequests(
const NActors::TActorContext& ctx,
ui64 key,
Expand Down Expand Up @@ -817,6 +824,15 @@ class TVolumeActor final
TCallContext& callContext,
ui64 startTime);

template <typename TMethod>
typename TMethod::TRequest::TPtr WrapRequest(
const typename TMethod::TRequest::TPtr& ev,
NActors::TActorId newRecipient,
ui64 volumeRequestId,
ui64 traceTime,
bool forkTraces,
bool isMultipartition);

template <typename TMethod>
void SendRequestToPartition(
const NActors::TActorContext& ctx,
Expand Down Expand Up @@ -848,7 +864,6 @@ class TVolumeActor final
void HandleCheckpointRequest(
const NActors::TActorContext& ctx,
const typename TMethod::TRequest::TPtr& ev,
ui64 volumeRequestId,
bool isTraced,
ui64 traceTs);

Expand All @@ -864,7 +879,7 @@ class TVolumeActor final
bool throttlingDisabled);

template <typename TMethod>
void HandleResponse(
void ForwardResponse(
const NActors::TActorContext& ctx,
const typename TMethod::TResponse::TPtr& ev);

Expand Down
11 changes: 0 additions & 11 deletions cloud/blockstore/libs/storage/volume/volume_actor_checkpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,12 +926,9 @@ template <>
void TVolumeActor::HandleCheckpointRequest<TCreateCheckpointMethod>(
const TActorContext& ctx,
const TCreateCheckpointMethod::TRequest::TPtr& ev,
ui64 volumeRequestId,
bool isTraced,
ui64 traceTs)
{
Y_UNUSED(volumeRequestId);

const auto& msg = *ev->Get();

auto requestInfo = CreateRequestInfo<TCreateCheckpointMethod>(
Expand Down Expand Up @@ -962,12 +959,9 @@ template <>
void TVolumeActor::HandleCheckpointRequest<TDeleteCheckpointMethod>(
const TActorContext& ctx,
const TDeleteCheckpointMethod::TRequest::TPtr& ev,
ui64 volumeRequestId,
bool isTraced,
ui64 traceTs)
{
Y_UNUSED(volumeRequestId);

const auto& msg = *ev->Get();

auto requestInfo = CreateRequestInfo<TDeleteCheckpointMethod>(
Expand All @@ -991,12 +985,9 @@ template <>
void TVolumeActor::HandleCheckpointRequest<TDeleteCheckpointDataMethod>(
const TActorContext& ctx,
const TDeleteCheckpointDataMethod::TRequest::TPtr& ev,
ui64 volumeRequestId,
bool isTraced,
ui64 traceTs)
{
Y_UNUSED(volumeRequestId);

const auto& msg = *ev->Get();

auto requestInfo = CreateRequestInfo<TDeleteCheckpointDataMethod>(
Expand All @@ -1020,11 +1011,9 @@ template <>
void TVolumeActor::HandleCheckpointRequest<TGetCheckpointStatusMethod>(
const TActorContext& ctx,
const TGetCheckpointStatusMethod::TRequest::TPtr& ev,
ui64 volumeRequestId,
bool isTraced,
ui64 traceTs)
{
Y_UNUSED(volumeRequestId);
Y_UNUSED(isTraced);
Y_UNUSED(traceTs);

Expand Down
Loading
Loading