Skip to content

Commit c2f23bc

Browse files
committed
Grooming
1 parent 1e0a392 commit c2f23bc

6 files changed

+45
-49
lines changed

ydb/core/blobstorage/pdisk/blobstorage_pdisk_completion_impl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace NPDisk {
1515
void TCompletionLogWrite::Exec(TActorSystem *actorSystem) {
1616
// bool isNewChunksCommited = false;
1717
if (CommitedLogChunks) {
18-
NWilson::TSpan span(TWilson::PDisk, TraceId.Clone(), "PDisk.TCommitLogChunks");
18+
NWilson::TSpan span(TWilson::PDisk, TraceId.Clone(), "PDisk.CommitLogChunks");
1919
auto* req = PDisk->ReqCreator.CreateFromArgs<TCommitLogChunks>(std::move(CommitedLogChunks), std::move(span));
2020
PDisk->InputRequest(req);
2121
//isNewChunksCommited = true;

ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2145,7 +2145,7 @@ void TPDisk::KillOwner(TOwner owner, TOwnerRound killOwnerRound, TCompletionEven
21452145
<< " removed ownerId# " << owner << " from chunks Keeper");
21462146
}
21472147

2148-
TryTrimChunk(false, 0, nullptr);
2148+
TryTrimChunk(false, 0, NWilson::TSpan{});
21492149
ui64 lastSeenLsn = 0;
21502150
auto it = LogChunks.begin();
21512151
while (it != LogChunks.end()) {
@@ -2406,7 +2406,7 @@ void TPDisk::ClearQuarantineChunks() {
24062406
}
24072407

24082408
// Should be called to initiate TRIM (on chunk delete or prev trim done)
2409-
void TPDisk::TryTrimChunk(bool prevDone, ui64 trimmedSize, const NWilson::TSpan* parentSpan) {
2409+
void TPDisk::TryTrimChunk(bool prevDone, ui64 trimmedSize, const NWilson::TSpan& parentSpan) {
24102410
TGuard<TMutex> g(StateMutex);
24112411
TrimOffset += trimmedSize;
24122412
if (!DriveModel.IsTrimSupported()) {
@@ -2501,7 +2501,7 @@ void TPDisk::ProcessFastOperationsQueue() {
25012501
OnLogCommitDone(static_cast<TLogCommitDone&>(*req));
25022502
break;
25032503
case ERequestType::RequestTryTrimChunk:
2504-
TryTrimChunk(true, static_cast<TTryTrimChunk&>(*req).TrimSize, &req->Span);
2504+
TryTrimChunk(true, static_cast<TTryTrimChunk&>(*req).TrimSize, req->Span);
25052505
break;
25062506
case ERequestType::RequestReleaseChunks:
25072507
MarkChunksAsReleased(static_cast<TReleaseChunks&>(*req));

ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ class TPDisk : public IPDisk {
352352
void ProcessChunkTrimQueue();
353353
void ClearQuarantineChunks();
354354
// Should be called to initiate TRIM (on chunk delete or prev trim done)
355-
void TryTrimChunk(bool prevDone, ui64 trimmedSize, const NWilson::TSpan* parentSpan);
355+
void TryTrimChunk(bool prevDone, ui64 trimmedSize, const NWilson::TSpan& parentSpan);
356356
void ProcessFastOperationsQueue();
357357
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
358358
// Drive info and write cache

ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl_log.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ void TPDisk::ProcessLogWriteQueueAndCommits() {
756756
JointLogWrites.clear();
757757

758758
// Check if we can TRIM some chunks that were deleted
759-
TryTrimChunk(false, 0, nullptr);
759+
TryTrimChunk(false, 0, NWilson::TSpan{});
760760

761761
Mon.LogOperationSizeBytes.Increment(logOperationSizeBytes);
762762
}
@@ -1264,7 +1264,7 @@ void TPDisk::OnLogCommitDone(TLogCommitDone &req) {
12641264
WriteSysLogRestorePoint(completion.Release(), req.ReqId, {}); // FIXME: wilson
12651265
}
12661266
}
1267-
TryTrimChunk(false, 0, &req.Span);
1267+
TryTrimChunk(false, 0, req.Span);
12681268
}
12691269

12701270
void TPDisk::MarkChunksAsReleased(TReleaseChunks& req) {
@@ -1304,7 +1304,7 @@ void TPDisk::MarkChunksAsReleased(TReleaseChunks& req) {
13041304
}
13051305
IsLogChunksReleaseInflight = false;
13061306

1307-
TryTrimChunk(false, 0, &req.Span);
1307+
TryTrimChunk(false, 0, req.Span);
13081308
}
13091309
}
13101310

ydb/core/blobstorage/pdisk/blobstorage_pdisk_req_creator.h

+5-8
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,11 @@ class TReqCreator {
217217

218218
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
219219
// TODO: Make all functions in style
220-
[[nodiscard]] TChunkTrim* CreateChunkTrim(ui32 chunkIdx, ui32 offset, ui64 size, const NWilson::TSpan* parent) {
221-
NWilson::TSpan span;
222-
if (parent != nullptr) {
223-
auto span = parent->CreateChild(TWilson::PDisk, "PDisk.TChunkTrim");
224-
span.Attribute("chunk_idx", chunkIdx)
225-
.Attribute("offset", offset)
226-
.Attribute("size", static_cast<i64>(size));
227-
}
220+
[[nodiscard]] TChunkTrim* CreateChunkTrim(ui32 chunkIdx, ui32 offset, ui64 size, const NWilson::TSpan& parent) {
221+
NWilson::TSpan span = parent.CreateChild(TWilson::PDisk, "PDisk.TChunkTrim");
222+
span.Attribute("chunk_idx", chunkIdx)
223+
.Attribute("offset", offset)
224+
.Attribute("size", static_cast<i64>(size));
228225
Mon->Trim.CountRequest(size);
229226
return CreateFromArgs<TChunkTrim>(chunkIdx, offset, size, std::move(span));
230227
}

ydb/core/blobstorage/pdisk/blobstorage_pdisk_requestimpl.h

+32-33
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,18 @@ class TRequestBase : public TThrRefBase {
5959
mutable NLWTrace::TOrbit Orbit;
6060
public:
6161
TRequestBase(const TActorId &sender, TReqId reqId, TOwner owner, TOwnerRound ownerRound, ui8 priorityClass,
62-
NWilson::TSpan span)
62+
NWilson::TSpan span = {})
6363
: Sender(sender)
6464
, ReqId(reqId)
6565
, Owner(owner)
6666
, OwnerRound(ownerRound)
6767
, PriorityClass(priorityClass)
6868
, OwnerGroupType(EOwnerGroupType::Dynamic)
6969
, CreationTime(HPNow())
70-
, Span(std::move(span.EnableAutoEnd()))
71-
{}
70+
, Span(std::move(span))
71+
{
72+
Span.EnableAutoEnd();
73+
}
7274

7375
void SetOwnerGroupType(bool isStaticGroupOwner) {
7476
OwnerGroupType = (isStaticGroupOwner ? EOwnerGroupType::Static : EOwnerGroupType::Dynamic);
@@ -125,7 +127,7 @@ class TYardInit : public TRequestBase {
125127
ui32 SlotId;
126128

127129
TYardInit(const NPDisk::TEvYardInit &ev, const TActorId &sender, TAtomicBase reqIdx)
128-
: TRequestBase(sender, TReqId(TReqId::YardInit, reqIdx), 0, ev.OwnerRound, NPriInternal::Other, NWilson::TSpan{})
130+
: TRequestBase(sender, TReqId(TReqId::YardInit, reqIdx), 0, ev.OwnerRound, NPriInternal::Other)
129131
, VDisk(ev.VDisk)
130132
, PDiskGuid(ev.PDiskGuid)
131133
, CutLogId(ev.CutLogID)
@@ -160,7 +162,7 @@ class TYardInit : public TRequestBase {
160162
class TCheckSpace : public TRequestBase {
161163
public:
162164
TCheckSpace(const NPDisk::TEvCheckSpace &ev, const TActorId &sender, TAtomicBase reqIdx)
163-
: TRequestBase(sender, TReqId(TReqId::CheckSpace, reqIdx), ev.Owner, ev.OwnerRound, NPriInternal::Other, NWilson::TSpan{})
165+
: TRequestBase(sender, TReqId(TReqId::CheckSpace, reqIdx), ev.Owner, ev.OwnerRound, NPriInternal::Other)
164166
{
165167
Y_UNUSED(ev);
166168
}
@@ -180,13 +182,12 @@ class TLogRead : public TRequestBase {
180182

181183
TLogRead(const NPDisk::TEvReadLog::TPtr &ev, TAtomicBase reqIdx)
182184
: TRequestBase(ev->Sender, TReqId(TReqId::LogRead, reqIdx), ev->Get()->Owner, ev->Get()->OwnerRound, NPriInternal::LogRead,
183-
std::move(
184-
NWilson::TSpan(TWilson::PDisk, std::move(ev->TraceId), "PDisk.LogRead")
185-
.Attribute("size_limit", static_cast<i64>(ev->Get()->SizeLimit))
186-
))
185+
NWilson::TSpan(TWilson::PDisk, std::move(ev->TraceId), "PDisk.LogRead"))
187186
, Position(ev->Get()->Position)
188187
, SizeLimit(ev->Get()->SizeLimit)
189-
{}
188+
{
189+
Span.Attribute("size_limit", static_cast<i64>(ev->Get()->SizeLimit));
190+
}
190191

191192
ERequestType GetType() const override {
192193
return ERequestType::RequestLogRead;
@@ -206,17 +207,16 @@ class TLogReadContinue : public TRequestBase {
206207

207208
TLogReadContinue(const NPDisk::TEvReadLogContinue::TPtr &ev, TAtomicBase /*reqIdx*/)
208209
: TRequestBase(ev->Sender, ev->Get()->ReqId, 0, 0, NPriInternal::LogRead,
209-
std::move(
210-
NWilson::TSpan(TWilson::PDisk, std::move(ev->TraceId), "PDisk.LogReadContinue")
211-
.Attribute("size", ev->Get()->Size)
212-
.Attribute("offset", static_cast<i64>(ev->Get()->Offset))
213-
))
210+
NWilson::TSpan(TWilson::PDisk, std::move(ev->TraceId), "PDisk.LogReadContinue"))
214211
, Data(ev->Get()->Data)
215212
, Size(ev->Get()->Size)
216213
, Offset(ev->Get()->Offset)
217214
, CompletionAction(ev->Get()->CompletionAction)
218215
, ReqId(ev->Get()->ReqId)
219-
{}
216+
{
217+
Span.Attribute("size", ev->Get()->Size)
218+
.Attribute("offset", static_cast<i64>(ev->Get()->Offset));
219+
}
220220

221221
ERequestType GetType() const override {
222222
return ERequestType::RequestLogReadContinue;
@@ -231,8 +231,7 @@ class TLogReadResultProcess : public TRequestBase {
231231
NPDisk::TEvReadLogResult::TPtr ReadLogResult;
232232

233233
TLogReadResultProcess(NPDisk::TEvReadLogResult::TPtr &ev, const TActorId &sender, TAtomicBase reqIdx)
234-
: TRequestBase(sender, TReqId(TReqId::LogReadResultProcess, reqIdx), 0, 0, NPriInternal::LogRead, NWilson::TSpan{})
235-
234+
: TRequestBase(sender, TReqId(TReqId::LogReadResultProcess, reqIdx), 0, 0, NPriInternal::LogRead)
236235
, ReadLogResult(std::move(ev))
237236
{}
238237

@@ -252,7 +251,7 @@ class TLogSectorRestore : public TRequestBase {
252251
TCompletionAction *CompletionAction;
253252

254253
TLogSectorRestore(const NPDisk::TEvLogSectorRestore &ev, const TActorId &sender, TAtomicBase reqIdx)
255-
: TRequestBase(sender, TReqId(TReqId::LogSectorRestore, reqIdx), 0, 0, NPriInternal::LogRead, NWilson::TSpan{})
254+
: TRequestBase(sender, TReqId(TReqId::LogSectorRestore, reqIdx), 0, 0, NPriInternal::LogRead)
256255
, Data(ev.Data)
257256
, Size(ev.Size)
258257
, Offset(ev.Offset)
@@ -615,7 +614,7 @@ class TChunkTrim : public TRequestBase {
615614
class THarakiri : public TRequestBase {
616615
public:
617616
THarakiri(const NPDisk::TEvHarakiri &ev, const TActorId &sender, TAtomicBase reqIdx)
618-
: TRequestBase(sender, TReqId(TReqId::Harakiri, reqIdx), ev.Owner, ev.OwnerRound, NPriInternal::Other, NWilson::TSpan{})
617+
: TRequestBase(sender, TReqId(TReqId::Harakiri, reqIdx), ev.Owner, ev.OwnerRound, NPriInternal::Other)
619618
{}
620619

621620
ERequestType GetType() const override {
@@ -633,7 +632,7 @@ class TSlay : public TRequestBase {
633632
ui32 PDiskId;
634633
ui32 VSlotId;
635634
TSlay(const NPDisk::TEvSlay &ev, const TActorId &sender, TAtomicBase reqIdx)
636-
: TRequestBase(sender, TReqId(TReqId::Slay, reqIdx), OwnerUnallocated, ev.SlayOwnerRound, NPriInternal::Other, NWilson::TSpan{})
635+
: TRequestBase(sender, TReqId(TReqId::Slay, reqIdx), OwnerUnallocated, ev.SlayOwnerRound, NPriInternal::Other)
637636
, VDiskId(ev.VDiskId)
638637
, SlayOwnerRound(ev.SlayOwnerRound)
639638
, PDiskId(ev.PDiskId)
@@ -659,7 +658,7 @@ class TChunkLock : public TRequestBase {
659658
NKikimrBlobStorage::TPDiskSpaceColor::E Color;
660659

661660
TChunkLock(const NPDisk::TEvChunkLock &ev, const TActorId &sender, TAtomicBase reqIdx)
662-
: TRequestBase(sender, TReqId(TReqId::ChunkLock, reqIdx), 0, 0, NPriInternal::Other, NWilson::TSpan{})
661+
: TRequestBase(sender, TReqId(TReqId::ChunkLock, reqIdx), 0, 0, NPriInternal::Other)
663662
, LockFrom(ev.LockFrom)
664663
, ByVDiskId(ev.ByVDiskId)
665664
, Owner(ev.Owner)
@@ -686,7 +685,7 @@ class TChunkUnlock : public TRequestBase {
686685
bool IsGenerationSet;
687686

688687
TChunkUnlock(const NPDisk::TEvChunkUnlock &ev, const TActorId &sender, TAtomicBase reqIdx)
689-
: TRequestBase(sender, TReqId(TReqId::ChunkUnlock, reqIdx), 0, 0, NPriInternal::Other, NWilson::TSpan{})
688+
: TRequestBase(sender, TReqId(TReqId::ChunkUnlock, reqIdx), 0, 0, NPriInternal::Other)
690689
, LockFrom(ev.LockFrom)
691690
, ByVDiskId(ev.ByVDiskId)
692691
, Owner(ev.Owner)
@@ -708,7 +707,7 @@ class TChunkReserve : public TRequestBase {
708707
ui32 SizeChunks;
709708

710709
TChunkReserve(const NPDisk::TEvChunkReserve &ev, const TActorId &sender, TAtomicBase reqIdx)
711-
: TRequestBase(sender, TReqId(TReqId::ChunkReserve, reqIdx), ev.Owner, ev.OwnerRound, NPriInternal::Other, NWilson::TSpan{})
710+
: TRequestBase(sender, TReqId(TReqId::ChunkReserve, reqIdx), ev.Owner, ev.OwnerRound, NPriInternal::Other)
712711
, SizeChunks(ev.SizeChunks)
713712
{}
714713

@@ -725,7 +724,7 @@ class TChunkForget : public TRequestBase {
725724
TVector<TChunkIdx> ForgetChunks;
726725

727726
TChunkForget(const NPDisk::TEvChunkForget &ev, const TActorId &sender, TAtomicBase reqIdx)
728-
: TRequestBase(sender, TReqId(TReqId::ChunkForget, reqIdx), ev.Owner, ev.OwnerRound, NPriInternal::LogWrite, NWilson::TSpan{})
727+
: TRequestBase(sender, TReqId(TReqId::ChunkForget, reqIdx), ev.Owner, ev.OwnerRound, NPriInternal::LogWrite)
729728
, ForgetChunks(std::move(ev.ForgetChunks))
730729
{}
731730

@@ -746,7 +745,7 @@ class TWhiteboardReport : public TRequestBase {
746745
TAutoPtr<TEvWhiteboardReportResult> Response;
747746

748747
TWhiteboardReport(const TActorId &sender, TEvWhiteboardReportResult *response, TAtomicBase reqIdx)
749-
: TRequestBase(sender, TReqId(TReqId::WhiteboardReport, reqIdx), 0u, 0u, NPriInternal::Other, NWilson::TSpan{})
748+
: TRequestBase(sender, TReqId(TReqId::WhiteboardReport, reqIdx), 0u, 0u, NPriInternal::Other)
750749
, Response(response)
751750
{}
752751

@@ -771,7 +770,7 @@ class THttpInfo : public TRequestBase {
771770
THttpInfo(const TActorId &sender, const TActorId &endCustomer, TStringStream outputString,
772771
TString deviceFlagStr, TString realtimeFlagStr, TString fairSchedulerStr, TString errorStr,
773772
bool doGetSchedule, TAtomicBase reqIdx)
774-
: TRequestBase(sender, TReqId(TReqId::HttpInfo, reqIdx), 0u, 0u, NPriInternal::Other, NWilson::TSpan{})
773+
: TRequestBase(sender, TReqId(TReqId::HttpInfo, reqIdx), 0u, 0u, NPriInternal::Other)
775774
, EndCustomer(endCustomer)
776775
, OutputString(outputString)
777776
, DeviceFlagStr(deviceFlagStr)
@@ -805,7 +804,7 @@ class TUndelivered : public TRequestBase {
805804
TAutoPtr<TEvents::TEvUndelivered> Event;
806805

807806
TUndelivered(TEvents::TEvUndelivered::TPtr ev, const TActorId &sender, TAtomicBase reqIdx)
808-
: TRequestBase(sender, TReqId(TReqId::Undelivered, reqIdx), 0u, 0u, NPriInternal::Other, NWilson::TSpan{})
807+
: TRequestBase(sender, TReqId(TReqId::Undelivered, reqIdx), 0u, 0u, NPriInternal::Other)
809808
, Event(ev->Release())
810809
{}
811810

@@ -823,7 +822,7 @@ class TYardControl : public TRequestBase {
823822
void *Cookie;
824823

825824
TYardControl(const NPDisk::TEvYardControl &ev, const TActorId &sender, TAtomicBase reqIdx)
826-
: TRequestBase(sender, TReqId(TReqId::YardControl, reqIdx), 0, 0, NPriInternal::Other, NWilson::TSpan{})
825+
: TRequestBase(sender, TReqId(TReqId::YardControl, reqIdx), 0, 0, NPriInternal::Other)
827826
, Action(ev.Action)
828827
, Cookie(ev.Cookie)
829828
{}
@@ -860,14 +859,14 @@ class TConfigureScheduler : public TRequestBase {
860859
TPDiskSchedulerConfig SchedulerCfg;
861860

862861
TConfigureScheduler(const NPDisk::TEvConfigureScheduler &ev, const TActorId &sender, TAtomicBase reqIdx)
863-
: TRequestBase(sender, TReqId(TReqId::ConfigureScheduler, reqIdx), 0, 0, NPriInternal::Other, NWilson::TSpan{})
862+
: TRequestBase(sender, TReqId(TReqId::ConfigureScheduler, reqIdx), 0, 0, NPriInternal::Other)
864863
, OwnerId(ev.Owner)
865864
, OwnerRound(ev.OwnerRound)
866865
, SchedulerCfg(ev.SchedulerCfg)
867866
{}
868867

869868
TConfigureScheduler(TOwner ownerId, TOwnerRound ownerRound)
870-
: TRequestBase(TActorId(), TReqId(TReqId::InnerConfigureScheduler, 0), 0, 0, NPriInternal::Other, NWilson::TSpan{})
869+
: TRequestBase(TActorId(), TReqId(TReqId::InnerConfigureScheduler, 0), 0, 0, NPriInternal::Other)
871870
, OwnerId(ownerId)
872871
, OwnerRound(ownerRound)
873872
{}
@@ -937,7 +936,7 @@ class TLogCommitDone : public TRequestBase {
937936
TVector<TChunkIdx> DeletedChunks;
938937

939938
TLogCommitDone(const TLogWrite& reqLog, TAtomicBase reqIdx)
940-
: TRequestBase({}, TReqId(TReqId::LogCommitDone, reqIdx), OwnerSystem, 0, NPriInternal::Other, NWilson::TSpan{})
939+
: TRequestBase({}, TReqId(TReqId::LogCommitDone, reqIdx), OwnerSystem, 0, NPriInternal::Other)
941940
, OwnerId(reqLog.Owner)
942941
, OwnerRound(reqLog.OwnerRound)
943942
, Lsn(reqLog.Lsn)
@@ -982,7 +981,7 @@ class TTryTrimChunk : public TRequestBase {
982981
class TStopDevice : public TRequestBase {
983982
public:
984983
TStopDevice(TAtomicBase reqIdx)
985-
: TRequestBase(TActorId(), TReqId(TReqId::StopDevice, reqIdx), OwnerSystem, 0, NPriInternal::Other, NWilson::TSpan{})
984+
: TRequestBase(TActorId(), TReqId(TReqId::StopDevice, reqIdx), OwnerSystem, 0, NPriInternal::Other)
986985
{}
987986

988987
ERequestType GetType() const override {

0 commit comments

Comments
 (0)