Skip to content

Merge CostMetrics changes from main #5221

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

Merged
merged 22 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f20e984
Add cost estimator for SSD (#1480)
serbel324 Jan 31, 2024
18be884
Reintroduce light indicator for bursts to BsCostModel, #1336 (#1477)
serbel324 Feb 5, 2024
da66c07
Adjust cost bucket capacity dynamically (#1681)
serbel324 Feb 8, 2024
9fe9ac6
Fix burst tests, adjust cost bucket inflow dynamically (#1778)
serbel324 Feb 15, 2024
62005ad
Pass VDisk burst threshold in config, fix TBucketQuoter bug (#2165)
serbel324 Feb 26, 2024
6f8e7c9
Add DiskTimeAvailable scaling option to BlobStorage configuration, im…
serbel324 Mar 7, 2024
36b2aee
Improve cost metrics configuration (#5045)
serbel324 Jun 4, 2024
274a79d
Fix config.proto
serbel324 Jun 5, 2024
ec12265
Fix merge mistake
serbel324 Jun 5, 2024
f0fac15
Return DskUsedBytes metrics (#4196)
serbel324 May 2, 2024
57951d1
Merge branch 'stable-24-1' into merge/24-1/cost-metrics
serbel324 Jun 6, 2024
22e9603
Update config.proto
serbel324 Jun 6, 2024
ff22142
Update node_warden_impl.cpp
serbel324 Jun 6, 2024
f94d91d
Update node_warden_impl.h
serbel324 Jun 6, 2024
33bdad7
Update node_warden_vdisk.cpp
serbel324 Jun 6, 2024
fedec87
Update blobstorage_cost_tracker.cpp
serbel324 Jun 6, 2024
2c57836
Update monitoring.cpp
serbel324 Jun 6, 2024
7bc079c
Fix merge mistake
serbel324 Jun 7, 2024
9ae4fe7
Fix PEERDIR
serbel324 Jun 10, 2024
0c0c243
Reintroduce test_helpers for ut_blobstorage (#1890)
serbel324 Feb 14, 2024
b89f7f3
Improve some headers (#1877)
serbel324 Feb 13, 2024
4268d97
Initialize ICB in testlib properly, fix Burst UT
serbel324 Jun 10, 2024
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
2 changes: 1 addition & 1 deletion library/cpp/bucket_quoter/bucket_quoter.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ class TBucketQuoter {

i64 UseAndFill(ui64 tokens) {
TGuard<Lock> g(BucketMutex);
UseNoLock(tokens);
FillBucket();
UseNoLock(tokens);
return Bucket;
}

Expand Down
6 changes: 5 additions & 1 deletion ydb/core/base/blobstorage_grouptype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ ui64 TBlobStorageGroupType::PartSize(const TLogoBlobID &id) const {

ui64 TBlobStorageGroupType::MaxPartSize(const TLogoBlobID &id) const {
Y_ABORT_UNLESS(!id.PartId());
return TErasureType::PartSize((TErasureType::ECrcMode)id.CrcMode(), id.BlobSize());
return MaxPartSize((TErasureType::ECrcMode)id.CrcMode(), id.BlobSize());
}

ui64 TBlobStorageGroupType::MaxPartSize(TErasureType::ECrcMode crcMode, ui32 blobSize) const {
return TErasureType::PartSize(crcMode, blobSize);
}

bool TBlobStorageGroupType::PartFits(ui32 partId, ui32 idxInSubgroup) const {
Expand Down
1 change: 1 addition & 0 deletions ydb/core/base/blobstorage_grouptype.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ struct TBlobStorageGroupType : public TErasureType {

ui64 PartSize(const TLogoBlobID &id) const;
ui64 MaxPartSize(const TLogoBlobID &id) const;
ui64 MaxPartSize(TErasureType::ECrcMode crcMode, ui32 blobSize) const;

bool PartFits(ui32 partId, ui32 idxInSubgroup) const;
};
Expand Down
1 change: 1 addition & 0 deletions ydb/core/blobstorage/dsproxy/ut_fat/dsproxy_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4252,6 +4252,7 @@ class TBlobStorageProxyTest: public TTestBase {
vDiskConfig->GCOnlySynced = false;
vDiskConfig->HullCompLevelRateThreshold = 0.1;
vDiskConfig->SkeletonFrontQueueBackpressureCheckMsgId = false;
vDiskConfig->UseCostTracker = false;

IActor* vDisk = CreateVDisk(vDiskConfig, bsInfo, counters);
TActorSetupCmd vDiskSetup(vDisk, TMailboxType::Revolving, 0);
Expand Down
14 changes: 14 additions & 0 deletions ydb/core/blobstorage/nodewarden/node_warden_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,20 @@ void TNodeWarden::Bootstrap() {
if (actorSystem && actorSystem->AppData<TAppData>() && actorSystem->AppData<TAppData>()->Icb) {
actorSystem->AppData<TAppData>()->Icb->RegisterLocalControl(EnablePutBatching, "BlobStorage_EnablePutBatching");
actorSystem->AppData<TAppData>()->Icb->RegisterLocalControl(EnableVPatch, "BlobStorage_EnableVPatch");
const TIntrusivePtr<NKikimr::TControlBoard>& icb = actorSystem->AppData<TAppData>()->Icb;

icb->RegisterSharedControl(CostMetricsParametersByMedia[NPDisk::DEVICE_TYPE_ROT].BurstThresholdNs,
"VDiskControls.BurstThresholdNsHDD");
icb->RegisterSharedControl(CostMetricsParametersByMedia[NPDisk::DEVICE_TYPE_SSD].BurstThresholdNs,
"VDiskControls.BurstThresholdNsSSD");
icb->RegisterSharedControl(CostMetricsParametersByMedia[NPDisk::DEVICE_TYPE_NVME].BurstThresholdNs,
"VDiskControls.BurstThresholdNsNVME");
icb->RegisterSharedControl(CostMetricsParametersByMedia[NPDisk::DEVICE_TYPE_ROT].DiskTimeAvailableScale,
"VDiskControls.DiskTimeAvailableScaleHDD");
icb->RegisterSharedControl(CostMetricsParametersByMedia[NPDisk::DEVICE_TYPE_SSD].DiskTimeAvailableScale,
"VDiskControls.DiskTimeAvailableScaleSSD");
icb->RegisterSharedControl(CostMetricsParametersByMedia[NPDisk::DEVICE_TYPE_NVME].DiskTimeAvailableScale,
"VDiskControls.DiskTimeAvailableScaleNVME");
}

// start replication broker
Expand Down
7 changes: 7 additions & 0 deletions ydb/core/blobstorage/nodewarden/node_warden_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ namespace NKikimr::NStorage {
TReplQuoter::TPtr ReplNodeRequestQuoter;
TReplQuoter::TPtr ReplNodeResponseQuoter;

TCostMetricsParametersByMedia CostMetricsParametersByMedia;

public:
struct TGroupRecord;

Expand All @@ -137,6 +139,11 @@ namespace NKikimr::NStorage {
: Cfg(cfg)
, EnablePutBatching(Cfg->FeatureFlags.GetEnablePutBatchingForBlobStorage(), false, true)
, EnableVPatch(Cfg->FeatureFlags.GetEnableVPatch(), false, true)
, CostMetricsParametersByMedia({
TCostMetricsParameters{200},
TCostMetricsParameters{50},
TCostMetricsParameters{32},
})
{
Y_ABORT_UNLESS(Cfg->BlobStorageConfig.GetServiceSet().AvailabilityDomainsSize() <= 1);
AvailDomainId = 1;
Expand Down
3 changes: 3 additions & 0 deletions ydb/core/blobstorage/nodewarden/node_warden_vdisk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ namespace NKikimr::NStorage {
vdiskConfig->EnableVDiskCooldownTimeout = Cfg->EnableVDiskCooldownTimeout;
vdiskConfig->ReplPausedAtStart = Cfg->VDiskReplPausedAtStart;
vdiskConfig->EnableVPatch = EnableVPatch;

vdiskConfig->CostMetricsParametersByMedia = CostMetricsParametersByMedia;

vdiskConfig->FeatureFlags = Cfg->FeatureFlags;

// issue initial report to whiteboard before creating actor to avoid races
Expand Down
8 changes: 4 additions & 4 deletions ydb/core/blobstorage/pdisk/blobstorage_pdisk.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ struct TEvYardInitResult : public TEventLocal<TEvYardInitResult, TEvBlobStorage:
TEvYardInitResult(const NKikimrProto::EReplyStatus status, const TString &errorReason)
: Status(status)
, StatusFlags(0)
, PDiskParams(new TPDiskParams(0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
, PDiskParams(new TPDiskParams(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, DEVICE_TYPE_ROT))
, ErrorReason(errorReason)
{
Y_ABORT_UNLESS(status != NKikimrProto::OK, "Single-parameter constructor is for error responses only");
Expand All @@ -183,7 +183,7 @@ struct TEvYardInitResult : public TEventLocal<TEvYardInitResult, TEvBlobStorage:
ui64 writeSpeedBps, ui64 readBlockSize, ui64 writeBlockSize,
ui64 bulkWriteBlockSize, ui32 chunkSize, ui32 appendBlockSize,
TOwner owner, TOwnerRound ownerRound, TStatusFlags statusFlags, TVector<TChunkIdx> ownedChunks,
const TString &errorReason)
EDeviceType trueMediaType, const TString &errorReason)
: Status(status)
, StatusFlags(statusFlags)
, PDiskParams(new TPDiskParams(
Expand All @@ -196,8 +196,8 @@ struct TEvYardInitResult : public TEventLocal<TEvYardInitResult, TEvBlobStorage:
writeSpeedBps,
readBlockSize,
writeBlockSize,
bulkWriteBlockSize
))
bulkWriteBlockSize,
trueMediaType))
, OwnedChunks(std::move(ownedChunks))
, ErrorReason(errorReason)
{}
Expand Down
8 changes: 5 additions & 3 deletions ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1769,7 +1769,8 @@ void TPDisk::ReplyErrorYardInitResult(TYardInit &evYardInit, const TString &str)
DriveModel.Speed(TDriveModel::OP_TYPE_WRITE), readBlockSize, writeBlockSize,
DriveModel.BulkWriteBlockSize(),
GetUserAccessibleChunkSize(), GetChunkAppendBlockSize(), OwnerSystem, 0,
GetStatusFlags(OwnerSystem, evYardInit.OwnerGroupType), TVector<TChunkIdx>(), error.Str()));
GetStatusFlags(OwnerSystem, evYardInit.OwnerGroupType), TVector<TChunkIdx>(),
Cfg->RetrieveDeviceType(), error.Str()));
Mon.YardInit.CountResponse();
}

Expand Down Expand Up @@ -1816,7 +1817,8 @@ bool TPDisk::YardInitForKnownVDisk(TYardInit &evYardInit, TOwner owner) {
DriveModel.SeekTimeNs() / 1000ull, DriveModel.Speed(TDriveModel::OP_TYPE_READ),
DriveModel.Speed(TDriveModel::OP_TYPE_WRITE), readBlockSize, writeBlockSize,
DriveModel.BulkWriteBlockSize(), GetUserAccessibleChunkSize(), GetChunkAppendBlockSize(), owner,
ownerRound, GetStatusFlags(OwnerSystem, evYardInit.OwnerGroupType), ownedChunks, nullptr));
ownerRound, GetStatusFlags(OwnerSystem, evYardInit.OwnerGroupType), ownedChunks,
Cfg->RetrieveDeviceType(), nullptr));
GetStartingPoints(owner, result->StartingPoints);
ownerData.VDiskId = vDiskId;
ownerData.CutLogId = evYardInit.CutLogId;
Expand Down Expand Up @@ -1967,7 +1969,7 @@ void TPDisk::YardInitFinish(TYardInit &evYardInit) {
DriveModel.Speed(TDriveModel::OP_TYPE_WRITE), readBlockSize, writeBlockSize,
DriveModel.BulkWriteBlockSize(), GetUserAccessibleChunkSize(), GetChunkAppendBlockSize(), owner, ownerRound,
GetStatusFlags(OwnerSystem, evYardInit.OwnerGroupType) | ui32(NKikimrBlobStorage::StatusNewOwner), TVector<TChunkIdx>(),
nullptr));
Cfg->RetrieveDeviceType(), nullptr));
GetStartingPoints(result->PDiskParams->Owner, result->StartingPoints);
WriteSysLogRestorePoint(new TCompletionEventSender(
this, evYardInit.Sender, result.Release(), Mon.YardInit.Results), evYardInit.ReqId, {});
Expand Down
Loading
Loading