Skip to content

Commit

Permalink
Make cooldown timeout on VDisk flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvru committed May 15, 2024
1 parent ed038e2 commit 89ba287
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ydb/core/blobstorage/dsproxy/dsproxy_put.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class TBlobStorageGroupPutRequest : public TBlobStorageGroupRequestActor<TBlobSt
}

void HandleIncarnation(TMonotonic timestamp, ui32 orderNumber, ui64 incarnationGuid) {
timestamp += TDuration::Seconds(15); // TODO: cooldown timeout
timestamp += VDiskCooldownTimeoutOnProxy;

Y_ABORT_UNLESS(orderNumber < IncarnationRecords.size());
auto& record = IncarnationRecords[orderNumber];
Expand Down
6 changes: 2 additions & 4 deletions ydb/core/blobstorage/nodewarden/node_warden_vdisk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

namespace NKikimr::NStorage {

constexpr TDuration PDISK_CONFIDENCE_DELAY = TDuration::Seconds(15);

void TNodeWarden::DestroyLocalVDisk(TVDiskRecord& vdisk) {
STLOG(PRI_INFO, BS_NODE, NW35, "DestroyLocalVDisk", (VDiskId, vdisk.GetVDiskId()), (VSlotId, vdisk.GetVSlotId()));
Y_ABORT_UNLESS(!vdisk.RuntimeData);
Expand Down Expand Up @@ -296,7 +294,7 @@ namespace NKikimr::NStorage {
StartLocalVDiskActor(record, TDuration::Zero());
} else if (record.RuntimeData->DonorMode < record.Config.HasDonorMode() || record.RuntimeData->ReadOnly != record.Config.GetReadOnly()) {
PoisonLocalVDisk(record);
StartLocalVDiskActor(record, PDISK_CONFIDENCE_DELAY);
StartLocalVDiskActor(record, VDiskCooldownTimeout);
}
}

Expand All @@ -323,7 +321,7 @@ namespace NKikimr::NStorage {
auto& record = it->second;
if (record.GetVDiskId() == vDiskId) {
PoisonLocalVDisk(record);
StartLocalVDiskActor(record, PDISK_CONFIDENCE_DELAY);
StartLocalVDiskActor(record, VDiskCooldownTimeout);
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ namespace NKikimr {
LOG_NOTICE(ctx, BS_LOCALRECOVERY,
VDISKP(LocRecCtx->VCtx->VDiskLogPrefix, "LocalRecovery START"));

SendYardInit(ctx, Config->BaseInfo.YardInitDelay);
SendYardInit(ctx, TDuration::Zero());
Become(&TThis::StateInitialize, ctx, VDiskCooldownTimeout, new TEvents::TEvWakeup);
VDiskMonGroup.VDiskLocalRecoveryState() = TDbMon::TDbLocalRecovery::YardInit;
}
Expand Down
8 changes: 6 additions & 2 deletions ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,14 @@ namespace NKikimr {
return;
}

Become(&TThis::RecoverLostDataStateFunc);
Become(&TThis::RecoverLostDataStateFunc, SyncerCtx->Config->BaseInfo.YardInitDelay, new TEvents::TEvWakeup);
Phase = TPhaseVal::PhaseRecoverLostData;
}

void RecoverLostDataResumeAfterDelay(const TActorContext& ctx) {
const TVDiskEternalGuid guid = GuidRecovOutcome->Guid;
RecoverLostDataId = ctx.Register(CreateSyncerRecoverLostDataActor(SyncerCtx, GInfo, CommitterId, ctx.SelfID, guid));
ActiveActors.Insert(RecoverLostDataId, __FILE__, __LINE__, ctx, NKikimrServices::BLOBSTORAGE);
Phase = TPhaseVal::PhaseRecoverLostData;
}

void Handle(TEvSyncerLostDataRecovered::TPtr &ev, const TActorContext &ctx) {
Expand All @@ -322,6 +325,7 @@ namespace NKikimr {
HFunc(TEvents::TEvPoisonPill, HandlePoison)
HFunc(TEvSublogLine, Handle)
HFunc(TEvVGenerationChange, RecoverLostDataModeHandle)
CFunc(TEvents::TSystem::Wakeup, RecoverLostDataResumeAfterDelay);
)

////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 89ba287

Please sign in to comment.