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

merge to stable-23-3 #1802

Merged
merged 2 commits into from
Aug 16, 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
Original file line number Diff line number Diff line change
Expand Up @@ -522,14 +522,18 @@ void TDiskRegistryState::ProcessDisks(TVector<NProto::TDiskConfig> configs)
}

if (!config.GetFinishedMigrations().empty()) {
ui64 seqNo = NotificationSystem.GetDiskSeqNo(diskId);
const auto& notifiedDiskId = disk.MasterDiskId
? disk.MasterDiskId
: diskId;

ui64 seqNo = NotificationSystem.GetDiskSeqNo(notifiedDiskId);

if (!seqNo) {
ReportDiskRegistryNoScheduledNotification(TStringBuilder()
<< "No scheduled notification for disk " << diskId.Quote());
ReportDiskRegistryNoScheduledNotification(
TStringBuilder() << "No scheduled notification for disk "
<< notifiedDiskId.Quote());

seqNo = NotificationSystem.AddReallocateRequest(disk.MasterDiskId
? disk.MasterDiskId
: diskId);
seqNo = NotificationSystem.AddReallocateRequest(notifiedDiskId);
}

for (const auto& m: config.GetFinishedMigrations()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Y_UNIT_TEST_SUITE(TDiskRegistryTest)
}
}

Y_UNIT_TEST(ShouldFinishMigrationForMirroredDisk)
void ShouldFinishMigrationForMirroredDiskImpl(bool rebootTable)
{
const auto agent1 = CreateAgentConfig("agent-1", {
Device("dev-1", "uuid-1", "rack-1", 10_GB),
Expand Down Expand Up @@ -359,6 +359,14 @@ Y_UNIT_TEST_SUITE(TDiskRegistryTest)

diskRegistry.FinishMigration("disk-1", "uuid-2", "uuid-6");

if (rebootTable) {
diskRegistry.RebootTablet();
diskRegistry.WaitReady();

RegisterAgents(*runtime, 3);
WaitForAgents(*runtime, 3);
}

{
auto response = diskRegistry.AllocateDisk(
"disk-1",
Expand Down Expand Up @@ -398,6 +406,16 @@ Y_UNIT_TEST_SUITE(TDiskRegistryTest)
UNIT_ASSERT_VALUES_EQUAL(0, msg.MigrationsSize());
}
}

Y_UNIT_TEST(ShouldFinishMigrationForMirroredDisk)
{
ShouldFinishMigrationForMirroredDiskImpl(false);
}

Y_UNIT_TEST(ShouldFinishMigrationForMirroredDiskAfterReboot)
{
ShouldFinishMigrationForMirroredDiskImpl(true);
}
}

} // namespace NCloud::NBlockStore::NStorage
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,12 @@ void TNonreplicatedPartitionRdmaActor::HandleWakeup(

void TNonreplicatedPartitionRdmaActor::ReplyAndDie(const NActors::TActorContext& ctx)
{
LOG_INFO(
ctx,
TBlockStoreComponents::PARTITION,
"[%s] Reply and die",
SelfId().ToString().c_str());

for (auto& [_, endpoint]: AgentId2EndpointFuture) {
endpoint.Subscribe([](auto& future) {
if (future.HasValue()) {
Expand All @@ -489,6 +495,12 @@ void TNonreplicatedPartitionRdmaActor::HandlePoisonPill(
MakeIntrusive<TCallContext>());

if (!RequestsInProgress.Empty()) {
LOG_INFO(
ctx,
TBlockStoreComponents::PARTITION,
"[%s] Postpone PoisonPill response. Wait for requests in progress",
SelfId().ToString().c_str());

return;
}

Expand Down
20 changes: 20 additions & 0 deletions cloud/blockstore/libs/storage/volume/volume_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <library/cpp/lwtrace/signature.h>

#include <util/string/builder.h>
#include <util/stream/str.h>

namespace NCloud::NBlockStore::NStorage {

Expand Down Expand Up @@ -597,11 +598,30 @@ void TVolumeActor::HandlePoisonTaken(
}
}

const auto removed = std::distance(WaitForPartitions.begin(), it);

WaitForPartitions.erase(WaitForPartitions.begin(), it);

if (WaitForPartitions.empty()) {
StoppedPartitions.clear();
}

TStringStream waitList;
for (const auto& [p, _]: WaitForPartitions) {
waitList << p.ToString() << " ";
}

TStringStream stoppedList;
for (const auto& p: StoppedPartitions) {
stoppedList << p.ToString() << " ";
}

LOG_INFO(ctx, TBlockStoreComponents::VOLUME,
"[%lu] Partitions removed from the wait list: %lu. W: [ %s], S: [ %s]",
TabletID(),
removed,
waitList.Str().c_str(),
stoppedList.Str().c_str());
}

void TVolumeActor::HandleUpdateThrottlerState(
Expand Down
Loading