Skip to content

Commit 330692d

Browse files
authored
print VDisk id in VERIFYs (part two) (#16344)
1 parent c86b965 commit 330692d

File tree

68 files changed

+476
-404
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+476
-404
lines changed

ydb/core/blobstorage/ut_vdisk/lib/helpers.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ class TWaitForSync : public TActorBootstrapped<TWaitForSync> {
11541154
ui64 syncedLsn = info.SyncStates[j].SyncedLsn;
11551155
auto ri = [] { return TString("no internals"); };
11561156
NSyncLog::EReadWhatsNext whatsNext;
1157-
whatsNext = NSyncLog::WhatsNext(syncedLsn, 0, &InfoVec[j].SyncLogEssence, ri).WhatsNext;
1157+
whatsNext = NSyncLog::WhatsNext("", syncedLsn, 0, &InfoVec[j].SyncLogEssence, ri).WhatsNext;
11581158
if (whatsNext != NSyncLog::EWnDiskSynced)
11591159
return false;
11601160
}
@@ -2082,5 +2082,3 @@ NActors::IActor *ManyPutsToCorrespondingVDisks(const NActors::TActorId &notifyID
20822082
return new TManyPutsToCorrespondingVDisksActor(notifyID, conf, dataSet, hndl, inFlight);
20832083
}
20842084
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2085-
2086-

ydb/core/blobstorage/vdisk/balance/balancing_actor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ namespace NBalancing {
222222
}
223223

224224
void ScheduleJobQuant() {
225-
Y_DEBUG_ABORT_UNLESS(!AquiredReplToken);
225+
Y_VERIFY_DEBUG_S(!AquiredReplToken, Ctx->VCtx->VDiskLogPrefix);
226226
AquiredReplToken = true;
227227
Ctx->MonGroup.ReplTokenAquired()++;
228228

@@ -253,7 +253,7 @@ namespace NBalancing {
253253
}
254254

255255
if (BatchManager.IsBatchCompleted()) {
256-
Y_DEBUG_ABORT_UNLESS(AquiredReplToken);
256+
Y_VERIFY_DEBUG_S(AquiredReplToken, Ctx->VCtx->VDiskLogPrefix);
257257
AquiredReplToken = false;
258258
Send(MakeBlobStorageReplBrokerID(), new TEvReleaseReplToken);
259259

@@ -273,7 +273,7 @@ namespace NBalancing {
273273
}
274274
}
275275
} else {
276-
Y_DEBUG_ABORT_S("Part not found in TryDeletePartsFullData");
276+
Y_DEBUG_ABORT_S(Ctx->VCtx->VDiskLogPrefix << "Part not found in TryDeletePartsFullData");
277277
}
278278
}
279279
}

