Skip to content

Commit

Permalink
issue-2725: change test suite name and correct issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vladstepanyuk committed Jan 27, 2025
1 parent 1651cd6 commit b215e8a
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ void TVolumeActor::HandleDevicesAcquireFinished(
const TEvVolumePrivate::TEvDevicesAcquireFinished::TPtr& ev,
const TActorContext& ctx)
{
HandleDevicesAcquireFinishedImpl(ev->Get()->Error, ctx);
HandleDevicesAcquireFinishedImpl(ev->Get()->GetError(), ctx);
}

} // namespace NCloud::NBlockStore::NStorage
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ using namespace NKikimr::NTabletFlatExecutor;

namespace {

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

class TReleaseDevicesActor final
: public TActorBootstrapped<TReleaseDevicesActor>
{
Expand Down Expand Up @@ -276,7 +278,7 @@ void TVolumeActor::HandleDevicesReleasedFinished(
const TEvVolumePrivate::TEvDevicesReleaseFinished::TPtr& ev,
const NActors::TActorContext& ctx)
{
HandleDevicesReleasedFinishedImpl(ev->Get()->Error, ctx);
HandleDevicesReleasedFinishedImpl(ev->Get()->GetError(), ctx);
}

} // namespace NCloud::NBlockStore::NStorage
2 changes: 0 additions & 2 deletions cloud/blockstore/libs/storage/volume/volume_events_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ struct TEvVolumePrivate

struct TDevicesAcquireFinished
{
NProto::TError Error;
};

//
Expand All @@ -323,7 +322,6 @@ struct TEvVolumePrivate

struct TDevicesReleaseFinished
{
NProto::TError Error;
};

//
Expand Down
25 changes: 25 additions & 0 deletions cloud/blockstore/libs/storage/volume/volume_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,31 @@ const THashMultiMap<TActorId, TString>& TVolumeState::GetPipeServerId2ClientId()
return ClientIdsByPipeServerId;
}

TVector<NProto::TDeviceConfig>
TVolumeState::GetAllDevicesForAcquireRelease() const
{
const size_t allDevicesCount =
((Meta.ReplicasSize() + 1) * Meta.DevicesSize()) +
GetMeta().MigrationsSize();

TVector<NProto::TDeviceConfig> resultDevices;
resultDevices.reserve(allDevicesCount);

for (const auto& device: Meta.GetDevices()) {
resultDevices.emplace_back(device);
}
for (const auto& replica: Meta.GetReplicas()) {
for (const auto& device: replica.GetDevices()) {
resultDevices.emplace_back(device);
}
}
for (const auto& migration: Meta.GetMigrations()) {
resultDevices.emplace_back(migration.GetTargetDevice());
}

return resultDevices;
}

bool TVolumeState::CanPreemptClient(
const TString& oldClientId,
TInstant referenceTimestamp,
Expand Down
24 changes: 1 addition & 23 deletions cloud/blockstore/libs/storage/volume/volume_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -724,29 +724,7 @@ class TVolumeState
return Meta.GetResyncNeeded();
}

TVector<NProto::TDeviceConfig> GetAllDevicesForAcquireRelease()
{
const size_t allDevicesCount =
((Meta.ReplicasSize() + 1) * Meta.DevicesSize()) +
GetMeta().MigrationsSize();

TVector<NProto::TDeviceConfig> resultDevices;
resultDevices.reserve(allDevicesCount);

for (const auto& device: Meta.GetDevices()) {
resultDevices.emplace_back(device);
}
for (const auto& replica: Meta.GetReplicas()) {
for (const auto& device: replica.GetDevices()) {
resultDevices.emplace_back(device);
}
}
for (const auto& migration: Meta.GetMigrations()) {
resultDevices.emplace_back(migration.GetTargetDevice());
}

return resultDevices;
}
TVector<NProto::TDeviceConfig> GetAllDevicesForAcquireRelease() const;

private:
bool CanPreemptClient(
Expand Down
Loading

0 comments on commit b215e8a

Please sign in to comment.