ydb/core/blobstorage/vdisk/balance/handoff_map.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace NKikimr {
6262
void Transform(const TKey& /*key*/, TMemRec& /*memRec*/, TDataMerger& dataMerger) {
6363
// do nothing by default, all work is done in template specialization for logo blobs
6464
Counter++;
65-
Y_DEBUG_ABORT_UNLESS(dataMerger.Empty());
65+
Y_VERIFY_DEBUG_S(dataMerger.Empty(), HullCtx->VCtx->VDiskLogPrefix);
6666
}
6767

6868
private:
@@ -85,7 +85,7 @@ namespace NKikimr {
8585
return;
8686
}
8787

88-
Y_VERIFY(Counter < DelMap.size());
88+
Y_VERIFY_S(Counter < DelMap.size(), HullCtx->VCtx->VDiskLogPrefix);
8989
TIngress ingress = memRec.GetIngress(); // ingress we are going to change
9090
ui8 vecSize = Top->GType.TotalPartCount();
9191

ydb/core/blobstorage/vdisk/common/vdisk_hugeblobctx.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,19 @@ namespace NKikimr {
6262
////////////////////////////////////////////////////////////////////////////
6363
class THugeBlobCtx {
6464
public:
65+
const TString VDiskLogPrefix;
6566
const std::shared_ptr<const THugeSlotsMap> HugeSlotsMap;
6667
const bool AddHeader;
6768

6869
// check whether this NEW blob is huge one; userPartSize doesn't include any metadata stored along with blob
6970
bool IsHugeBlob(TBlobStorageGroupType gtype, const TLogoBlobID& fullId, ui32 minHugeBlobInBytes) const;
7071

71-
THugeBlobCtx(const std::shared_ptr<const THugeSlotsMap> &hugeSlotsMap, bool addHeader)
72-
: HugeSlotsMap(hugeSlotsMap)
72+
THugeBlobCtx(
73+
const TString& logPrefix,
74+
const std::shared_ptr<const THugeSlotsMap> &hugeSlotsMap,
75+
bool addHeader)
76+
: VDiskLogPrefix(logPrefix)
77+
, HugeSlotsMap(hugeSlotsMap)
7378
, AddHeader(addHeader)
7479
{
7580
}

ydb/core/blobstorage/vdisk/defrag/defrag_quantum.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ namespace NKikimr {
118118
}
119119
}
120120

121-
TDefragQuantumFindRecords findRecords(std::move(*ChunksToDefrag), lockedChunks);
121+
TDefragQuantumFindRecords findRecords(DCtx->VCtx->VDiskLogPrefix,
122+
std::move(*ChunksToDefrag), lockedChunks);
122123
while (findRecords.Scan(NDefrag::WorkQuantum, GetSnapshot())) {
123124
Yield();
124125
}

ydb/core/blobstorage/vdisk/defrag/defrag_search.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ namespace NKikimr {
235235
auto it = PerChunkMap.find(part.ChunkIdx);
236236
if (it == PerChunkMap.end()) {
237237
const THugeSlotsMap::TSlotInfo *slotInfo = HugeBlobCtx->HugeSlotsMap->GetSlotInfo(part.Size);
238-
Y_ABORT_UNLESS(slotInfo, "size# %" PRIu32, part.Size);
238+
Y_VERIFY_S(slotInfo, HugeBlobCtx->VDiskLogPrefix << "size# " << part.Size);
239239
it = PerChunkMap.emplace(std::piecewise_construct, std::make_tuple(part.ChunkIdx),
240240
std::make_tuple(slotInfo->SlotSize, slotInfo->NumberOfSlotsInChunk)).first;
241241
}
@@ -261,7 +261,7 @@ namespace NKikimr {
261261
for (const auto *kv : chunks) {
262262
const auto& [chunkIdx, chunk] = *kv;
263263
auto it = aggrSlots.find(chunk.SlotSize);
264-
Y_ABORT_UNLESS(it != aggrSlots.end());
264+
Y_VERIFY_S(it != aggrSlots.end(), HugeBlobCtx->VDiskLogPrefix);
265265
auto& a = it->second;
266266

267267
// if we can put all current used slots into UsedChunks - 1, then defragment this chunk
@@ -368,7 +368,11 @@ namespace NKikimr {
368368
};
369369

370370
public:
371-
TDefragQuantumFindRecords(TChunksToDefrag&& chunksToDefrag, const TDefragChunks& locked) {
371+
TDefragQuantumFindRecords(
372+
const TString& logPrefix,
373+
TChunksToDefrag&& chunksToDefrag,
374+
const TDefragChunks& locked)
375+
{
372376
if (chunksToDefrag.IsShred) {
373377
LockedChunks = Chunks = std::move(chunksToDefrag.ChunksToShred);
374378
} else {
@@ -378,7 +382,7 @@ namespace NKikimr {
378382
for (const auto& chunk : locked) {
379383
LockedChunks.insert(chunk.ChunkId);
380384
}
381-
Y_ABORT_UNLESS(Chunks.size() == chunksToDefrag.Chunks.size()); // ensure there are no duplicate numbers
385+
Y_VERIFY_S(Chunks.size() == chunksToDefrag.Chunks.size(), logPrefix); // ensure there are no duplicate numbers
382386
}
383387
}
384388

@@ -433,7 +437,7 @@ namespace NKikimr {
433437
Chunks.insert(part.ChunkIdx);
434438
if (useful) {
435439
const THugeSlotsMap::TSlotInfo *slotInfo = HugeBlobCtx->HugeSlotsMap->GetSlotInfo(part.Size);
436-
Y_ABORT_UNLESS(slotInfo, "size# %" PRIu32, part.Size);
440+
Y_VERIFY_S(slotInfo, HugeBlobCtx->VDiskLogPrefix << "size# " << part.Size);
437441
++Map[slotInfo->NumberOfSlotsInChunk];
438442
}
439443
TDefragQuantumChunkFinder::Add(part, id, useful, sst);

ydb/core/blobstorage/vdisk/huge/blobstorage_hullhugeheap_ctx_ut.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace NKikimr {
3333
cfg.HugeBlobsFreeChunkReservation,
3434
logFunc);
3535

36-
return std::make_shared<THugeBlobCtx>(
36+
return std::make_shared<THugeBlobCtx>("",
3737
repairedHuge->Heap->BuildHugeSlotsMap(),
3838
true);
3939
}

ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_balance.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ namespace NKikimr {
129129
return i + 1;
130130
}
131131
}
132-
Y_ABORT("free level not found");
132+
Y_ABORT_S(HullCtx->VCtx->VDiskLogPrefix << "free level not found");
133133
return -1;
134134
}
135135

@@ -148,7 +148,7 @@ namespace NKikimr {
148148
added++;
149149
it.Next();
150150
}
151-
Y_ABORT_UNLESS(added > 0);
151+
Y_VERIFY_S(added > 0, HullCtx->VCtx->VDiskLogPrefix);
152152
}
153153

154154
// check and run full compaction if required
@@ -239,7 +239,7 @@ namespace NKikimr {
239239
ToString().data()));
240240
}
241241

242-
Y_ABORT_UNLESS(freeLevels <= totalPsl);
242+
Y_VERIFY_S(freeLevels <= totalPsl, HullCtx->VCtx->VDiskLogPrefix);
243243
double rank = 0.0;
244244
if (freeLevels == totalPsl) {
245245
rank = 0.0;
@@ -309,7 +309,7 @@ namespace NKikimr {
309309
}
310310
added++;
311311
}
312-
Y_ABORT_UNLESS(added);
312+
Y_VERIFY_S(added, HullCtx->VCtx->VDiskLogPrefix);
313313
}
314314

315315
void Compact() {
@@ -417,12 +417,12 @@ namespace NKikimr {
417417
// srcIt is equal to srcSegs.begin() and it's fine
418418
}
419419

420-
Y_ABORT_UNLESS(srcIt != srcSegs.end());
420+
Y_VERIFY_S(srcIt != srcSegs.end(), HullCtx->VCtx->VDiskLogPrefix);
421421
CompactSst(srcLevel, srcIt);
422422
}
423423

424424
void CompactSst(ui32 srcLevel, typename TSegments::const_iterator srcIt) {
425-
Y_ABORT_UNLESS(srcLevel > 0);
425+
Y_VERIFY_S(srcLevel > 0, HullCtx->VCtx->VDiskLogPrefix);
426426
// srcIt points to the sst to compact
427427
TKey firstKeyToCover = (*srcIt)->FirstKey();
428428
TKey lastKeyToCover = (*srcIt)->LastKey();
@@ -453,7 +453,7 @@ namespace NKikimr {
453453
const TSortedLevel &srcLevelData = SliceSnap.GetLevelXRef(srcLevelArrIdx);
454454
if (!srcLevelData.Empty()) {
455455
const TSegments &srcSegs = srcLevelData.Segs->Segments;
456-
Y_ABORT_UNLESS(!srcSegs.empty());
456+
Y_VERIFY_S(!srcSegs.empty(), HullCtx->VCtx->VDiskLogPrefix);
457457
for (typename TSegments::const_iterator it = srcSegs.begin(); it != srcSegs.end(); ++it) {
458458
if ((*it)->GetLastLsn() <= attrs.FullCompactionLsn) {
459459
Sublog.Log() << "TBalanceLevelX::FullCompact: srcLevel# " << srcLevel
@@ -474,7 +474,7 @@ namespace NKikimr {
474474
const TSortedLevel &srcLevelData = SliceSnap.GetLevelXRef(srcLevelArrIdx);
475475
if (!srcLevelData.Empty()) {
476476
const TSegments &srcSegs = srcLevelData.Segs->Segments;
477-
Y_ABORT_UNLESS(!srcSegs.empty());
477+
Y_VERIFY_S(!srcSegs.empty(), HullCtx->VCtx->VDiskLogPrefix);
478478
for (typename TSegments::const_iterator it = srcSegs.begin(); it != srcSegs.end(); ++it) {
479479
// for the last level we add a condition that sst is subject for compaction if
480480
// it was built before full compaction was started

ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_lazy.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ namespace NKikimr {
9292
TTask *Task;
9393

9494
double CompactionScoreBasedOnFreeLevels(ui32 freeLevels, ui32 totalLevels) {
95-
Y_ABORT_UNLESS(freeLevels <= totalLevels);
95+
Y_VERIFY_S(freeLevels <= totalLevels, HullCtx->VCtx->VDiskLogPrefix);
9696
if (freeLevels == 0) {
9797
return 1000000.0;
9898
} else {
@@ -136,15 +136,15 @@ namespace NKikimr {
136136
}
137137
}
138138

139-
Y_ABORT_UNLESS(sortedLevelsNum + 1 < layer1Levels);
139+
Y_VERIFY_S(sortedLevelsNum + 1 < layer1Levels, this->HullCtx->VCtx->VDiskLogPrefix);
140140
return sortedLevelsNum + 1;
141141
}
142142

143143
ui32 AddSSTsForCompaction() {
144144
ui32 added = 0;
145145
auto it = LevelSnap.SliceSnap.GetLevel0SstIterator();
146146
it.SeekToFirst();
147-
Y_DEBUG_ABORT_UNLESS(it.Valid());
147+
Y_VERIFY_DEBUG_S(it.Valid(), this->HullCtx->VCtx->VDiskLogPrefix);
148148
// FIXME: check why we have a limit here
149149
while (it.Valid() && added < Boundaries->Level0MaxSstsAtOnce) {
150150
// push to the task
@@ -153,7 +153,7 @@ namespace NKikimr {
153153
added++;
154154
it.Next();
155155
}
156-
Y_ABORT_UNLESS(added > 0);
156+
Y_VERIFY_S(added > 0, this->HullCtx->VCtx->VDiskLogPrefix);
157157
return added;
158158
}
159159

@@ -244,7 +244,7 @@ namespace NKikimr {
244244
// Calculate free levels
245245
ui32 FreeLevels(ui32 layer1Levels, ui32 layer2Levels) {
246246
ui32 sortedLevelsNum = LevelSnap.SliceSnap.GetLevelXNumber();
247-
Y_ABORT_UNLESS(layer1Levels + layer2Levels >= sortedLevelsNum);
247+
Y_VERIFY_S(layer1Levels + layer2Levels >= sortedLevelsNum, this->HullCtx->VCtx->VDiskLogPrefix);
248248

249249
if (sortedLevelsNum > layer1Levels) {
250250
ui32 freeLevels = 0;
@@ -340,4 +340,3 @@ namespace NKikimr {
340340

341341
} // NHullComp
342342
} // NKikimr
343-

ydb/core/blobstorage/vdisk/hulldb/fresh/fresh_data.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ namespace NKikimr {
127127

128128
template <class TKey, class TMemRec>
129129
TIntrusivePtr<TFreshSegment<TKey, TMemRec>> TFreshData<TKey, TMemRec>::FindSegmentForCompaction() {
130-
Y_ABORT_UNLESS(!CompactionInProgress());
130+
Y_VERIFY_S(!CompactionInProgress(), HullCtx->VCtx->VDiskLogPrefix);
131131
if (Dreg) {
132132
Old.Swap(Dreg);
133133
Dreg.Swap(Cur);
@@ -143,15 +143,15 @@ namespace NKikimr {
143143
template <class TKey, class TMemRec>
144144
void TFreshData<TKey, TMemRec>::CompactionSstCreated(TIntrusivePtr<TFreshSegment> &&freshSegment) {
145145
// FIXME ref count = 2?
146-
Y_ABORT_UNLESS(Old && Old.Get() == freshSegment.Get());
146+
Y_VERIFY_S(Old && Old.Get() == freshSegment.Get(), HullCtx->VCtx->VDiskLogPrefix);
147147
freshSegment.Drop();
148148
Old.Drop();
149149
WaitForCommit = true;
150150
}
151151

152152
template <class TKey, class TMemRec>
153153
void TFreshData<TKey, TMemRec>::CompactionFinished() {
154-
Y_ABORT_UNLESS(!Old && WaitForCommit);
154+
Y_VERIFY_S(!Old && WaitForCommit, HullCtx->VCtx->VDiskLogPrefix);
155155
WaitForCommit = false;
156156
OldSegLastKeepLsn = ui64(-1);
157157
}
@@ -251,4 +251,3 @@ namespace NKikimr {
251251
extern template class TFreshData<TKeyBlock, TMemRecBlock>;
252252

253253
} // NKikimr
254-

ydb/core/blobstorage/vdisk/hulldb/fresh/fresh_segment_impl.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,17 @@ namespace NKikimr {
216216
}
217217

218218
// get the last extent and put the rope to its end
219-
Y_ABORT_UNLESS(RopeExtents);
219+
Y_VERIFY_S(RopeExtents, HullCtx->VCtx->VDiskLogPrefix);
220220
auto& extent = RopeExtents.back();
221221
TRope& rope = extent[LastRopeExtentSize++];
222222
rope = std::move(blob);
223223

224224
// calculate buffer id from the rope address; the address is immutable during fresh segment lifetime, so we can
225225
// use it directly
226226
uintptr_t bufferId = reinterpret_cast<uintptr_t>(&rope);
227-
Y_ABORT_UNLESS((bufferId & 0x7) == 0);
227+
Y_VERIFY_S((bufferId & 0x7) == 0, HullCtx->VCtx->VDiskLogPrefix);
228228
bufferId >>= 3;
229-
Y_ABORT_UNLESS(bufferId < (ui64(1) << 62));
229+
Y_VERIFY_S(bufferId < (ui64(1) << 62), HullCtx->VCtx->VDiskLogPrefix);
230230
memRec.SetMemBlob(bufferId, blobSize);
231231

232232
Put(lsn, key, memRec);
@@ -235,7 +235,7 @@ namespace NKikimr {
235235
template <>
236236
inline const TRope& TFreshIndexAndData<TKeyLogoBlob, TMemRecLogoBlob>::GetLogoBlobData(const TMemPart& memPart) const {
237237
const TRope& rope = *reinterpret_cast<const TRope*>(memPart.BufferId << 3);
238-
Y_ABORT_UNLESS(rope.GetSize() == memPart.Size);
238+
Y_VERIFY_S(rope.GetSize() == memPart.Size, HullCtx->VCtx->VDiskLogPrefix);
239239
return rope;
240240
}
241241

@@ -250,14 +250,14 @@ namespace NKikimr {
250250
auto dataSize = memRec.DataSize();
251251
switch (type) {
252252
case TBlobType::MemBlob:
253-
Y_ABORT_UNLESS(dataSize);
253+
Y_VERIFY_S(dataSize, HullCtx->VCtx->VDiskLogPrefix);
254254
MemDataSize += AlignUp(dataSize, 8u);
255255
break;
256256
case TBlobType::DiskBlob:
257-
Y_ABORT_UNLESS(!memRec.HasData());
257+
Y_VERIFY_S(!memRec.HasData(), HullCtx->VCtx->VDiskLogPrefix);
258258
break;
259259
case TBlobType::HugeBlob:
260-
Y_ABORT_UNLESS(memRec.HasData());
260+
Y_VERIFY_S(memRec.HasData(), HullCtx->VCtx->VDiskLogPrefix);
261261
HugeDataSize += memRec.DataSize();
262262
break;
263263
default:
@@ -277,7 +277,7 @@ namespace NKikimr {
277277
TDiskDataExtractor extr;
278278
const TDiskPart& part = memRec.GetDiskData(&extr, nullptr)->SwearOne();
279279
if (part.Size) {
280-
Y_ABORT_UNLESS(part.ChunkIdx);
280+
Y_VERIFY_S(part.ChunkIdx, HullCtx->VCtx->VDiskLogPrefix);
281281
chunks.insert(part.ChunkIdx);
282282
}
283283
}
@@ -296,7 +296,7 @@ namespace NKikimr {
296296
TDiskDataExtractor extr;
297297
const TDiskPart& part = memRec.GetDiskData(&extr, nullptr)->SwearOne();
298298
bool inserted = hugeBlobs.insert(part).second;
299-
Y_ABORT_UNLESS(inserted);
299+
Y_VERIFY_S(inserted, HullCtx->VCtx->VDiskLogPrefix);
300300
}
301301
it.Next();
302302
}

ydb/core/blobstorage/vdisk/hulldb/generic/hulldb_bulksstmngr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ namespace NKikimr {
7373
void Handle(THullSegLoaded::TPtr& ev, const TActorContext& ctx) {
7474
ActiveActors.Erase(ev->Sender);
7575
auto i = BulkSegmentLoadInFlight.find(ev->Sender);
76-
Y_ABORT_UNLESS(i != BulkSegmentLoadInFlight.end());
76+
Y_VERIFY_S(i != BulkSegmentLoadInFlight.end(), VCtx->VDiskLogPrefix);
7777
TBulkSegmentLoadQueueItem& item = i->second;
7878

7979
// check that we have loaded correct segment :)
80-
Y_ABORT_UNLESS(ev->Get()->LevelSegment == item.Segment.Get());
80+
Y_VERIFY_S(ev->Get()->LevelSegment == item.Segment.Get(), VCtx->VDiskLogPrefix);
8181

8282
// fill in loaded segment's LSN range
8383
TLevelSegment& seg = *item.Segment;

0 commit comments

Comments
 (0)