diff options
| author | Aleksandr Dmitriev <[email protected]> | 2025-03-27 22:25:44 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-03-27 22:25:44 +0300 |
| commit | 330692da5ec434dd3fd7a0d3e6adadbabdfdcf4a (patch) | |
| tree | c4d44c88aed74072449cdd3fe75408a70232e9c7 | |
| parent | c86b965fb4a2aebc67e20c9256fc6e017cf10b87 (diff) | |
print VDisk id in VERIFYs (part two) (#16344)
68 files changed, 476 insertions, 404 deletions
diff --git a/ydb/core/blobstorage/ut_vdisk/lib/helpers.cpp b/ydb/core/blobstorage/ut_vdisk/lib/helpers.cpp index d424a1a6310..e118106cd5d 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/helpers.cpp +++ b/ydb/core/blobstorage/ut_vdisk/lib/helpers.cpp @@ -1154,7 +1154,7 @@ class TWaitForSync : public TActorBootstrapped<TWaitForSync> { ui64 syncedLsn = info.SyncStates[j].SyncedLsn; auto ri = [] { return TString("no internals"); }; NSyncLog::EReadWhatsNext whatsNext; - whatsNext = NSyncLog::WhatsNext(syncedLsn, 0, &InfoVec[j].SyncLogEssence, ri).WhatsNext; + whatsNext = NSyncLog::WhatsNext("", syncedLsn, 0, &InfoVec[j].SyncLogEssence, ri).WhatsNext; if (whatsNext != NSyncLog::EWnDiskSynced) return false; } @@ -2082,5 +2082,3 @@ NActors::IActor *ManyPutsToCorrespondingVDisks(const NActors::TActorId ¬ifyID return new TManyPutsToCorrespondingVDisksActor(notifyID, conf, dataSet, hndl, inFlight); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - diff --git a/ydb/core/blobstorage/vdisk/balance/balancing_actor.cpp b/ydb/core/blobstorage/vdisk/balance/balancing_actor.cpp index ee35f7a0793..42632b1bd02 100644 --- a/ydb/core/blobstorage/vdisk/balance/balancing_actor.cpp +++ b/ydb/core/blobstorage/vdisk/balance/balancing_actor.cpp @@ -222,7 +222,7 @@ namespace NBalancing { } void ScheduleJobQuant() { - Y_DEBUG_ABORT_UNLESS(!AquiredReplToken); + Y_VERIFY_DEBUG_S(!AquiredReplToken, Ctx->VCtx->VDiskLogPrefix); AquiredReplToken = true; Ctx->MonGroup.ReplTokenAquired()++; @@ -253,7 +253,7 @@ namespace NBalancing { } if (BatchManager.IsBatchCompleted()) { - Y_DEBUG_ABORT_UNLESS(AquiredReplToken); + Y_VERIFY_DEBUG_S(AquiredReplToken, Ctx->VCtx->VDiskLogPrefix); AquiredReplToken = false; Send(MakeBlobStorageReplBrokerID(), new TEvReleaseReplToken); @@ -273,7 +273,7 @@ namespace NBalancing { } } } else { - Y_DEBUG_ABORT_S("Part not found in TryDeletePartsFullData"); + Y_DEBUG_ABORT_S(Ctx->VCtx->VDiskLogPrefix << "Part not found in TryDeletePartsFullData"); } } } diff --git a/ydb/core/blobstorage/vdisk/balance/handoff_map.h b/ydb/core/blobstorage/vdisk/balance/handoff_map.h index eb744b1fde8..3a6c3ee1c90 100644 --- a/ydb/core/blobstorage/vdisk/balance/handoff_map.h +++ b/ydb/core/blobstorage/vdisk/balance/handoff_map.h @@ -62,7 +62,7 @@ namespace NKikimr { void Transform(const TKey& /*key*/, TMemRec& /*memRec*/, TDataMerger& dataMerger) { // do nothing by default, all work is done in template specialization for logo blobs Counter++; - Y_DEBUG_ABORT_UNLESS(dataMerger.Empty()); + Y_VERIFY_DEBUG_S(dataMerger.Empty(), HullCtx->VCtx->VDiskLogPrefix); } private: @@ -85,7 +85,7 @@ namespace NKikimr { return; } - Y_VERIFY(Counter < DelMap.size()); + Y_VERIFY_S(Counter < DelMap.size(), HullCtx->VCtx->VDiskLogPrefix); TIngress ingress = memRec.GetIngress(); // ingress we are going to change ui8 vecSize = Top->GType.TotalPartCount(); diff --git a/ydb/core/blobstorage/vdisk/common/vdisk_hugeblobctx.h b/ydb/core/blobstorage/vdisk/common/vdisk_hugeblobctx.h index 1d7e61f04e1..4d667af2ef5 100644 --- a/ydb/core/blobstorage/vdisk/common/vdisk_hugeblobctx.h +++ b/ydb/core/blobstorage/vdisk/common/vdisk_hugeblobctx.h @@ -62,14 +62,19 @@ namespace NKikimr { //////////////////////////////////////////////////////////////////////////// class THugeBlobCtx { public: + const TString VDiskLogPrefix; const std::shared_ptr<const THugeSlotsMap> HugeSlotsMap; const bool AddHeader; // check whether this NEW blob is huge one; userPartSize doesn't include any metadata stored along with blob bool IsHugeBlob(TBlobStorageGroupType gtype, const TLogoBlobID& fullId, ui32 minHugeBlobInBytes) const; - THugeBlobCtx(const std::shared_ptr<const THugeSlotsMap> &hugeSlotsMap, bool addHeader) - : HugeSlotsMap(hugeSlotsMap) + THugeBlobCtx( + const TString& logPrefix, + const std::shared_ptr<const THugeSlotsMap> &hugeSlotsMap, + bool addHeader) + : VDiskLogPrefix(logPrefix) + , HugeSlotsMap(hugeSlotsMap) , AddHeader(addHeader) { } diff --git a/ydb/core/blobstorage/vdisk/defrag/defrag_quantum.cpp b/ydb/core/blobstorage/vdisk/defrag/defrag_quantum.cpp index 549f4a89ae6..52ddff73830 100644 --- a/ydb/core/blobstorage/vdisk/defrag/defrag_quantum.cpp +++ b/ydb/core/blobstorage/vdisk/defrag/defrag_quantum.cpp @@ -118,7 +118,8 @@ namespace NKikimr { } } - TDefragQuantumFindRecords findRecords(std::move(*ChunksToDefrag), lockedChunks); + TDefragQuantumFindRecords findRecords(DCtx->VCtx->VDiskLogPrefix, + std::move(*ChunksToDefrag), lockedChunks); while (findRecords.Scan(NDefrag::WorkQuantum, GetSnapshot())) { Yield(); } diff --git a/ydb/core/blobstorage/vdisk/defrag/defrag_search.h b/ydb/core/blobstorage/vdisk/defrag/defrag_search.h index c0f57b341e4..4a600c27822 100644 --- a/ydb/core/blobstorage/vdisk/defrag/defrag_search.h +++ b/ydb/core/blobstorage/vdisk/defrag/defrag_search.h @@ -235,7 +235,7 @@ namespace NKikimr { auto it = PerChunkMap.find(part.ChunkIdx); if (it == PerChunkMap.end()) { const THugeSlotsMap::TSlotInfo *slotInfo = HugeBlobCtx->HugeSlotsMap->GetSlotInfo(part.Size); - Y_ABORT_UNLESS(slotInfo, "size# %" PRIu32, part.Size); + Y_VERIFY_S(slotInfo, HugeBlobCtx->VDiskLogPrefix << "size# " << part.Size); it = PerChunkMap.emplace(std::piecewise_construct, std::make_tuple(part.ChunkIdx), std::make_tuple(slotInfo->SlotSize, slotInfo->NumberOfSlotsInChunk)).first; } @@ -261,7 +261,7 @@ namespace NKikimr { for (const auto *kv : chunks) { const auto& [chunkIdx, chunk] = *kv; auto it = aggrSlots.find(chunk.SlotSize); - Y_ABORT_UNLESS(it != aggrSlots.end()); + Y_VERIFY_S(it != aggrSlots.end(), HugeBlobCtx->VDiskLogPrefix); auto& a = it->second; // if we can put all current used slots into UsedChunks - 1, then defragment this chunk @@ -368,7 +368,11 @@ namespace NKikimr { }; public: - TDefragQuantumFindRecords(TChunksToDefrag&& chunksToDefrag, const TDefragChunks& locked) { + TDefragQuantumFindRecords( + const TString& logPrefix, + TChunksToDefrag&& chunksToDefrag, + const TDefragChunks& locked) + { if (chunksToDefrag.IsShred) { LockedChunks = Chunks = std::move(chunksToDefrag.ChunksToShred); } else { @@ -378,7 +382,7 @@ namespace NKikimr { for (const auto& chunk : locked) { LockedChunks.insert(chunk.ChunkId); } - Y_ABORT_UNLESS(Chunks.size() == chunksToDefrag.Chunks.size()); // ensure there are no duplicate numbers + Y_VERIFY_S(Chunks.size() == chunksToDefrag.Chunks.size(), logPrefix); // ensure there are no duplicate numbers } } @@ -433,7 +437,7 @@ namespace NKikimr { Chunks.insert(part.ChunkIdx); if (useful) { const THugeSlotsMap::TSlotInfo *slotInfo = HugeBlobCtx->HugeSlotsMap->GetSlotInfo(part.Size); - Y_ABORT_UNLESS(slotInfo, "size# %" PRIu32, part.Size); + Y_VERIFY_S(slotInfo, HugeBlobCtx->VDiskLogPrefix << "size# " << part.Size); ++Map[slotInfo->NumberOfSlotsInChunk]; } TDefragQuantumChunkFinder::Add(part, id, useful, sst); diff --git a/ydb/core/blobstorage/vdisk/huge/blobstorage_hullhugeheap_ctx_ut.cpp b/ydb/core/blobstorage/vdisk/huge/blobstorage_hullhugeheap_ctx_ut.cpp index 865bf385130..b06718ad9e8 100644 --- a/ydb/core/blobstorage/vdisk/huge/blobstorage_hullhugeheap_ctx_ut.cpp +++ b/ydb/core/blobstorage/vdisk/huge/blobstorage_hullhugeheap_ctx_ut.cpp @@ -33,7 +33,7 @@ namespace NKikimr { cfg.HugeBlobsFreeChunkReservation, logFunc); - return std::make_shared<THugeBlobCtx>( + return std::make_shared<THugeBlobCtx>("", repairedHuge->Heap->BuildHugeSlotsMap(), true); } diff --git a/ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_balance.h b/ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_balance.h index 506b938a571..103be6be12a 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_balance.h +++ b/ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_balance.h @@ -129,7 +129,7 @@ namespace NKikimr { return i + 1; } } - Y_ABORT("free level not found"); + Y_ABORT_S(HullCtx->VCtx->VDiskLogPrefix << "free level not found"); return -1; } @@ -148,7 +148,7 @@ namespace NKikimr { added++; it.Next(); } - Y_ABORT_UNLESS(added > 0); + Y_VERIFY_S(added > 0, HullCtx->VCtx->VDiskLogPrefix); } // check and run full compaction if required @@ -239,7 +239,7 @@ namespace NKikimr { ToString().data())); } - Y_ABORT_UNLESS(freeLevels <= totalPsl); + Y_VERIFY_S(freeLevels <= totalPsl, HullCtx->VCtx->VDiskLogPrefix); double rank = 0.0; if (freeLevels == totalPsl) { rank = 0.0; @@ -309,7 +309,7 @@ namespace NKikimr { } added++; } - Y_ABORT_UNLESS(added); + Y_VERIFY_S(added, HullCtx->VCtx->VDiskLogPrefix); } void Compact() { @@ -417,12 +417,12 @@ namespace NKikimr { // srcIt is equal to srcSegs.begin() and it's fine } - Y_ABORT_UNLESS(srcIt != srcSegs.end()); + Y_VERIFY_S(srcIt != srcSegs.end(), HullCtx->VCtx->VDiskLogPrefix); CompactSst(srcLevel, srcIt); } void CompactSst(ui32 srcLevel, typename TSegments::const_iterator srcIt) { - Y_ABORT_UNLESS(srcLevel > 0); + Y_VERIFY_S(srcLevel > 0, HullCtx->VCtx->VDiskLogPrefix); // srcIt points to the sst to compact TKey firstKeyToCover = (*srcIt)->FirstKey(); TKey lastKeyToCover = (*srcIt)->LastKey(); @@ -453,7 +453,7 @@ namespace NKikimr { const TSortedLevel &srcLevelData = SliceSnap.GetLevelXRef(srcLevelArrIdx); if (!srcLevelData.Empty()) { const TSegments &srcSegs = srcLevelData.Segs->Segments; - Y_ABORT_UNLESS(!srcSegs.empty()); + Y_VERIFY_S(!srcSegs.empty(), HullCtx->VCtx->VDiskLogPrefix); for (typename TSegments::const_iterator it = srcSegs.begin(); it != srcSegs.end(); ++it) { if ((*it)->GetLastLsn() <= attrs.FullCompactionLsn) { Sublog.Log() << "TBalanceLevelX::FullCompact: srcLevel# " << srcLevel @@ -474,7 +474,7 @@ namespace NKikimr { const TSortedLevel &srcLevelData = SliceSnap.GetLevelXRef(srcLevelArrIdx); if (!srcLevelData.Empty()) { const TSegments &srcSegs = srcLevelData.Segs->Segments; - Y_ABORT_UNLESS(!srcSegs.empty()); + Y_VERIFY_S(!srcSegs.empty(), HullCtx->VCtx->VDiskLogPrefix); for (typename TSegments::const_iterator it = srcSegs.begin(); it != srcSegs.end(); ++it) { // for the last level we add a condition that sst is subject for compaction if // it was built before full compaction was started diff --git a/ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_lazy.h b/ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_lazy.h index 3305427725a..64d626127d3 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_lazy.h +++ b/ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_lazy.h @@ -92,7 +92,7 @@ namespace NKikimr { TTask *Task; double CompactionScoreBasedOnFreeLevels(ui32 freeLevels, ui32 totalLevels) { - Y_ABORT_UNLESS(freeLevels <= totalLevels); + Y_VERIFY_S(freeLevels <= totalLevels, HullCtx->VCtx->VDiskLogPrefix); if (freeLevels == 0) { return 1000000.0; } else { @@ -136,7 +136,7 @@ namespace NKikimr { } } - Y_ABORT_UNLESS(sortedLevelsNum + 1 < layer1Levels); + Y_VERIFY_S(sortedLevelsNum + 1 < layer1Levels, this->HullCtx->VCtx->VDiskLogPrefix); return sortedLevelsNum + 1; } @@ -144,7 +144,7 @@ namespace NKikimr { ui32 added = 0; auto it = LevelSnap.SliceSnap.GetLevel0SstIterator(); it.SeekToFirst(); - Y_DEBUG_ABORT_UNLESS(it.Valid()); + Y_VERIFY_DEBUG_S(it.Valid(), this->HullCtx->VCtx->VDiskLogPrefix); // FIXME: check why we have a limit here while (it.Valid() && added < Boundaries->Level0MaxSstsAtOnce) { // push to the task @@ -153,7 +153,7 @@ namespace NKikimr { added++; it.Next(); } - Y_ABORT_UNLESS(added > 0); + Y_VERIFY_S(added > 0, this->HullCtx->VCtx->VDiskLogPrefix); return added; } @@ -244,7 +244,7 @@ namespace NKikimr { // Calculate free levels ui32 FreeLevels(ui32 layer1Levels, ui32 layer2Levels) { ui32 sortedLevelsNum = LevelSnap.SliceSnap.GetLevelXNumber(); - Y_ABORT_UNLESS(layer1Levels + layer2Levels >= sortedLevelsNum); + Y_VERIFY_S(layer1Levels + layer2Levels >= sortedLevelsNum, this->HullCtx->VCtx->VDiskLogPrefix); if (sortedLevelsNum > layer1Levels) { ui32 freeLevels = 0; @@ -340,4 +340,3 @@ namespace NKikimr { } // NHullComp } // NKikimr - diff --git a/ydb/core/blobstorage/vdisk/hulldb/fresh/fresh_data.h b/ydb/core/blobstorage/vdisk/hulldb/fresh/fresh_data.h index af608309435..4236070c14d 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/fresh/fresh_data.h +++ b/ydb/core/blobstorage/vdisk/hulldb/fresh/fresh_data.h @@ -127,7 +127,7 @@ namespace NKikimr { template <class TKey, class TMemRec> TIntrusivePtr<TFreshSegment<TKey, TMemRec>> TFreshData<TKey, TMemRec>::FindSegmentForCompaction() { - Y_ABORT_UNLESS(!CompactionInProgress()); + Y_VERIFY_S(!CompactionInProgress(), HullCtx->VCtx->VDiskLogPrefix); if (Dreg) { Old.Swap(Dreg); Dreg.Swap(Cur); @@ -143,7 +143,7 @@ namespace NKikimr { template <class TKey, class TMemRec> void TFreshData<TKey, TMemRec>::CompactionSstCreated(TIntrusivePtr<TFreshSegment> &&freshSegment) { // FIXME ref count = 2? - Y_ABORT_UNLESS(Old && Old.Get() == freshSegment.Get()); + Y_VERIFY_S(Old && Old.Get() == freshSegment.Get(), HullCtx->VCtx->VDiskLogPrefix); freshSegment.Drop(); Old.Drop(); WaitForCommit = true; @@ -151,7 +151,7 @@ namespace NKikimr { template <class TKey, class TMemRec> void TFreshData<TKey, TMemRec>::CompactionFinished() { - Y_ABORT_UNLESS(!Old && WaitForCommit); + Y_VERIFY_S(!Old && WaitForCommit, HullCtx->VCtx->VDiskLogPrefix); WaitForCommit = false; OldSegLastKeepLsn = ui64(-1); } @@ -251,4 +251,3 @@ namespace NKikimr { extern template class TFreshData<TKeyBlock, TMemRecBlock>; } // NKikimr - diff --git a/ydb/core/blobstorage/vdisk/hulldb/fresh/fresh_segment_impl.h b/ydb/core/blobstorage/vdisk/hulldb/fresh/fresh_segment_impl.h index 21d6170c595..8dc9f0160c1 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/fresh/fresh_segment_impl.h +++ b/ydb/core/blobstorage/vdisk/hulldb/fresh/fresh_segment_impl.h @@ -216,7 +216,7 @@ namespace NKikimr { } // get the last extent and put the rope to its end - Y_ABORT_UNLESS(RopeExtents); + Y_VERIFY_S(RopeExtents, HullCtx->VCtx->VDiskLogPrefix); auto& extent = RopeExtents.back(); TRope& rope = extent[LastRopeExtentSize++]; rope = std::move(blob); @@ -224,9 +224,9 @@ namespace NKikimr { // calculate buffer id from the rope address; the address is immutable during fresh segment lifetime, so we can // use it directly uintptr_t bufferId = reinterpret_cast<uintptr_t>(&rope); - Y_ABORT_UNLESS((bufferId & 0x7) == 0); + Y_VERIFY_S((bufferId & 0x7) == 0, HullCtx->VCtx->VDiskLogPrefix); bufferId >>= 3; - Y_ABORT_UNLESS(bufferId < (ui64(1) << 62)); + Y_VERIFY_S(bufferId < (ui64(1) << 62), HullCtx->VCtx->VDiskLogPrefix); memRec.SetMemBlob(bufferId, blobSize); Put(lsn, key, memRec); @@ -235,7 +235,7 @@ namespace NKikimr { template <> inline const TRope& TFreshIndexAndData<TKeyLogoBlob, TMemRecLogoBlob>::GetLogoBlobData(const TMemPart& memPart) const { const TRope& rope = *reinterpret_cast<const TRope*>(memPart.BufferId << 3); - Y_ABORT_UNLESS(rope.GetSize() == memPart.Size); + Y_VERIFY_S(rope.GetSize() == memPart.Size, HullCtx->VCtx->VDiskLogPrefix); return rope; } @@ -250,14 +250,14 @@ namespace NKikimr { auto dataSize = memRec.DataSize(); switch (type) { case TBlobType::MemBlob: - Y_ABORT_UNLESS(dataSize); + Y_VERIFY_S(dataSize, HullCtx->VCtx->VDiskLogPrefix); MemDataSize += AlignUp(dataSize, 8u); break; case TBlobType::DiskBlob: - Y_ABORT_UNLESS(!memRec.HasData()); + Y_VERIFY_S(!memRec.HasData(), HullCtx->VCtx->VDiskLogPrefix); break; case TBlobType::HugeBlob: - Y_ABORT_UNLESS(memRec.HasData()); + Y_VERIFY_S(memRec.HasData(), HullCtx->VCtx->VDiskLogPrefix); HugeDataSize += memRec.DataSize(); break; default: @@ -277,7 +277,7 @@ namespace NKikimr { TDiskDataExtractor extr; const TDiskPart& part = memRec.GetDiskData(&extr, nullptr)->SwearOne(); if (part.Size) { - Y_ABORT_UNLESS(part.ChunkIdx); + Y_VERIFY_S(part.ChunkIdx, HullCtx->VCtx->VDiskLogPrefix); chunks.insert(part.ChunkIdx); } } @@ -296,7 +296,7 @@ namespace NKikimr { TDiskDataExtractor extr; const TDiskPart& part = memRec.GetDiskData(&extr, nullptr)->SwearOne(); bool inserted = hugeBlobs.insert(part).second; - Y_ABORT_UNLESS(inserted); + Y_VERIFY_S(inserted, HullCtx->VCtx->VDiskLogPrefix); } it.Next(); } diff --git a/ydb/core/blobstorage/vdisk/hulldb/generic/hulldb_bulksstmngr.cpp b/ydb/core/blobstorage/vdisk/hulldb/generic/hulldb_bulksstmngr.cpp index 331df599fc4..2b8c1f16e31 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/generic/hulldb_bulksstmngr.cpp +++ b/ydb/core/blobstorage/vdisk/hulldb/generic/hulldb_bulksstmngr.cpp @@ -73,11 +73,11 @@ namespace NKikimr { void Handle(THullSegLoaded::TPtr& ev, const TActorContext& ctx) { ActiveActors.Erase(ev->Sender); auto i = BulkSegmentLoadInFlight.find(ev->Sender); - Y_ABORT_UNLESS(i != BulkSegmentLoadInFlight.end()); + Y_VERIFY_S(i != BulkSegmentLoadInFlight.end(), VCtx->VDiskLogPrefix); TBulkSegmentLoadQueueItem& item = i->second; // check that we have loaded correct segment :) - Y_ABORT_UNLESS(ev->Get()->LevelSegment == item.Segment.Get()); + Y_VERIFY_S(ev->Get()->LevelSegment == item.Segment.Get(), VCtx->VDiskLogPrefix); // fill in loaded segment's LSN range TLevelSegment& seg = *item.Segment; diff --git a/ydb/core/blobstorage/vdisk/hulldb/recovery/hulldb_recovery.cpp b/ydb/core/blobstorage/vdisk/hulldb/recovery/hulldb_recovery.cpp index d2eb83b7510..7d376b79cd2 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/recovery/hulldb_recovery.cpp +++ b/ydb/core/blobstorage/vdisk/hulldb/recovery/hulldb_recovery.cpp @@ -26,7 +26,7 @@ namespace NKikimr { ui64 lsn, EOpMode mode) { - Y_ABORT_UNLESS(!id.PartId()); + Y_VERIFY_S(!id.PartId(), HullDs->HullCtx->VCtx->VDiskLogPrefix); LOG_DEBUG(ctx, NKikimrServices::BS_HULLRECS, VDISKP(HullDs->HullCtx->VCtx->VDiskLogPrefix, "Db# LogoBlobs action# add_data mode# %s id# %s lsn# %" PRIu64 " bufSize# %" PRIu32, @@ -48,7 +48,7 @@ namespace NKikimr { ui64 lsn, EOpMode mode) { - Y_ABORT_UNLESS(!id.PartId()); + Y_VERIFY_S(!id.PartId(), HullDs->HullCtx->VCtx->VDiskLogPrefix); LOG_DEBUG(ctx, NKikimrServices::BS_HULLRECS, VDISKP(HullDs->HullCtx->VCtx->VDiskLogPrefix, "Db# LogoBlobs action# add_idx mode# %s id# %s lsn# %" PRIu64, @@ -65,7 +65,7 @@ namespace NKikimr { ui64 lsn, EOpMode mode) { - Y_ABORT_UNLESS(!id.PartId()); + Y_VERIFY_S(!id.PartId(), HullDs->HullCtx->VCtx->VDiskLogPrefix); LOG_DEBUG(ctx, NKikimrServices::BS_HULLRECS, VDISKP(HullDs->HullCtx->VCtx->VDiskLogPrefix, "Db# LogoBlobs action# add_data_huge mode# %s id# %s lsn# %" PRIu64, @@ -149,7 +149,7 @@ namespace NKikimr { UpdateBlocksCache(it.GetCurKey().TabletId, it.GetMemRec().BlockedGeneration, 0, lsnIt++, mode); it.Next(); } - Y_ABORT_UNLESS(seg.Last + 1 == lsnIt); + Y_VERIFY_S(seg.Last + 1 == lsnIt, HullDs->HullCtx->VCtx->VDiskLogPrefix); } ///////////////// GC //////////////////////////////////////////////////// @@ -193,7 +193,7 @@ namespace NKikimr { it.Seek(key); // ensure that everything is correct - Y_ABORT_UNLESS(it.Valid() && it.GetCurKey() == key); + Y_VERIFY_S(it.Valid() && it.GetCurKey() == key, HullDs->HullCtx->VCtx->VDiskLogPrefix); // put it into merger TIndexRecordMerger<TKeyBarrier, TMemRecBarrier> merger(HullDs->HullCtx->VCtx->Top->GType); @@ -227,13 +227,13 @@ namespace NKikimr { for (ui32 i = 0; i < record.KeepSize(); ++i) { TLogoBlobID id = LogoBlobIDFromLogoBlobID(record.GetKeep(i)); - Y_ABORT_UNLESS(id.PartId() == 0); + Y_VERIFY_S(id.PartId() == 0, HullDs->HullCtx->VCtx->VDiskLogPrefix); vec.push_back(id); } for (ui32 i = 0; i < record.DoNotKeepSize(); ++i) { TLogoBlobID id = LogoBlobIDFromLogoBlobID(record.GetDoNotKeep(i)); - Y_ABORT_UNLESS(id.PartId() == 0); + Y_VERIFY_S(id.PartId() == 0, HullDs->HullCtx->VCtx->VDiskLogPrefix); vec.push_back(id); } @@ -323,7 +323,7 @@ namespace NKikimr { { if (mode == RECOVERY) { // we check at RECOVERY mode only, because incoming message is being checked early - Y_ABORT_UNLESS(CheckGC(ctx, record)); // TODO: CheckGC consume resources just to be sure incoming message is good + Y_VERIFY_S(CheckGC(ctx, record), HullDs->HullCtx->VCtx->VDiskLogPrefix); // TODO: CheckGC consume resources just to be sure incoming message is good } // set up keep bits @@ -331,7 +331,7 @@ namespace NKikimr { ingressKeep.SetKeep(TIngress::IngressMode(HullDs->HullCtx->VCtx->Top->GType), CollectModeKeep); for (ui32 i = 0; i < record.KeepSize(); ++i) { TLogoBlobID id = LogoBlobIDFromLogoBlobID(record.GetKeep(i)); - Y_ABORT_UNLESS(id.PartId() == 0); + Y_VERIFY_S(id.PartId() == 0, HullDs->HullCtx->VCtx->VDiskLogPrefix); // Put only those logoblobs that belong to this vdisk if (Filter.Check(id)) { TKeyLogoBlob key(id); @@ -349,7 +349,7 @@ namespace NKikimr { ingressDontKeep.SetKeep(TIngress::IngressMode(HullDs->HullCtx->VCtx->Top->GType), CollectModeDoNotKeep); for (ui32 i = 0; i < record.DoNotKeepSize(); ++i) { TLogoBlobID id = LogoBlobIDFromLogoBlobID(record.GetDoNotKeep(i)); - Y_ABORT_UNLESS(id.PartId() == 0); + Y_VERIFY_S(id.PartId() == 0, HullDs->HullCtx->VCtx->VDiskLogPrefix); if (Filter.Check(id)) { TKeyLogoBlob key(id); TMemRecLogoBlob memRec(ingressDontKeep); @@ -371,7 +371,8 @@ namespace NKikimr { LOG_DEBUG_S(ctx, NKikimrServices::BS_HULLRECS, HullDs->HullCtx->VCtx->VDiskLogPrefix << "Db# LogoBlobs action# sync_data_batch mode# " << OpMode2Str(mode) << " lsn# " << seg); - Y_ABORT_UNLESS(logoBlobs && (seg.Last - seg.First + 1 == logoBlobs->GetSize())); + Y_VERIFY_S(logoBlobs && (seg.Last - seg.First + 1 == logoBlobs->GetSize()), + HullDs->HullCtx->VCtx->VDiskLogPrefix); HullDs->LogoBlobs->PutToFresh(std::move(logoBlobs), seg.First, seg.Last); } @@ -384,7 +385,8 @@ namespace NKikimr { LOG_DEBUG_S(ctx, NKikimrServices::BS_HULLRECS, HullDs->HullCtx->VCtx->VDiskLogPrefix << "Db# Blocks action# sync_data_batch mode# " << OpMode2Str(mode) << " lsn# " << seg); - Y_ABORT_UNLESS(blocks && (seg.Last - seg.First + 1 == blocks->GetSize())); + Y_VERIFY_S(blocks && (seg.Last - seg.First + 1 == blocks->GetSize()), + HullDs->HullCtx->VCtx->VDiskLogPrefix); UpdateBlocksCache(blocks, seg, mode); HullDs->Blocks->PutToFresh(std::move(blocks), seg.First, seg.Last); } @@ -398,7 +400,8 @@ namespace NKikimr { LOG_DEBUG_S(ctx, NKikimrServices::BS_HULLRECS, HullDs->HullCtx->VCtx->VDiskLogPrefix << "Db# Barriers action# sync_data_batch mode# " << OpMode2Str(mode) << " lsn# " << seg); - Y_ABORT_UNLESS(barriers && (seg.Last - seg.First + 1 == barriers->GetSize())); + Y_VERIFY_S(barriers && (seg.Last - seg.First + 1 == barriers->GetSize()), + HullDs->HullCtx->VCtx->VDiskLogPrefix); if (HullDs->HullCtx->BarrierValidation) { UpdateBarrierCache(barriers); } diff --git a/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_logreplay.cpp b/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_logreplay.cpp index 1ffd89f504b..1fa6fb6bcdb 100644 --- a/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_logreplay.cpp +++ b/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_logreplay.cpp @@ -110,7 +110,7 @@ namespace NKikimr { Finish(ctx, ReadLogCtx->Msg->Status, "Recovery log read failed"); return; } else { - Y_ABORT_UNLESS(ReadLogCtx->Msg->Position == PrevLogPos); + Y_VERIFY_S(ReadLogCtx->Msg->Position == PrevLogPos, LocRecCtx->VCtx->VDiskLogPrefix); // update RecovInfo LocRecCtx->RecovInfo->HandleReadLogResult(ReadLogCtx->Msg->Results); // run dispatcher @@ -808,9 +808,10 @@ namespace NKikimr { "DISPATCH RECORD: %s", record.ToString().data())); // Remember last seen lsn - Y_ABORT_UNLESS(RecoveredLsn < record.Lsn, - "%s RecoveredLsn# %" PRIu64 " recordLsn# %" PRIu64 " signature# %" PRIu64, - LocRecCtx->VCtx->VDiskLogPrefix.data(), RecoveredLsn, record.Lsn, ui64(record.Signature)); + Y_VERIFY_S(RecoveredLsn < record.Lsn, LocRecCtx->VCtx->VDiskLogPrefix + << "RecoveredLsn# " << RecoveredLsn + << " recordLsn# " << record.Lsn + << " signature# " << ui64(record.Signature)); RecoveredLsn = record.Lsn; switch (record.Signature) { @@ -948,4 +949,3 @@ namespace NKikimr { } } // NKikimr - diff --git a/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_public.cpp b/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_public.cpp index 10650b75767..31bea3d95e0 100644 --- a/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_public.cpp +++ b/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_public.cpp @@ -124,7 +124,7 @@ namespace NKikimr { void SignalSuccessAndDie(const TActorContext &ctx) { // recover Lsn and ConfirmedLsn: // Db->Lsn now contains last seen lsn - Y_DEBUG_ABORT_UNLESS(LocRecCtx->HullDbRecovery->GetHullDs()); + Y_VERIFY_DEBUG_S(LocRecCtx->HullDbRecovery->GetHullDs(), LocRecCtx->VCtx->VDiskLogPrefix); LocRecCtx->RecovInfo->SuccessfulRecovery = true; LocRecCtx->RecovInfo->CheckConsistency(); @@ -162,7 +162,8 @@ namespace NKikimr { for (iter.SeekToFirst(); iter.Valid(); iter.Next()) { TLogoBlobsSstPtr segment = iter.Get().SstPtr; if (segment->Info.IsCreatedByRepl()) { - Y_ABORT_UNLESS(segment->Info.FirstLsn == 0 && segment->Info.LastLsn == 0); + Y_VERIFY_S(segment->Info.FirstLsn == 0 && segment->Info.LastLsn == 0, + LocRecCtx->VCtx->VDiskLogPrefix); const auto& item = logoBlobs->CurSlice->BulkFormedSegments.FindIntactBulkFormedSst(segment->GetEntryPoint()); segment->Info.FirstLsn = item.FirstBlobLsn; segment->Info.LastLsn = item.LastBlobLsn; @@ -379,7 +380,7 @@ namespace NKikimr { "Db PDiskGuid is not equal to PDiskGuid stored in SyncLog entry point"); return false; } - LocRecCtx->SyncLogRecovery = new NSyncLog::TSyncLogRecovery(std::move(repaired)); + LocRecCtx->SyncLogRecovery = new NSyncLog::TSyncLogRecovery(LocRecCtx->VCtx->VDiskLogPrefix, std::move(repaired)); SyncLogInitialized = true; VDiskIncarnationGuid = LocRecCtx->SyncLogRecovery->GetSyncLogHeader().VDiskIncarnationGuid; return true; @@ -423,7 +424,8 @@ namespace NKikimr { bool InitHugeBlobKeeper(const TStartingPoints &startingPoints, const TActorContext &ctx) { Y_UNUSED(ctx); const ui32 blocksInChunk = LocRecCtx->PDiskCtx->Dsk->ChunkSize / LocRecCtx->PDiskCtx->Dsk->AppendBlockSize; - Y_ABORT_UNLESS(LocRecCtx->PDiskCtx->Dsk->AppendBlockSize * blocksInChunk == LocRecCtx->PDiskCtx->Dsk->ChunkSize); + Y_VERIFY_S(LocRecCtx->PDiskCtx->Dsk->AppendBlockSize * blocksInChunk == LocRecCtx->PDiskCtx->Dsk->ChunkSize, + LocRecCtx->VCtx->VDiskLogPrefix); auto logFunc = [&] (const TString &msg) { LOG_DEBUG(ctx, BS_HULLHUGE, msg); @@ -466,6 +468,7 @@ namespace NKikimr { lsn, entryPoint, logFunc); } HugeBlobCtx = std::make_shared<THugeBlobCtx>( + LocRecCtx->VCtx->VDiskLogPrefix, LocRecCtx->RepairedHuge->Heap->BuildHugeSlotsMap(), Config->AddHeader); HugeKeeperInitialized = true; @@ -500,7 +503,7 @@ namespace NKikimr { "INIT: TEvYardInit OK PDiskId# %s", LocRecCtx->PDiskCtx->PDiskIdString.data())); // create context for HullDs - Y_ABORT_UNLESS(LocRecCtx->VCtx && LocRecCtx->VCtx->Top); + Y_VERIFY_S(LocRecCtx->VCtx && LocRecCtx->VCtx->Top, LocRecCtx->VCtx->VDiskLogPrefix); auto hullCtx = MakeIntrusive<THullCtx>( LocRecCtx->VCtx, ui32(LocRecCtx->PDiskCtx->Dsk->ChunkSize), @@ -725,4 +728,3 @@ namespace NKikimr { } } // NKikimr - diff --git a/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_readbulksst.cpp b/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_readbulksst.cpp index 4b07d702a60..d61fbb7ce94 100644 --- a/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_readbulksst.cpp +++ b/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_readbulksst.cpp @@ -45,7 +45,7 @@ namespace NKikimr { } void Finish(const TActorContext &ctx) { - Y_ABORT_UNLESS(Index == Addition.size()); + Y_VERIFY_S(Index == Addition.size(), VCtx->VDiskLogPrefix); auto msg = std::make_unique<TEvBulkSstEssenceLoaded>(RecoveryLogRecLsn); msg->Essence.Replace(std::move(Addition)); ctx.Send(Recipient, msg.release()); @@ -90,7 +90,7 @@ namespace NKikimr { { for (const auto &x : proto) { auto sst = MakeIntrusive<TLevelSegment>(VCtx, x.GetSst()); - Y_ABORT_UNLESS(!sst->GetEntryPoint().Empty()); + Y_VERIFY_S(!sst->GetEntryPoint().Empty(), VCtx->VDiskLogPrefix); const ui32 recsNum = x.GetRecsNum(); Addition.emplace_back(std::move(sst), recsNum); } @@ -151,13 +151,13 @@ namespace NKikimr { ActiveActors.Insert(aid, __FILE__, __LINE__, ctx, NKikimrServices::BLOBSTORAGE); ++RunActors; } - Y_ABORT_UNLESS(RunActors); + Y_VERIFY_S(RunActors, VCtx->VDiskLogPrefix); TThis::Become(&TThis::StateFunc); } void Handle(TEvBulkSstEssenceLoaded::TPtr &ev, const TActorContext &ctx) { ActiveActors.Erase(ev->Sender); - Y_ABORT_UNLESS(RecoveryLogRecLsn == ev->Get()->RecoveryLogRecLsn); + Y_VERIFY_S(RecoveryLogRecLsn == ev->Get()->RecoveryLogRecLsn, VCtx->VDiskLogPrefix); Essence.DestructiveMerge(std::move(ev->Get()->Essence)); --RunActors; if (RunActors == 0) { diff --git a/ydb/core/blobstorage/vdisk/query/query_base.h b/ydb/core/blobstorage/vdisk/query/query_base.h index d21c6ece3e9..a2c27885a12 100644 --- a/ydb/core/blobstorage/vdisk/query/query_base.h +++ b/ydb/core/blobstorage/vdisk/query/query_base.h @@ -50,12 +50,12 @@ namespace NKikimr { if (Span) { Span.Attribute("event", TEvBlobStorage::TEvVGet::ToString(BatcherCtx->OrigEv->Get()->Record)); } - Y_DEBUG_ABORT_UNLESS(Result); + Y_VERIFY_DEBUG_S(Result, QueryCtx->HullCtx->VCtx->VDiskLogPrefix); } ui8 PDiskPriority() const { ui8 priority = 0; - Y_ABORT_UNLESS(Record.HasHandleClass()); + Y_VERIFY_S(Record.HasHandleClass(), QueryCtx->HullCtx->VCtx->VDiskLogPrefix); switch (Record.GetHandleClass()) { case NKikimrBlobStorage::EGetHandleClass::AsyncRead: priority = NPriRead::HullOnlineOther; diff --git a/ydb/core/blobstorage/vdisk/query/query_extr.cpp b/ydb/core/blobstorage/vdisk/query/query_extr.cpp index d93d53a0e95..4290ce3fc07 100644 --- a/ydb/core/blobstorage/vdisk/query/query_extr.cpp +++ b/ydb/core/blobstorage/vdisk/query/query_extr.cpp @@ -107,7 +107,8 @@ namespace NKikimr { void MainCycle(const TActorContext &ctx) { TQuery *query = nullptr; while ((query = FetchNextQuery()) && !ResultSize.IsOverflow()) { - Y_ABORT_UNLESS(query->PartId == 0); // only full blobs (w/o specifying a part) are allowed + // only full blobs (w/o specifying a part) are allowed + Y_VERIFY_S(query->PartId == 0, QueryCtx->HullCtx->VCtx->VDiskLogPrefix); const ui64 *cookiePtr = query->HasCookie ? &query->CookieVal : nullptr; ResultSize.AddLogoBlobIndex(); if (!BlobInIndex) { @@ -213,19 +214,19 @@ namespace NKikimr { NReadBatcher::TDataItem::EType t = it->GetType(); switch (t) { case NReadBatcher::TDataItem::ET_CLEAN: - Y_ABORT("Impossible case"); + Y_ABORT_S(QueryCtx->HullCtx->VCtx->VDiskLogPrefix << "Impossible case"); case NReadBatcher::TDataItem::ET_NODATA: // put NODATA Result->AddResult(NKikimrProto::NODATA, it->Id, cookiePtr, pingr); break; case NReadBatcher::TDataItem::ET_ERROR: // put ERROR - Y_ABORT_UNLESS(it->Id.PartId() > 0); + Y_VERIFY_S(it->Id.PartId() > 0, QueryCtx->HullCtx->VCtx->VDiskLogPrefix); Result->AddResult(NKikimrProto::ERROR, it->Id, cookiePtr, pingr); break; case NReadBatcher::TDataItem::ET_NOT_YET: // put NOT_YET - Y_ABORT_UNLESS(it->Id.PartId() > 0); + Y_VERIFY_S(it->Id.PartId() > 0, QueryCtx->HullCtx->VCtx->VDiskLogPrefix); Result->AddResult(NKikimrProto::NOT_YET, it->Id, query->Shift, static_cast<ui32>(query->Size), cookiePtr, pingr, keep, doNotKeep); break; @@ -233,7 +234,7 @@ namespace NKikimr { case NReadBatcher::TDataItem::ET_SETMEM: { // GOOD - Y_ABORT_UNLESS(it->Id.PartId() > 0); + Y_VERIFY_S(it->Id.PartId() > 0, QueryCtx->HullCtx->VCtx->VDiskLogPrefix); struct TProcessor { std::unique_ptr<TEvBlobStorage::TEvVGetResult>& Result; TLogoBlobID Id; @@ -294,7 +295,7 @@ namespace NKikimr { if (res.GetStatus() == NKikimrProto::CORRUPTED) { const TLogoBlobID& id = LogoBlobIDFromLogoBlobID(res.GetBlobID()); const auto it = map.find(id.FullID()); - Y_ABORT_UNLESS(it != map.end()); + Y_VERIFY_S(it != map.end(), QueryCtx->HullCtx->VCtx->VDiskLogPrefix); if (it->second->Status == NKikimrProto::OK) { const TRope& buffer = it->second->GetPartData(id); const ui32 shift = res.GetShift(); diff --git a/ydb/core/blobstorage/vdisk/query/query_public.cpp b/ydb/core/blobstorage/vdisk/query/query_public.cpp index 149bbc3709c..f98136ee2ec 100644 --- a/ydb/core/blobstorage/vdisk/query/query_public.cpp +++ b/ydb/core/blobstorage/vdisk/query/query_public.cpp @@ -58,7 +58,7 @@ namespace NKikimr { { TLogoBlobsSnapshot::TIndexForwardIterator it(hullCtx, snapshot); for (const auto& item : extremeQueries) { - Y_ABORT_UNLESS(item.HasId()); + Y_VERIFY_S(item.HasId(), hullCtx->VCtx->VDiskLogPrefix); const TLogoBlobID& id = LogoBlobIDFromLogoBlobID(item.GetId()); const TLogoBlobID& full = id.FullID(); @@ -103,7 +103,7 @@ namespace NKikimr { return CreateLevelIndexExtremeQueryActor(queryCtx, parentId, std::move(fullSnap.LogoBlobsSnap), std::move(fullSnap.BarriersSnap), ev, std::move(result), replSchedulerId); } else { - Y_ABORT("Impossible case"); + Y_ABORT_S(queryCtx->HullCtx->VCtx->VDiskLogPrefix << "Impossible case"); } } diff --git a/ydb/core/blobstorage/vdisk/query/query_range.cpp b/ydb/core/blobstorage/vdisk/query/query_range.cpp index 6408947e95e..ad3d5b03b1d 100644 --- a/ydb/core/blobstorage/vdisk/query/query_range.cpp +++ b/ydb/core/blobstorage/vdisk/query/query_range.cpp @@ -129,7 +129,8 @@ namespace NKikimr { const TIngress &ingress = merger.GetMemRec().GetIngress(); ui64 ingr = ingress.Raw(); ui64 *pingr = (ShowInternals ? &ingr : nullptr); - Y_ABORT_UNLESS(logoBlobId.PartId() == 0); // Index-only response must contain a single record for the blob + // Index-only response must contain a single record for the blob + Y_VERIFY_S(logoBlobId.PartId() == 0, QueryCtx->HullCtx->VCtx->VDiskLogPrefix); const NMatrix::TVectorType local = ingress.LocalParts(QueryCtx->HullCtx->VCtx->Top->GType); const int mode = ingress.GetCollectMode(TIngress::IngressMode(QueryCtx->HullCtx->VCtx->Top->GType)); diff --git a/ydb/core/blobstorage/vdisk/query/query_readbatch.cpp b/ydb/core/blobstorage/vdisk/query/query_readbatch.cpp index b53078dc238..23fa8927100 100644 --- a/ydb/core/blobstorage/vdisk/query/query_readbatch.cpp +++ b/ydb/core/blobstorage/vdisk/query/query_readbatch.cpp @@ -14,8 +14,8 @@ namespace NKikimr { //////////////////////////////////////////////////////////////////////////// // Traverse data parts for a single key void TReadBatcher::StartTraverse(const TLogoBlobID& id, void *cookie, ui8 queryPartId, ui32 queryShift, ui32 querySize) { - Y_DEBUG_ABORT_UNLESS(id.PartId() == 0); - Y_DEBUG_ABORT_UNLESS(!Traversing); + Y_VERIFY_DEBUG_S(id.PartId() == 0, Ctx->VCtx->VDiskLogPrefix); + Y_VERIFY_DEBUG_S(!Traversing, Ctx->VCtx->VDiskLogPrefix); ClearTmpItems(); CurID = id; Cookie = cookie; @@ -29,7 +29,7 @@ namespace NKikimr { // We have data on disk void TReadBatcher::operator () (const TDiskPart &data, NMatrix::TVectorType parts) { - Y_DEBUG_ABORT_UNLESS(Traversing); + Y_VERIFY_DEBUG_S(Traversing, Ctx->VCtx->VDiskLogPrefix); if (QueryPartId && !parts.Get(QueryPartId - 1)) { return; // we have no requested part here } @@ -44,7 +44,7 @@ namespace NKikimr { if (data.Size == TDiskBlob::HeaderSize + blobSize) { // skip the header, if it is present partOffs += TDiskBlob::HeaderSize; } else { - Y_ABORT_UNLESS(blobSize == data.Size); + Y_VERIFY_S(blobSize == data.Size, Ctx->VCtx->VDiskLogPrefix); } for (ui8 i : parts) { @@ -59,7 +59,7 @@ namespace NKikimr { tmpItem.UpdateWithMemItem(partId, Cookie, TRope()); } else if (tmpItem.ShouldUpdateWithDisk()) { const ui32 size = QuerySize ? QuerySize : partSize - QueryShift; - Y_DEBUG_ABORT_UNLESS(size); + Y_VERIFY_DEBUG_S(size, Ctx->VCtx->VDiskLogPrefix); tmpItem.UpdateWithDiskItem(partId, Cookie, TDiskPart(data.ChunkIdx, partOffs + QueryShift, size)); } } @@ -77,10 +77,10 @@ namespace NKikimr { // put data item iff we gather all parts OR we need a concrete part and parts contain it for (TDiskBlob::TPartIterator it = diskBlob.begin(), e = diskBlob.end(); it != e; ++it) { const ui8 partId = it.GetPartId(); - Y_ABORT_UNLESS(partId > 0); + Y_VERIFY_S(partId > 0, Ctx->VCtx->VDiskLogPrefix); const TLogoBlobID blobId(CurID, partId); const ui32 partSize = diskBlob.GetPartSize(partId - 1); - Y_ABORT_UNLESS(partSize == Ctx->VCtx->Top->GType.PartSize(blobId)); + Y_VERIFY_S(partSize == Ctx->VCtx->Top->GType.PartSize(blobId), Ctx->VCtx->VDiskLogPrefix); if (QueryPartId == 0 || QueryPartId == partId) { FoundAnything = true; auto& item = TmpItems[partId - 1]; @@ -109,7 +109,7 @@ namespace NKikimr { for (ui8 i : missingParts) { // NOT_YET if (QueryPartId == 0 || i + 1 == QueryPartId) { - Y_ABORT_UNLESS(TmpItems[i].Empty()); + Y_VERIFY_S(TmpItems[i].Empty(), Ctx->VCtx->VDiskLogPrefix); FoundAnything = true; TmpItems[i].UpdateWithNotYet(TLogoBlobID(CurID, i + 1), Cookie); } @@ -144,11 +144,11 @@ namespace NKikimr { } void TReadBatcher::PrepareReadPlan() { - Y_ABORT_UNLESS(!Result->DiskDataItemPtrs.empty() && Result->GlueReads.empty()); + Y_VERIFY_S(!Result->DiskDataItemPtrs.empty() && Result->GlueReads.empty(), Ctx->VCtx->VDiskLogPrefix); // sort read requests Sort(Result->DiskDataItemPtrs.begin(), Result->DiskDataItemPtrs.end(), TDataItem::DiskPartLess); - Y_ABORT_UNLESS(CheckDiskDataItemsOrdering(true)); + Y_VERIFY_S(CheckDiskDataItemsOrdering(true), Ctx->VCtx->VDiskLogPrefix); // plan real requests TGlueRead *back = nullptr; @@ -164,8 +164,10 @@ namespace NKikimr { } else { ui32 prevEnd = back->Part.Offset + back->Part.Size; ui32 nextBeg = item->ActualRead.Offset; - Y_ABORT_UNLESS(prevEnd <= nextBeg, "back: %s item: %s dataItems: %s", - back->Part.ToString().data(), item->ActualRead.ToString().data(), DiskDataItemsToString().data()); + Y_VERIFY_S(prevEnd <= nextBeg, Ctx->VCtx->VDiskLogPrefix + << "back: " << back->Part.ToString() + << " item: "<< item->ActualRead.ToString() + << " dataItems: " << DiskDataItemsToString()); if (nextBeg <= prevEnd + Ctx->PDiskCtx->Dsk->GlueRequestDistanceBytes) { // glue requests diff --git a/ydb/core/blobstorage/vdisk/query/query_statalgo.h b/ydb/core/blobstorage/vdisk/query/query_statalgo.h index d446b872ff1..a08b5fa1b06 100644 --- a/ydb/core/blobstorage/vdisk/query/query_statalgo.h +++ b/ydb/core/blobstorage/vdisk/query/query_statalgo.h @@ -129,7 +129,7 @@ namespace NKikimr { } void AddFromFresh(const TMemRec& memRec, const TRope* /*data*/, const TKey& key, ui64 /*lsn*/) { - Y_ABORT_UNLESS(key == CurKey); + Y_VERIFY_S(key == CurKey, HullCtx->VCtx->VDiskLogPrefix); if (!Constraint || Constraint->Check(CurKey)) { auto mr = memRec.ToString(HullCtx->IngressCache.Get(), nullptr); auto ing = IngressToString(HullCtx->VCtx->Top.get(), HullCtx->VCtx->ShortSelfVDisk, CurKey, memRec); @@ -324,4 +324,3 @@ namespace NKikimr { } } // NKikimr - diff --git a/ydb/core/blobstorage/vdisk/query/query_stathuge.cpp b/ydb/core/blobstorage/vdisk/query/query_stathuge.cpp index 867943ca1d6..680e892fa21 100644 --- a/ydb/core/blobstorage/vdisk/query/query_stathuge.cpp +++ b/ydb/core/blobstorage/vdisk/query/query_stathuge.cpp @@ -134,7 +134,7 @@ namespace NKikimr { TAggrSlotInfo aggr(x.second.NumberOfSlotsInChunk); auto insertRes = Aggr.insert(TAggrBySlotSize::value_type(x.second.SlotSize, aggr)); - Y_ABORT_UNLESS(insertRes.second); + Y_VERIFY_S(insertRes.second, HugeBlobCtx->VDiskLogPrefix); it = insertRes.first; } it->second.UsedSlots += x.second.UsedSlots; @@ -323,11 +323,11 @@ namespace NKikimr { TPerChunkMap::iterator it = Map.find(part.ChunkIdx); if (it == Map.end()) { const THugeSlotsMap::TSlotInfo *slotInfo = HugeBlobCtx->HugeSlotsMap->GetSlotInfo(part.Size); - Y_ABORT_UNLESS(slotInfo, "size# %" PRIu32, part.Size); + Y_VERIFY_S(slotInfo, HugeBlobCtx->VDiskLogPrefix << "size# " << part.Size); TChunkInfo chunkInfo(slotInfo->SlotSize, slotInfo->NumberOfSlotsInChunk); auto insertRes = Map.insert(TPerChunkMap::value_type(part.ChunkIdx, chunkInfo)); - Y_ABORT_UNLESS(insertRes.second); + Y_VERIFY_S(insertRes.second, HugeBlobCtx->VDiskLogPrefix); it = insertRes.first; } ++(it->second.UsedSlots); diff --git a/ydb/core/blobstorage/vdisk/repl/blobstorage_hullrepljob.cpp b/ydb/core/blobstorage/vdisk/repl/blobstorage_hullrepljob.cpp index f868d4a8185..ef30d0f81d2 100644 --- a/ydb/core/blobstorage/vdisk/repl/blobstorage_hullrepljob.cpp +++ b/ydb/core/blobstorage/vdisk/repl/blobstorage_hullrepljob.cpp @@ -136,7 +136,7 @@ namespace NKikimr { if (!AddingTasks) { // we have finished adding tasks after this key, remember it it.Next(); - Y_ABORT_UNLESS(!KeyToResumeNextTime); + Y_VERIFY_S(!KeyToResumeNextTime, ReplCtx->VCtx->VDiskLogPrefix); if (it.Valid()) { KeyToResumeNextTime.emplace(it.GetCurKey().LogoBlobID()); } @@ -421,7 +421,7 @@ namespace NKikimr { // run proxies SetupDiskProxies(); - Y_ABORT_UNLESS(!NumRunningProxies); + Y_VERIFY_S(!NumRunningProxies, ReplCtx->VCtx->VDiskLogPrefix); for (const TVDiskProxyPtr& p : DiskProxySet) { if (p) { ActiveActors.Insert(p->Run(SelfId()), __FILE__, __LINE__, TActivationContext::AsActorContext(), @@ -475,7 +475,7 @@ namespace NKikimr { TVDiskProxyPtr &ptr = DiskProxySet.at(orderNum); if (!ptr) { auto queueIt = QueueActorMapPtr->find(vdisk); - Y_ABORT_UNLESS(queueIt != QueueActorMapPtr->end()); + Y_VERIFY_S(queueIt != QueueActorMapPtr->end(), ReplCtx->VCtx->VDiskLogPrefix); ptr = MakeIntrusive<TVDiskProxy>(ReplCtx, vdisk, queueIt->second); } @@ -503,7 +503,7 @@ namespace NKikimr { const TReplSstStreamWriter::EState state = Writer.GetState(); const bool noWorkForWriter = RecoveryQueue.empty() || RecoveryQueue.front().IsHugeBlob; if (state == TReplSstStreamWriter::EState::COLLECT) { - Y_ABORT_UNLESS(!WriterFinished); + Y_VERIFY_S(!WriterFinished, ReplCtx->VCtx->VDiskLogPrefix); break; } else if (state == TReplSstStreamWriter::EState::STOPPED && noWorkForWriter) { break; @@ -511,7 +511,8 @@ namespace NKikimr { switch (state) { case TReplSstStreamWriter::EState::STOPPED: - Y_ABORT_UNLESS(RecoveryQueue && !RecoveryQueue.front().IsHugeBlob && !WriterFinished); + Y_VERIFY_S(RecoveryQueue && !RecoveryQueue.front().IsHugeBlob && !WriterFinished, + ReplCtx->VCtx->VDiskLogPrefix); Writer.Begin(); break; @@ -593,7 +594,7 @@ namespace NKikimr { if (!CurrentItem) { const TLogoBlobID id = MergeHeap.front()->GenLogoBlobId(); CurrentItem.emplace(id, ReplCtx->VCtx->Top->GType); - Y_ABORT_UNLESS(std::exchange(LastProcessedKey, id) < id); + Y_VERIFY_S(std::exchange(LastProcessedKey, id) < id, ReplCtx->VCtx->VDiskLogPrefix); } auto& item = *CurrentItem; @@ -676,9 +677,10 @@ namespace NKikimr { TimeAccount.SetState(ETimeState::PHANTOM); return false; // still waiting for proxy response about phantom validation } - Y_ABORT_UNLESS(PhantomChecksPending.empty()); + Y_VERIFY_S(PhantomChecksPending.empty(), ReplCtx->VCtx->VDiskLogPrefix); - Y_ABORT_UNLESS(!NumRunningProxies && MergeHeap.empty() && RecoveryQueue.empty()); + Y_VERIFY_S(!NumRunningProxies && MergeHeap.empty() && RecoveryQueue.empty(), + ReplCtx->VCtx->VDiskLogPrefix); TimeAccount.SetState(ETimeState::OTHER); if (!RecoveryMachineFinished) { @@ -707,12 +709,12 @@ namespace NKikimr { } if (Writer.GetState() == TReplSstStreamWriter::EState::STOPPED) { - Y_ABORT_UNLESS(RecoveryQueue.empty()); + Y_VERIFY_S(RecoveryQueue.empty(), ReplCtx->VCtx->VDiskLogPrefix); Finish(); return false; } - Y_ABORT("incorrect merger state State# %" PRIu32, ui32(Writer.GetState())); + Y_ABORT_S(ReplCtx->VCtx->VDiskLogPrefix << "incorrect merger state State# " << ui32(Writer.GetState())); } void RunPhantomChecks() { @@ -745,7 +747,7 @@ namespace NKikimr { (Msg, ev->Get()->ToString())); auto [begin, end] = PhantomChecksInFlight.equal_range(ev->Cookie); - Y_ABORT_UNLESS(begin != end); + Y_VERIFY_S(begin != end, ReplCtx->VCtx->VDiskLogPrefix); std::unordered_map<TLogoBlobID, std::tuple<bool, bool>> isPhantom; auto *msg = ev->Get(); @@ -754,7 +756,8 @@ namespace NKikimr { auto looksLikePhantom = r.LooksLikePhantom; bool isNoData = r.Status == NKikimrProto::NODATA; if (!looksLikePhantom) { - Y_VERIFY_DEBUG_S(r.Status == NKikimrProto::ERROR, "LooksLikePhantom undefined r.Status# " << r.Status + Y_VERIFY_DEBUG_S(r.Status == NKikimrProto::ERROR, ReplCtx->VCtx->VDiskLogPrefix + << "LooksLikePhantom undefined r.Status# " << r.Status << " msg.Status# " << msg->Status); looksLikePhantom = isNoData = false; } @@ -765,7 +768,7 @@ namespace NKikimr { const auto& [_, item] = *it; const auto& [id, parts, partSet, ingress] = item; auto node = isPhantom.extract(id); - Y_ABORT_UNLESS(node); + Y_VERIFY_S(node, ReplCtx->VCtx->VDiskLogPrefix); auto [phantom, looksLikePhantom] = node.mapped(); RecoveryMachine->ProcessPhantomBlob(partSet, parts, phantom, looksLikePhantom, ingress, *this); if (phantom) { @@ -774,7 +777,7 @@ namespace NKikimr { } PhantomChecksInFlight.erase(begin, end); - Y_ABORT_UNLESS(isPhantom.empty()); + Y_VERIFY_S(isPhantom.empty(), ReplCtx->VCtx->VDiskLogPrefix); Merge(); } @@ -828,7 +831,7 @@ namespace NKikimr { // we are already at in flight limit, do not accept more messages return EProcessQueueAction::Exit; } - Y_ABORT_UNLESS(HugeBlobsInFlight < HugeBlobsInFlightMax); + Y_VERIFY_S(HugeBlobsInFlight < HugeBlobsInFlightMax, ReplCtx->VCtx->VDiskLogPrefix); ++HugeBlobsInFlight; ++ReplCtx->MonGroup.ReplHugeBlobsRecovered(); @@ -893,7 +896,7 @@ namespace NKikimr { (VDiskId, msg->VDiskId.ToString())); --NumRunningProxies; } else { - Y_ABORT_UNLESS(proxy->Valid()); + Y_VERIFY_S(proxy->Valid(), ReplCtx->VCtx->VDiskLogPrefix); MergeHeap.push_back(proxy); PushHeap(MergeHeap.begin(), MergeHeap.end(), TVDiskProxy::TPtrGreater()); } @@ -917,7 +920,7 @@ namespace NKikimr { void Handle(TEvBlobStorage::TEvVPutResult::TPtr& /*ev*/) { // FIXME: Handle NotOK // this message is received when huge blob is written by Skeleton - Y_ABORT_UNLESS(HugeBlobsInFlight != 0); + Y_VERIFY_S(HugeBlobsInFlight != 0, ReplCtx->VCtx->VDiskLogPrefix); --HugeBlobsInFlight; Merge(); } @@ -1041,4 +1044,3 @@ namespace NKikimr { } } // NKikimr - diff --git a/ydb/core/blobstorage/vdisk/repl/blobstorage_hullreplwritesst.h b/ydb/core/blobstorage/vdisk/repl/blobstorage_hullreplwritesst.h index 0e1d195761a..187d84c7ede 100644 --- a/ydb/core/blobstorage/vdisk/repl/blobstorage_hullreplwritesst.h +++ b/ydb/core/blobstorage/vdisk/repl/blobstorage_hullreplwritesst.h @@ -58,10 +58,10 @@ namespace NKikimr { {} void Begin() { - Y_ABORT_UNLESS(State == EState::STOPPED); + Y_VERIFY_S(State == EState::STOPPED, ReplCtx->VCtx->VDiskLogPrefix); // ensure that we have no pending message and create new one to allocate some chunks for replicated SST - Y_ABORT_UNLESS(!PendingPDiskMsg); + Y_VERIFY_S(!PendingPDiskMsg, ReplCtx->VCtx->VDiskLogPrefix); PendingPDiskMsg = std::make_unique<NPDisk::TEvChunkReserve>(ReplCtx->PDiskCtx->Dsk->Owner, ReplCtx->PDiskCtx->Dsk->OwnerRound, MinReservedChunksCount - ReservedChunks.size()); State = EState::PDISK_MESSAGE_PENDING; @@ -74,7 +74,7 @@ namespace NKikimr { } std::unique_ptr<IEventBase> GetPendingPDiskMsg() { - Y_ABORT_UNLESS(State == EState::PDISK_MESSAGE_PENDING); + Y_VERIFY_S(State == EState::PDISK_MESSAGE_PENDING, ReplCtx->VCtx->VDiskLogPrefix); std::unique_ptr<IEventBase> msg = std::move(PendingPDiskMsg); if (auto write = dynamic_cast<NPDisk::TEvChunkWrite*>(msg.get())) { @@ -122,7 +122,7 @@ namespace NKikimr { } void Apply(NPDisk::TEvChunkReserveResult* ev) { - Y_ABORT_UNLESS(State == EState::NOT_READY); + Y_VERIFY_S(State == EState::NOT_READY, ReplCtx->VCtx->VDiskLogPrefix); if (ev->Status != NKikimrProto::OK) { State = EState::ERROR; @@ -134,7 +134,7 @@ namespace NKikimr { } // create new writer - Y_ABORT_UNLESS(!Writer); + Y_VERIFY_S(!Writer, ReplCtx->VCtx->VDiskLogPrefix); Writer = std::make_unique<TWriter>(ReplCtx->VCtx, EWriterDataType::Replication, 1, ReplCtx->PDiskCtx->Dsk->Owner, ReplCtx->PDiskCtx->Dsk->OwnerRound, ReplCtx->PDiskCtx->Dsk->ChunkSize, ReplCtx->PDiskCtx->Dsk->AppendBlockSize, ReplCtx->PDiskCtx->Dsk->BulkWriteBlockSize, @@ -145,9 +145,9 @@ namespace NKikimr { } bool AddRecoveredBlob(TRecoveredBlobInfo& record) { - Y_ABORT_UNLESS(State == EState::COLLECT); - Y_ABORT_UNLESS(record.Id > PrevID); - Y_ABORT_UNLESS(!record.Id.PartId()); + Y_VERIFY_S(State == EState::COLLECT, ReplCtx->VCtx->VDiskLogPrefix); + Y_VERIFY_S(record.Id > PrevID, ReplCtx->VCtx->VDiskLogPrefix); + Y_VERIFY_S(!record.Id.PartId(), ReplCtx->VCtx->VDiskLogPrefix); TMemRecLogoBlob memRec(TIngress::CreateFromRepl(ReplCtx->VCtx->Top.get(), ReplCtx->VCtx->ShortSelfVDisk, record.Id, record.LocalParts)); @@ -160,9 +160,9 @@ namespace NKikimr { TDiskPart preallocatedLocation; const bool success = Writer->PushIndexOnly(record.Id, memRec, &Merger, &preallocatedLocation); if (success) { - Y_DEBUG_ABORT_UNLESS(Merger.GetCollectTask().Reads.empty()); + Y_VERIFY_DEBUG_S(Merger.GetCollectTask().Reads.empty(), ReplCtx->VCtx->VDiskLogPrefix); const TDiskPart writtenLocation = Writer->PushDataOnly(std::move(record.Data)); - Y_ABORT_UNLESS(writtenLocation == preallocatedLocation); + Y_VERIFY_S(writtenLocation == preallocatedLocation, ReplCtx->VCtx->VDiskLogPrefix); if (auto msg = Writer->GetPendingMessage()) { IssueWriteCmd(std::move(msg), EOutputState::INTERMEDIATE_CHUNK); @@ -185,7 +185,7 @@ namespace NKikimr { return; } - Y_ABORT_UNLESS(WritesInFlight > 0); + Y_VERIFY_S(WritesInFlight > 0, ReplCtx->VCtx->VDiskLogPrefix); --WritesInFlight; // if we were blocked for some reason when issuing last message, try to determine what to do next @@ -212,21 +212,22 @@ namespace NKikimr { } void Finish() { - Y_ABORT_UNLESS(State == EState::COLLECT, "unexpected State# %" PRIu32, static_cast<ui32>(State)); + Y_VERIFY_S(State == EState::COLLECT, ReplCtx->VCtx->VDiskLogPrefix + << "unexpected State# " << static_cast<ui32>(State)); FlushNextPart(); } std::unique_ptr<TEvAddBulkSst> GetPendingCommitMsg() { - Y_ABORT_UNLESS(State == EState::COMMIT_PENDING); + Y_VERIFY_S(State == EState::COMMIT_PENDING, ReplCtx->VCtx->VDiskLogPrefix); std::unique_ptr<TEvAddBulkSst> msg; msg.swap(PendingCommitMsg); - Y_ABORT_UNLESS(msg); + Y_VERIFY_S(msg, ReplCtx->VCtx->VDiskLogPrefix); State = EState::WAITING_FOR_COMMIT; return msg; } void ApplyCommit() { - Y_ABORT_UNLESS(State == EState::WAITING_FOR_COMMIT); + Y_VERIFY_S(State == EState::WAITING_FOR_COMMIT, ReplCtx->VCtx->VDiskLogPrefix); State = EState::STOPPED; } @@ -238,29 +239,29 @@ namespace NKikimr { void IssueWriteCmd(std::unique_ptr<NPDisk::TEvChunkWrite>&& ev, EOutputState outputState) { State = EState::PDISK_MESSAGE_PENDING; PendingPDiskMsg = std::move(ev); - Y_ABORT_UNLESS(outputState >= OutputState); + Y_VERIFY_S(outputState >= OutputState, ReplCtx->VCtx->VDiskLogPrefix); OutputState = outputState; } void FlushNextPart() { - Y_ABORT_UNLESS(!FlushFinished); + Y_VERIFY_S(!FlushFinished, ReplCtx->VCtx->VDiskLogPrefix); FlushFinished = Writer->FlushNext(0, 0, 1); if (auto msg = Writer->GetPendingMessage()) { IssueWriteCmd(std::move(msg), FlushFinished ? EOutputState::FLUSH_LAST_CHUNK : EOutputState::FLUSH_CHUNK); } else if (WritesInFlight) { - Y_ABORT_UNLESS(FlushFinished); - Y_ABORT_UNLESS(OutputState == EOutputState::FLUSH_CHUNK); + Y_VERIFY_S(FlushFinished, ReplCtx->VCtx->VDiskLogPrefix); + Y_VERIFY_S(OutputState == EOutputState::FLUSH_CHUNK, ReplCtx->VCtx->VDiskLogPrefix); OutputState = EOutputState::FLUSH_LAST_CHUNK; // promote to final state State = EState::NOT_READY; } else { - Y_ABORT_UNLESS(FlushFinished); + Y_VERIFY_S(FlushFinished, ReplCtx->VCtx->VDiskLogPrefix); OnFlushComplete(); } } void OnFlushComplete() { - Y_ABORT_UNLESS(!WritesInFlight); - Y_ABORT_UNLESS(FlushFinished); + Y_VERIFY_S(!WritesInFlight, ReplCtx->VCtx->VDiskLogPrefix); + Y_VERIFY_S(FlushFinished, ReplCtx->VCtx->VDiskLogPrefix); const auto& conclusion = Writer->GetConclusion(); TVector<ui32> usedChunks = conclusion.UsedChunks; PendingCommitMsg = std::make_unique<TEvAddBulkSst>(TVector<ui32>(ReservedChunks.begin(), ReservedChunks.end()), diff --git a/ydb/core/blobstorage/vdisk/repl/blobstorage_hullreplwritesst_ut.cpp b/ydb/core/blobstorage/vdisk/repl/blobstorage_hullreplwritesst_ut.cpp index e07f2752f87..9e5208f0d07 100644 --- a/ydb/core/blobstorage/vdisk/repl/blobstorage_hullreplwritesst_ut.cpp +++ b/ydb/core/blobstorage/vdisk/repl/blobstorage_hullreplwritesst_ut.cpp @@ -14,7 +14,7 @@ std::shared_ptr<TReplCtx> CreateReplCtx(TVector<TVDiskID>& vdisks, const TIntrus auto counters = MakeIntrusive<::NMonitoring::TDynamicCounters>(); auto vctx = MakeIntrusive<TVDiskContext>(TActorId(), info->PickTopology(), counters, TVDiskID(0, 1, 0, 0, 0), nullptr, NPDisk::DEVICE_TYPE_UNKNOWN); - auto hugeBlobCtx = std::make_shared<THugeBlobCtx>(nullptr, true); + auto hugeBlobCtx = std::make_shared<THugeBlobCtx>("", nullptr, true); auto dsk = MakeIntrusive<TPDiskParams>(ui8(1), 1u, 128u << 20, 4096u, 0u, 1000000000u, 1000000000u, 65536u, 65536u, 65536u, NPDisk::DEVICE_TYPE_UNKNOWN); auto pdiskCtx = std::make_shared<TPDiskCtx>(dsk, TActorId(), TString()); diff --git a/ydb/core/blobstorage/vdisk/repl/blobstorage_repl.cpp b/ydb/core/blobstorage/vdisk/repl/blobstorage_repl.cpp index 5e624869cd4..d6bd0f90da1 100644 --- a/ydb/core/blobstorage/vdisk/repl/blobstorage_repl.cpp +++ b/ydb/core/blobstorage/vdisk/repl/blobstorage_repl.cpp @@ -202,7 +202,8 @@ namespace NKikimr { } void Transition(EState current, EState next) { - Y_ABORT_UNLESS(State == current, "State# %s Expected# %s", StateToStr(State), StateToStr(current)); + Y_VERIFY_S(State == current, ReplCtx->VCtx->VDiskLogPrefix + << "State# " << StateToStr(State) << " Expected# " << StateToStr(current)); State = next; } @@ -279,7 +280,7 @@ namespace NKikimr { ReplCtx->MonGroup.ReplWorkUnitsDone() = 0; ReplCtx->MonGroup.ReplItemsRemaining() = 0; ReplCtx->MonGroup.ReplItemsDone() = 0; - Y_ABORT_UNLESS(NextMinHugeBlobInBytes); + Y_VERIFY_S(NextMinHugeBlobInBytes, ReplCtx->VCtx->VDiskLogPrefix); ReplCtx->MinHugeBlobInBytes = NextMinHugeBlobInBytes; UnrecoveredNonphantomBlobs = false; @@ -294,13 +295,13 @@ namespace NKikimr { } void Handle(TEvReplStarted::TPtr& ev) { - Y_ABORT_UNLESS(ReplJobActorId == ev->Sender); + Y_VERIFY_S(ReplJobActorId == ev->Sender, ReplCtx->VCtx->VDiskLogPrefix); switch (State) { case Plan: // this is a first quantum of replication, so we have to register it in the broker State = AwaitToken; - Y_DEBUG_ABORT_UNLESS(!RequestedReplicationToken); + Y_VERIFY_S(!RequestedReplicationToken, ReplCtx->VCtx->VDiskLogPrefix); if (RequestedReplicationToken) { STLOG(PRI_CRIT, BS_REPL, BSVR38, ReplCtx->VCtx->VDiskLogPrefix << "excessive replication token requested"); break; @@ -322,7 +323,7 @@ namespace NKikimr { } void HandleReplToken() { - Y_ABORT_UNLESS(RequestedReplicationToken); + Y_VERIFY_S(RequestedReplicationToken, ReplCtx->VCtx->VDiskLogPrefix); RequestedReplicationToken = false; HoldingReplicationToken = true; @@ -365,11 +366,12 @@ namespace NKikimr { } void Handle(TEvReplFinished::TPtr &ev) { - Y_ABORT_UNLESS(ev->Sender == ReplJobActorId); + Y_VERIFY_S(ev->Sender == ReplJobActorId, ReplCtx->VCtx->VDiskLogPrefix); ReplJobActorId = {}; // replication can be finished only from the following states - Y_ABORT_UNLESS(State == Plan || State == Replication, "State# %s", StateToStr(State)); + Y_VERIFY_S(State == Plan || State == Replication, ReplCtx->VCtx->VDiskLogPrefix + << "State# " << StateToStr(State)); TEvReplFinished *msg = ev->Get(); TEvReplFinished::TInfoPtr info = msg->Info; @@ -388,7 +390,7 @@ namespace NKikimr { CanDropDonor = CanDropDonor && info->DropDonor; if (info->DonorNotReady) { - Y_ABORT_UNLESS(!DonorQueue.empty() && DonorQueue.front()); + Y_VERIFY_S(!DonorQueue.empty() && DonorQueue.front(), ReplCtx->VCtx->VDiskLogPrefix); auto& donor = DonorQueue.front(); if (donor->FirstNotReady == TInstant::Zero()) { @@ -440,7 +442,7 @@ namespace NKikimr { } if (!finished) { if (CanDropDonor) { - Y_ABORT_UNLESS(!DonorQueue.empty() && DonorQueue.front()); + Y_VERIFY_S(!DonorQueue.empty() && DonorQueue.front(), ReplCtx->VCtx->VDiskLogPrefix); DropDonor(*DonorQueue.front()); DonorQueue.pop_front(); } else { @@ -503,7 +505,7 @@ namespace NKikimr { void RunRepl(const TLogoBlobID& from) { LastReplQuantumStart = TAppData::TimeProvider->Now(); - Y_ABORT_UNLESS(!ReplJobActorId); + Y_VERIFY_S(!ReplJobActorId, ReplCtx->VCtx->VDiskLogPrefix); // Iterate through the donor queue, moving "NotReady" donors to the end // until a ready donor or an empty optional (indicating the use of the group's other disks instead of a donor) is found. @@ -656,7 +658,7 @@ namespace NKikimr { void Handle(TEvents::TEvGone::TPtr ev) { const size_t num = DonorQueryActors.erase(ev->Sender); - Y_ABORT_UNLESS(num); + Y_VERIFY_S(num, ReplCtx->VCtx->VDiskLogPrefix); } void Ignore() diff --git a/ydb/core/blobstorage/vdisk/repl/blobstorage_replctx.h b/ydb/core/blobstorage/vdisk/repl/blobstorage_replctx.h index 2d2211f63cc..f884a271c0a 100644 --- a/ydb/core/blobstorage/vdisk/repl/blobstorage_replctx.h +++ b/ydb/core/blobstorage/vdisk/repl/blobstorage_replctx.h @@ -51,11 +51,10 @@ namespace NKikimr { , PDiskWriteBytes(std::move(pdiskWriteBytes)) , PausedAtStart(pausedAtStart) { - Y_ABORT_UNLESS(MinHugeBlobInBytes); + Y_VERIFY_S(MinHugeBlobInBytes, VCtx->VDiskLogPrefix); } bool GetAddHeader() const { return !HullCtx || HullCtx->AddHeader; } }; } // NKikimr - diff --git a/ydb/core/blobstorage/vdisk/repl/blobstorage_replproxy.cpp b/ydb/core/blobstorage/vdisk/repl/blobstorage_replproxy.cpp index 5844660782d..6864a1b2e24 100644 --- a/ydb/core/blobstorage/vdisk/repl/blobstorage_replproxy.cpp +++ b/ydb/core/blobstorage/vdisk/repl/blobstorage_replproxy.cpp @@ -34,7 +34,7 @@ namespace NKikimr { {} TActorId TVDiskProxy::Run(const TActorId& parentId) { - Y_DEBUG_ABORT_UNLESS(State == Initial); + Y_VERIFY_DEBUG_S(State == Initial, ReplCtx->VCtx->VDiskLogPrefix); State = RunProxy; STLOG(PRI_DEBUG, BS_REPL, BSVR19, VDISKP(ReplCtx->VCtx->VDiskLogPrefix, "TVDiskProxy::Run")); ParentId = parentId; @@ -51,7 +51,7 @@ namespace NKikimr { if (State == RunProxy) { State = Ok; } - Y_ABORT_UNLESS(State == Ok); + Y_VERIFY_S(State == Ok, ReplCtx->VCtx->VDiskLogPrefix); HandlePortion(ev->Get()->Portion); Stat = ev->Get()->Stat; HasTransientErrors = HasTransientErrors || ev->Get()->HasTransientErrors; @@ -62,7 +62,7 @@ namespace NKikimr { switch (portion.Status) { case TNextPortion::Ok: State = Ok; - Y_ABORT_UNLESS(portion.DataPortion.Valid()); + Y_VERIFY_S(portion.DataPortion.Valid(), ReplCtx->VCtx->VDiskLogPrefix); break; case TNextPortion::Eof: State = Eof; @@ -74,7 +74,7 @@ namespace NKikimr { Y_ABORT("Unexpected value: %d", portion.Status); } - Y_ABORT_UNLESS(!DataPortion.Valid()); + Y_VERIFY_S(!DataPortion.Valid(), ReplCtx->VCtx->VDiskLogPrefix); DataPortion = std::move(portion.DataPortion); } @@ -145,7 +145,7 @@ namespace NKikimr { Recipient = parentId; // ensure we have LogoBlobs to fetch - Y_ABORT_UNLESS(!Ids.empty()); + Y_VERIFY_S(!Ids.empty(), ReplCtx->VCtx->VDiskLogPrefix); // send initial request Become(&TThis::StateFunc); @@ -170,7 +170,7 @@ namespace NKikimr { } // prepare a set of extreme queries - Y_ABORT_UNLESS(SendIdx < Ids.size()); + Y_VERIFY_S(SendIdx < Ids.size(), ReplCtx->VCtx->VDiskLogPrefix); ui32 numIDsRemain = Min<size_t>(Ids.size() - SendIdx, ReplCtx->VDiskCfg->ReplRequestElements); ui32 responseSize = 0; ui64 bytes = 0; @@ -204,7 +204,7 @@ namespace NKikimr { void Handle(TEvReplMemToken::TPtr& ev) { // send scheduled item and remember result token for this request - Y_ABORT_UNLESS(SchedulerRequestQ); + Y_VERIFY_S(SchedulerRequestQ, ReplCtx->VCtx->VDiskLogPrefix); auto& item = SchedulerRequestQ.front(); Send(ServiceId, item.release()); SchedulerRequestQ.pop(); @@ -215,7 +215,7 @@ namespace NKikimr { STLOG(PRI_DEBUG, BS_REPL, BSVR22, VDISKP(ReplCtx->VCtx->VDiskLogPrefix, "TVDiskProxyActor::Handle(TEvReplProxyNext)")); // increase number of unsatisfied TEvReplProxyNext requests by one more request - Y_ABORT_UNLESS(!RequestFromVDiskProxyPending); + Y_VERIFY_S(!RequestFromVDiskProxyPending, ReplCtx->VCtx->VDiskLogPrefix); RequestFromVDiskProxyPending = true; // try to resolve this request via prefetch @@ -245,7 +245,7 @@ namespace NKikimr { void PutResponseQueueItem(TNextPortion&& portion) { // we consider ourself finished when last status is either EOF or ERROR; such response must be ultimately last - Y_ABORT_UNLESS(!Finished); + Y_VERIFY_S(!Finished, ReplCtx->VCtx->VDiskLogPrefix); Finished = portion.Status != TNextPortion::Ok; // update prefetch cumulative data size @@ -321,10 +321,10 @@ namespace NKikimr { } void ReleaseMemToken(ui64 cookie) { - Y_ABORT_UNLESS(!Terminated); + Y_VERIFY_S(!Terminated, ReplCtx->VCtx->VDiskLogPrefix); if (RequestTokens) { auto it = RequestTokens.find(cookie); - Y_ABORT_UNLESS(it != RequestTokens.end()); + Y_VERIFY_S(it != RequestTokens.end(), ReplCtx->VCtx->VDiskLogPrefix); Send(MakeBlobStorageReplBrokerID(), new TEvReleaseReplMemToken(it->second)); RequestTokens.erase(it); } @@ -332,10 +332,10 @@ namespace NKikimr { void ProcessResult(TEvBlobStorage::TEvVGetResult *msg) { const ui64 cookie = msg->Record.GetCookie(); - Y_ABORT_UNLESS(cookie == NextReceiveCookie); + Y_VERIFY_S(cookie == NextReceiveCookie, ReplCtx->VCtx->VDiskLogPrefix); ++NextReceiveCookie; - Y_ABORT_UNLESS(RequestsInFlight > 0); + Y_VERIFY_S(RequestsInFlight > 0, ReplCtx->VCtx->VDiskLogPrefix); --RequestsInFlight; // ignore any further results if already finished @@ -370,7 +370,8 @@ namespace NKikimr { case NKikimrProto::TRYLATER: case NKikimrProto::TRYLATER_TIME: case NKikimrProto::TRYLATER_SIZE: - Y_ABORT("unexpected Status# %s from BS_QUEUE", EReplyStatus_Name(rec.GetStatus()).data()); + Y_ABORT_S(ReplCtx->VCtx->VDiskLogPrefix + << "unexpected Status# " << EReplyStatus_Name(rec.GetStatus()) << " from BS_QUEUE"); default: ++Stat.VDiskRespOther; STLOG(PRI_DEBUG, BS_REPL, BSVR24, VDISKP(ReplCtx->VCtx->VDiskLogPrefix, @@ -388,19 +389,18 @@ namespace NKikimr { const NKikimrBlobStorage::TQueryResult &q = rec.GetResult(i); ui64 cookie = q.GetCookie(); - Y_ABORT_UNLESS(cookie == CurPosIdx || (CurPosIdx && cookie == CurPosIdx - 1), - "i# %" PRIu32 " cookie# %" PRIu64 " CurPosIdx %" PRIu32, - i, cookie, CurPosIdx); + Y_VERIFY_S(cookie == CurPosIdx || (CurPosIdx && cookie == CurPosIdx - 1), ReplCtx->VCtx->VDiskLogPrefix + << "i# " << i << " cookie# " << cookie << " CurPosIdx " << CurPosIdx); // ensure we received correctly ordered LogoBlob ID const TLogoBlobID id = LogoBlobIDFromLogoBlobID(q.GetBlobID()); const TLogoBlobID genId = Ids[cookie].Id.PartId() ? id : TLogoBlobID(id, 0); - Y_ABORT_UNLESS(genId == Ids[cookie].Id); + Y_VERIFY_S(genId == Ids[cookie].Id, ReplCtx->VCtx->VDiskLogPrefix); if (CurPosIdx == cookie) ++CurPosIdx; if (q.GetStatus() == NKikimrProto::OK) { - Y_DEBUG_ABORT_UNLESS(msg->HasBlob(q)); + Y_VERIFY_DEBUG_S(msg->HasBlob(q), ReplCtx->VCtx->VDiskLogPrefix); TRope buffer = msg->GetBlobData(q); if (buffer.size() != GType.PartSize(id)) { TString message = VDISKP(ReplCtx->VCtx->VDiskLogPrefix, @@ -408,7 +408,7 @@ namespace NKikimr { " VDISK CAN NOT REPLICATE A BLOB BECAUSE HAS FOUND INCONSISTENCY IN BLOB SIZE", id.ToString().data(), buffer.size()); STLOG(PRI_CRIT, BS_REPL, BSVR26, message, (BlobId, id), (BufferSize, buffer.size())); - Y_DEBUG_ABORT("%s", message.data()); + Y_DEBUG_ABORT_S(ReplCtx->VCtx->VDiskLogPrefix << message); // count this blob as erroneous one portion.DataPortion.AddError(id, NKikimrProto::ERROR); @@ -428,7 +428,7 @@ namespace NKikimr { } } } - Y_ABORT_UNLESS(CurPosIdx <= Ids.size()); + Y_VERIFY_S(CurPosIdx <= Ids.size(), ReplCtx->VCtx->VDiskLogPrefix); if (CurPosIdx == Ids.size()) portion.Status = TNextPortion::Eof; @@ -441,7 +441,7 @@ namespace NKikimr { } void PassAway() override { - Y_ABORT_UNLESS(!Terminated); + Y_VERIFY_S(!Terminated, ReplCtx->VCtx->VDiskLogPrefix); Terminated = true; Send(MakeBlobStorageReplBrokerID(), new TEvPruneQueue); TActorBootstrapped::PassAway(); diff --git a/ydb/core/blobstorage/vdisk/repl/blobstorage_replrecoverymachine.h b/ydb/core/blobstorage/vdisk/repl/blobstorage_replrecoverymachine.h index 3de2562e826..e379480c3d9 100644 --- a/ydb/core/blobstorage/vdisk/repl/blobstorage_replrecoverymachine.h +++ b/ydb/core/blobstorage/vdisk/repl/blobstorage_replrecoverymachine.h @@ -124,8 +124,8 @@ namespace NKikimr { template<typename TBlobProcessor> void Recover(TPartSet& item, TRecoveredBlobsQueue& rbq, TBlobProcessor&& processor) { const TLogoBlobID& id = item.Id; - Y_ABORT_UNLESS(!id.PartId()); - Y_ABORT_UNLESS(!LastRecoveredId || *LastRecoveredId < id); + Y_VERIFY_S(!id.PartId(), ReplCtx->VCtx->VDiskLogPrefix); + Y_VERIFY_S(!LastRecoveredId || *LastRecoveredId < id, ReplCtx->VCtx->VDiskLogPrefix); LastRecoveredId = id; RecoverMetadata(id, rbq); @@ -142,7 +142,7 @@ namespace NKikimr { } const TLost& lost = LostVec.front(); - Y_ABORT_UNLESS(lost.Id == id); + Y_VERIFY_S(lost.Id == id, ReplCtx->VCtx->VDiskLogPrefix); const NMatrix::TVectorType parts = lost.PartsToRecover; @@ -159,7 +159,7 @@ namespace NKikimr { } } - Y_DEBUG_ABORT_UNLESS((item.PartsMask >> groupType.TotalPartCount()) == 0); + Y_VERIFY_DEBUG_S((item.PartsMask >> groupType.TotalPartCount()) == 0, ReplCtx->VCtx->VDiskLogPrefix); const ui32 presentParts = std::popcount(item.PartsMask); bool canRestore = presentParts >= groupType.MinimalRestorablePartCount(); @@ -202,10 +202,10 @@ namespace NKikimr { } const TLogoBlobID partId(id, i + 1); const ui32 partSize = groupType.PartSize(partId); - Y_ABORT_UNLESS(partSize); // no metadata here + Y_VERIFY_S(partSize, ReplCtx->VCtx->VDiskLogPrefix); // no metadata here partsSize += partSize; TRope& data = item.Parts[i]; - Y_ABORT_UNLESS(data.GetSize() == partSize); + Y_VERIFY_S(data.GetSize() == partSize, ReplCtx->VCtx->VDiskLogPrefix); if (ReplCtx->HugeBlobCtx->IsHugeBlob(groupType, id, ReplCtx->MinHugeBlobInBytes)) { AddBlobToQueue(partId, TDiskBlob::Create(id.BlobSize(), i + 1, groupType.TotalPartCount(), std::move(data), Arena, ReplCtx->GetAddHeader()), {}, true, rbq); @@ -306,8 +306,8 @@ namespace NKikimr { // add next task during preparation phase void AddTask(const TLogoBlobID &id, const NMatrix::TVectorType &partsToRecover, bool possiblePhantom, TIngress ingress) { - Y_ABORT_UNLESS(!id.PartId()); - Y_ABORT_UNLESS(LostVec.empty() || LostVec.back().Id < id); + Y_VERIFY_S(!id.PartId(), ReplCtx->VCtx->VDiskLogPrefix); + Y_VERIFY_S(LostVec.empty() || LostVec.back().Id < id, ReplCtx->VCtx->VDiskLogPrefix); LostVec.push_back(TLost(id, partsToRecover, possiblePhantom, ingress)); } diff --git a/ydb/core/blobstorage/vdisk/repl/blobstorage_replrecoverymachine_ut.cpp b/ydb/core/blobstorage/vdisk/repl/blobstorage_replrecoverymachine_ut.cpp index eefc28c30f4..fc06f714530 100644 --- a/ydb/core/blobstorage/vdisk/repl/blobstorage_replrecoverymachine_ut.cpp +++ b/ydb/core/blobstorage/vdisk/repl/blobstorage_replrecoverymachine_ut.cpp @@ -67,7 +67,7 @@ namespace NKikimr { auto counters = MakeIntrusive<::NMonitoring::TDynamicCounters>(); auto vctx = MakeIntrusive<TVDiskContext>(TActorId(), info->PickTopology(), counters, TVDiskID(TGroupId::FromValue(0), 1, 0, 0, 0), nullptr, NPDisk::DEVICE_TYPE_UNKNOWN); - auto hugeBlobCtx = std::make_shared<THugeBlobCtx>(nullptr, true); + auto hugeBlobCtx = std::make_shared<THugeBlobCtx>("", nullptr, true); auto replCtx = std::make_shared<TReplCtx>( vctx, nullptr, // HullCtx diff --git a/ydb/core/blobstorage/vdisk/scrub/blob_recovery_process.cpp b/ydb/core/blobstorage/vdisk/scrub/blob_recovery_process.cpp index 01e4ade6f95..16527f7c375 100644 --- a/ydb/core/blobstorage/vdisk/scrub/blob_recovery_process.cpp +++ b/ydb/core/blobstorage/vdisk/scrub/blob_recovery_process.cpp @@ -75,10 +75,10 @@ namespace NKikimr { void TBlobRecoveryActor::SendPendingQueries() { for (auto& [vdiskId, query] : std::exchange(Queries, {})) { - Y_ABORT_UNLESS(query.VGet); + Y_VERIFY_S(query.VGet, LogPrefix); query.Pending.push_back(std::move(query.VGet)); auto queueIt = Queues.find(vdiskId); - Y_ABORT_UNLESS(queueIt != Queues.end()); + Y_VERIFY_S(queueIt != Queues.end(), LogPrefix); for (auto& vget : query.Pending) { STLOG(PRI_DEBUG, BS_VDISK_SCRUB, VDS34, VDISKP(LogPrefix, "sending TEvVGet"), (SelfId, SelfId()), (Msg, vget->ToString())); diff --git a/ydb/core/blobstorage/vdisk/scrub/blob_recovery_queue.cpp b/ydb/core/blobstorage/vdisk/scrub/blob_recovery_queue.cpp index 5d274fbdf26..80c5d975eb4 100644 --- a/ydb/core/blobstorage/vdisk/scrub/blob_recovery_queue.cpp +++ b/ydb/core/blobstorage/vdisk/scrub/blob_recovery_queue.cpp @@ -34,7 +34,7 @@ namespace NKikimr { void TBlobRecoveryActor::Handle(TEvProxyQueueState::TPtr ev) { const auto it = Queues.find(ev->Get()->VDiskId); - Y_ABORT_UNLESS(it != Queues.end()); + Y_VERIFY_S(it != Queues.end(), LogPrefix); it->second.IsConnected = ev->Get()->IsConnected; STLOG(PRI_INFO, BS_VDISK_SCRUB, VDS29, VDISKP(LogPrefix, "BS_QUEUE state update"), (SelfId, SelfId()), (VDiskId, it->first), (IsConnected, it->second.IsConnected)); diff --git a/ydb/core/blobstorage/vdisk/scrub/restore_corrupted_blob_actor.cpp b/ydb/core/blobstorage/vdisk/scrub/restore_corrupted_blob_actor.cpp index a1bca34dcdd..cd7f7e23a2b 100644 --- a/ydb/core/blobstorage/vdisk/scrub/restore_corrupted_blob_actor.cpp +++ b/ydb/core/blobstorage/vdisk/scrub/restore_corrupted_blob_actor.cpp @@ -166,7 +166,7 @@ namespace NKikimr { } void Handle(NPDisk::TEvChunkReadResult::TPtr ev) { - Y_ABORT_UNLESS(ReadsPending); + Y_VERIFY_S(ReadsPending, VCtx->VDiskLogPrefix); --ReadsPending; auto *msg = ev->Get(); @@ -231,7 +231,7 @@ namespace NKikimr { for (auto& item : ev->Get()->Items) { auto& myItem = Items[item.Cookie]; - Y_ABORT_UNLESS(myItem.Status == NKikimrProto::UNKNOWN); + Y_VERIFY_S(myItem.Status == NKikimrProto::UNKNOWN, VCtx->VDiskLogPrefix); myItem.Parts = std::move(item.Parts); myItem.PartsMask = item.PartsMask; if (item.Status != NKikimrProto::NODATA) { // we keep trying to fetch NODATA's till deadline @@ -256,8 +256,8 @@ namespace NKikimr { for (ui32 i = item.Needed.FirstPosition(); i != item.Needed.GetSize(); i = item.Needed.NextPosition(i)) { const TLogoBlobID blobId(item.BlobId, i + 1); const TRope& buffer = item.GetPartData(blobId); - Y_ABORT_UNLESS(buffer.size() == Info->Type.PartSize(blobId)); - Y_ABORT_UNLESS(WriteRestoredParts); + Y_VERIFY_S(buffer.size() == Info->Type.PartSize(blobId), VCtx->VDiskLogPrefix); + Y_VERIFY_S(WriteRestoredParts, VCtx->VDiskLogPrefix); auto ev = std::make_unique<TEvBlobStorage::TEvVPut>(blobId, buffer, vdiskId, true, &index, Deadline, NKikimrBlobStorage::EPutHandleClass::AsyncBlob); ev->RewriteBlob = true; @@ -269,7 +269,7 @@ namespace NKikimr { void Handle(TEvBlobStorage::TEvVPutResult::TPtr ev) { STLOG(PRI_DEBUG, BS_VDISK_SCRUB, VDS37, VDISKP(LogPrefix, "received TEvVPutResult"), (SelfId, SelfId()), (Msg, ev->Get()->ToString())); - Y_ABORT_UNLESS(WritesPending); + Y_VERIFY_S(WritesPending, VCtx->VDiskLogPrefix); --WritesPending; const auto& record = ev->Get()->Record; auto& item = Items[record.GetCookie()]; diff --git a/ydb/core/blobstorage/vdisk/scrub/scrub_actor.cpp b/ydb/core/blobstorage/vdisk/scrub/scrub_actor.cpp index a75dc6c2844..a9b70f53510 100644 --- a/ydb/core/blobstorage/vdisk/scrub/scrub_actor.cpp +++ b/ydb/core/blobstorage/vdisk/scrub/scrub_actor.cpp @@ -185,7 +185,7 @@ namespace NKikimr { if (State) { TString serialized; const bool success = State->SerializeToString(&serialized); - Y_ABORT_UNLESS(success); + Y_VERIFY_S(success, LogPrefix); finish(serialized); ScrubEntrypoint.MutableScrubState()->CopyFrom(*State); } else { @@ -209,7 +209,7 @@ namespace NKikimr { TRcBuf data(TRcBuf::Uninitialized(ScrubEntrypoint.ByteSizeLong())); //FIXME(innokentii): better use SerializeWithCachedSizesToArray + check that all fields are set const bool success = ScrubEntrypoint.SerializeToArray(reinterpret_cast<uint8_t*>(data.UnsafeGetDataMut()), data.GetSize()); - Y_ABORT_UNLESS(success); + Y_VERIFY_S(success, LogPrefix); auto seg = ScrubCtx->LsnMngr->AllocLsnForLocalUse(); ScrubEntrypointLsn = seg.Point(); diff --git a/ydb/core/blobstorage/vdisk/scrub/scrub_actor_huge_blob_merger.h b/ydb/core/blobstorage/vdisk/scrub/scrub_actor_huge_blob_merger.h index 745c7a105c0..b4cc9dab073 100644 --- a/ydb/core/blobstorage/vdisk/scrub/scrub_actor_huge_blob_merger.h +++ b/ydb/core/blobstorage/vdisk/scrub/scrub_actor_huge_blob_merger.h @@ -45,7 +45,7 @@ namespace NKikimr { TDiskDataExtractor extr; memRec.GetDiskData(&extr, outbound); const NMatrix::TVectorType local = memRec.GetLocalParts(GType); - Y_ABORT_UNLESS(extr.End - extr.Begin == local.CountBits()); + Y_VERIFY_S(extr.End - extr.Begin == local.CountBits(), LogPrefix); const TDiskPart *part = extr.Begin; for (ui32 i = local.FirstPosition(); i != local.GetSize(); i = local.NextPosition(i), ++part) { if (part->ChunkIdx && part->Size) { diff --git a/ydb/core/blobstorage/vdisk/scrub/scrub_actor_pdisk.cpp b/ydb/core/blobstorage/vdisk/scrub/scrub_actor_pdisk.cpp index 22e93924194..68c55328fa8 100644 --- a/ydb/core/blobstorage/vdisk/scrub/scrub_actor_pdisk.cpp +++ b/ydb/core/blobstorage/vdisk/scrub/scrub_actor_pdisk.cpp @@ -3,8 +3,8 @@ namespace NKikimr { std::optional<TRcBuf> TScrubCoroImpl::Read(const TDiskPart& part) { - Y_ABORT_UNLESS(part.ChunkIdx); - Y_ABORT_UNLESS(part.Size); + Y_VERIFY_S(part.ChunkIdx, ScrubCtx->VCtx->VDiskLogPrefix); + Y_VERIFY_S(part.Size, ScrubCtx->VCtx->VDiskLogPrefix); auto msg = std::make_unique<NPDisk::TEvChunkRead>(ScrubCtx->PDiskCtx->Dsk->Owner, ScrubCtx->PDiskCtx->Dsk->OwnerRound, part.ChunkIdx, part.Offset, part.Size, NPriRead::HullLow, nullptr); ScrubCtx->VCtx->CountScrubCost(*msg); @@ -25,8 +25,8 @@ namespace NKikimr { } void TScrubCoroImpl::Write(const TDiskPart& part, TString data) { - Y_ABORT_UNLESS(part.ChunkIdx); - Y_ABORT_UNLESS(part.Size); + Y_VERIFY_S(part.ChunkIdx, ScrubCtx->VCtx->VDiskLogPrefix); + Y_VERIFY_S(part.Size, ScrubCtx->VCtx->VDiskLogPrefix); size_t alignedSize = data.size(); if (const size_t offset = alignedSize % ScrubCtx->PDiskCtx->Dsk->AppendBlockSize) { alignedSize += ScrubCtx->PDiskCtx->Dsk->AppendBlockSize - offset; @@ -47,7 +47,7 @@ namespace NKikimr { if (ScrubCtx->VCtx->CostTracker) { ScrubCtx->VCtx->CostTracker->CountPDiskResponse(); } - Y_ABORT_UNLESS(res->Get()->Status == NKikimrProto::OK); // FIXME: good logic + Y_VERIFY_S(res->Get()->Status == NKikimrProto::OK, ScrubCtx->VCtx->VDiskLogPrefix); // FIXME: good logic } } // NKikimr diff --git a/ydb/core/blobstorage/vdisk/scrub/scrub_actor_sst.cpp b/ydb/core/blobstorage/vdisk/scrub/scrub_actor_sst.cpp index a04f1583b72..32ed05d7d0a 100644 --- a/ydb/core/blobstorage/vdisk/scrub/scrub_actor_sst.cpp +++ b/ydb/core/blobstorage/vdisk/scrub/scrub_actor_sst.cpp @@ -39,9 +39,10 @@ namespace NKikimr { TString regen = TString::Uninitialized(part.Size); ui32 destLen = regen.size(); char *dest = regen.Detach() + destLen; - auto prepend = [&destLen, &dest](const void *data, ui32 len) { + const TString& logPrefix = LogPrefix; + auto prepend = [&destLen, &dest, &logPrefix](const void *data, ui32 len) { if (len) { - Y_ABORT_UNLESS(len <= destLen); + Y_VERIFY_S(len <= destLen, logPrefix); destLen -= len; dest -= len; memcpy(dest, data, len); @@ -74,7 +75,7 @@ namespace NKikimr { prepend(reinterpret_cast<const char*>(sst->LoadedIndex.data()) + remainIndexSize, isize); // fourth step: sanity check - Y_ABORT_UNLESS(!destLen); + Y_VERIFY_S(!destLen, LogPrefix); std::optional<TRcBuf> data = Read(part); if (!data) { @@ -102,15 +103,15 @@ namespace NKikimr { Checkpoints |= TEvScrubNotify::INDEX_RESTORED; } } else { - Y_ABORT_UNLESS(regen.size() == data->size(), "index size differs from one stored in memory"); + Y_VERIFY_S(regen.size() == data->size(), LogPrefix << "index size differs from one stored in memory"); const size_t headerLen = first ? sizeof(TIdxDiskPlaceHolder) : sizeof(TIdxDiskLinker); - Y_ABORT_UNLESS(memcmp(regen.data(), data->data(), part.Size - headerLen) == 0, - "index data differs from one stored in memory"); // compare index data up to header + Y_VERIFY_S(memcmp(regen.data(), data->data(), part.Size - headerLen) == 0, + LogPrefix << "index data differs from one stored in memory"); // compare index data up to header auto compare = [&](auto a, auto b) { - Y_ABORT_UNLESS(sizeof(a) == headerLen && sizeof(b) == headerLen); + Y_VERIFY_S(sizeof(a) == headerLen && sizeof(b) == headerLen, LogPrefix); memcpy(&a, regen.data() + regen.size() - headerLen, headerLen); // to prevent unaligned access memcpy(&b, data->data() + data->size() - headerLen, headerLen); - Y_ABORT_UNLESS(a == b, "index header differs from one stored in memory"); + Y_VERIFY_S(a == b, LogPrefix << "index header differs from one stored in memory"); }; if (first) { compare(TIdxDiskPlaceHolder(0), TIdxDiskPlaceHolder(0)); @@ -122,7 +123,7 @@ namespace NKikimr { prevPart = part; first = false; } - Y_ABORT_UNLESS(!remainOutboundSize && !remainIndexSize); + Y_VERIFY_S(!remainOutboundSize && !remainIndexSize, LogPrefix); } void TScrubCoroImpl::ReadOutSelectedBlobs(std::vector<TBlobOnDisk>&& blobsOnDisk) { @@ -183,7 +184,7 @@ namespace NKikimr { for (TBlobOnDisk *blob : blobs) { const TDiskPart& part = blob->Part; const ui32 end = part.Offset + part.Size; - Y_ABORT_UNLESS(part.ChunkIdx == chunkIdx); + Y_VERIFY_S(part.ChunkIdx == chunkIdx, LogPrefix); if (interval == TDiskPart()) { interval = blob->Part; } else if (end - interval.Offset <= ScrubCtx->PDiskCtx->Dsk->ReadBlockSize) { @@ -210,7 +211,7 @@ namespace NKikimr { iter.PutToMerger(&merger); NMatrix::TVectorType needed = blob.Needed; - Y_ABORT_UNLESS(!needed.Empty()); + Y_VERIFY_S(!needed.Empty(), LogPrefix); STLOGX(GetActorContext(), PRI_INFO, BS_VDISK_SCRUB, VDS11, VDISKP(LogPrefix, "reading out blob"), (SstId, SstId), (Id, blob.Id)); diff --git a/ydb/core/blobstorage/vdisk/scrub/scrub_actor_sst_blob_merger.h b/ydb/core/blobstorage/vdisk/scrub/scrub_actor_sst_blob_merger.h index bc83313406d..0c441a853f4 100644 --- a/ydb/core/blobstorage/vdisk/scrub/scrub_actor_sst_blob_merger.h +++ b/ydb/core/blobstorage/vdisk/scrub/scrub_actor_sst_blob_merger.h @@ -47,6 +47,7 @@ namespace NKikimr { }; class TScrubCoroImpl::TSstBlobMerger : public TBlobLocationExtractorMerger { + const TString VDiskLogPrefix; TLevelIndexSnapshot::TForwardIterator Iter; // whole database iterator to merge records for GC checking TIndexRecordMerger Merger; // merger for these records TIntrusivePtr<TBarriersSnapshot::TBarriersEssence> Essence; @@ -54,8 +55,10 @@ namespace NKikimr { std::optional<bool> KeepData; public: - TSstBlobMerger(const THullDsSnap& snap, TIntrusivePtr<TBarriersSnapshot::TBarriersEssence> essence) + TSstBlobMerger(const THullDsSnap& snap, + TIntrusivePtr<TBarriersSnapshot::TBarriersEssence> essence) : TBlobLocationExtractorMerger(snap.HullCtx->VCtx->Top->GType) + , VDiskLogPrefix(snap.HullCtx->VCtx->VDiskLogPrefix) , Iter(snap.HullCtx, &snap.LogoBlobsSnap) , Merger(GType) , Essence(std::move(essence)) @@ -87,16 +90,16 @@ namespace NKikimr { bool Keep(const TLogoBlobID& id) { if (!KeepData) { // seek to the desired key; the key MUST exist in the whole database - Y_ABORT_UNLESS(Iter.Valid()); - Y_ABORT_UNLESS(Iter.GetCurKey() <= id); + Y_VERIFY_S(Iter.Valid(), VDiskLogPrefix); + Y_VERIFY_S(Iter.GetCurKey() <= id, VDiskLogPrefix); if (Iter.GetCurKey() < id) { Iter.Next(); - Y_ABORT_UNLESS(Iter.Valid()); + Y_VERIFY_S(Iter.Valid(), VDiskLogPrefix); if (Iter.GetCurKey() < id) { Iter.Seek(id); } } - Y_ABORT_UNLESS(Iter.Valid() && Iter.GetCurKey() == id); + Y_VERIFY_S(Iter.Valid() && Iter.GetCurKey() == id, VDiskLogPrefix); // put iterator value to merger Iter.PutToMerger(&Merger); diff --git a/ydb/core/blobstorage/vdisk/scrub/scrub_actor_unreadable.cpp b/ydb/core/blobstorage/vdisk/scrub/scrub_actor_unreadable.cpp index 53bda971e23..04d326094f2 100644 --- a/ydb/core/blobstorage/vdisk/scrub/scrub_actor_unreadable.cpp +++ b/ydb/core/blobstorage/vdisk/scrub/scrub_actor_unreadable.cpp @@ -5,7 +5,7 @@ namespace NKikimr { void TScrubCoroImpl::DropGarbageBlob(const TLogoBlobID& fullId) { - Y_ABORT_UNLESS(!fullId.PartId()); + Y_VERIFY_S(!fullId.PartId(), LogPrefix); if (const auto it = UnreadableBlobs.find(fullId); it != UnreadableBlobs.end()) { STLOGX(GetActorContext(), PRI_NOTICE, BS_VDISK_SCRUB, VDS39, VDISKP(LogPrefix, "dropped garbage unreadable blob"), (BlobId, it->first), (UnreadableParts, it->second.UnreadableParts)); @@ -22,7 +22,7 @@ namespace NKikimr { } void TScrubCoroImpl::UpdateUnreadableParts(const TLogoBlobID& fullId, NMatrix::TVectorType corrupted, TDiskPart corruptedPart) { - Y_ABORT_UNLESS(!fullId.PartId()); + Y_VERIFY_S(!fullId.PartId(), LogPrefix); const auto it = UnreadableBlobs.find(fullId); const NMatrix::TVectorType prevCorrupted = it != UnreadableBlobs.end() @@ -56,7 +56,7 @@ namespace NKikimr { } void TScrubCoroImpl::UpdateReadableParts(const TLogoBlobID& fullId, NMatrix::TVectorType readable) { - Y_ABORT_UNLESS(!fullId.PartId()); + Y_VERIFY_S(!fullId.PartId(), LogPrefix); if (const auto it = UnreadableBlobs.find(fullId); it != UnreadableBlobs.end()) { STLOGX(GetActorContext(), PRI_NOTICE, BS_VDISK_SCRUB, VDS42, VDISKP(LogPrefix, "read parts of previously unreadable blob"), (BlobId, it->first), @@ -153,7 +153,7 @@ namespace NKikimr { } void TScrubCoroImpl::Handle(TEvTakeHullSnapshotResult::TPtr ev) { - Y_ABORT_UNLESS(GenerateRestoreCorruptedBlobQueryScheduled); + Y_VERIFY_S(GenerateRestoreCorruptedBlobQueryScheduled, LogPrefix); GenerateRestoreCorruptedBlobQueryScheduled = false; auto& snap = ev->Get()->Snap; diff --git a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_db.h b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_db.h index 5fa34194494..7e338930c18 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_db.h +++ b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_db.h @@ -77,13 +77,13 @@ namespace NKikimr { public: void SetVDiskIncarnationGuid(TVDiskIncarnationGuid g) { - Y_DEBUG_ABORT_UNLESS(!VDiskIncarnationGuidSet); + Y_VERIFY_DEBUG_S(!VDiskIncarnationGuidSet, VCtx->VDiskLogPrefix); VDiskIncarnationGuidSet = true; VDiskIncarnationGuid = g; } TVDiskIncarnationGuid GetVDiskIncarnationGuid(bool allowUnset = false) const { - Y_DEBUG_ABORT_UNLESS(VDiskIncarnationGuidSet || allowUnset); + Y_VERIFY_DEBUG_S(VDiskIncarnationGuidSet || allowUnset, VCtx->VDiskLogPrefix); return VDiskIncarnationGuid; } diff --git a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeleton.cpp b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeleton.cpp index 1250aa628d7..ccb5968b7fb 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeleton.cpp +++ b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeleton.cpp @@ -132,7 +132,7 @@ namespace NKikimr { case NKikimrBlobStorage::TGroupDecommitStatus_E_TGroupDecommitStatus_E_INT_MIN_SENTINEL_DO_NOT_USE_: case NKikimrBlobStorage::TGroupDecommitStatus_E_TGroupDecommitStatus_E_INT_MAX_SENTINEL_DO_NOT_USE_: - Y_DEBUG_ABORT_UNLESS(false); + Y_ABORT(); return true; } } @@ -208,7 +208,7 @@ namespace NKikimr { if (!ApplyHugeBlobSize(type.GetMinHugeBlobSizeInBytes())) { continue; } - Y_ABORT_UNLESS(MinHugeBlobInBytes); + Y_VERIFY_S(MinHugeBlobInBytes, VCtx->VDiskLogPrefix); if (Config->RunRepl) { ctx.Send(Db->ReplID, new TEvMinHugeBlobSizeUpdate(MinHugeBlobInBytes)); } @@ -449,7 +449,7 @@ namespace NKikimr { NActors::TActorId sender, ui64 cookie, NLWTrace::TOrbit &&orbit, NKikimrBlobStorage::EPutHandleClass handleClass, TVPutInfo &info, std::unique_ptr<TEvResult> result) { - Y_DEBUG_ABORT_UNLESS(info.HullStatus.Status == NKikimrProto::OK); + Y_VERIFY_DEBUG_S(info.HullStatus.Status == NKikimrProto::OK, VCtx->VDiskLogPrefix); const TLogoBlobID &id = info.BlobId; TRope &buffer = info.Buffer; const TLsnSeg &seg = info.Lsn; @@ -494,7 +494,7 @@ namespace NKikimr { ui64 cookie, bool ignoreBlock, NKikimrBlobStorage::EPutHandleClass handleClass, TVPutInfo &info, std::unique_ptr<TEvBlobStorage::TEvVPutResult> res, bool rewriteBlob) { - Y_DEBUG_ABORT_UNLESS(info.HullStatus.Status == NKikimrProto::OK); + Y_VERIFY_DEBUG_S(info.HullStatus.Status == NKikimrProto::OK, VCtx->VDiskLogPrefix); info.Buffer = TDiskBlob::Create(info.BlobId.BlobSize(), info.BlobId.PartId(), Db->GType.TotalPartCount(), std::move(info.Buffer), *Arena, HullCtx->AddHeader); UpdatePDiskWriteBytes(info.Buffer.GetSize()); @@ -689,7 +689,7 @@ namespace NKikimr { continue; } - Y_ABORT_UNLESS(lsnBatch.First <= lsnBatch.Last); + Y_VERIFY_S(lsnBatch.First <= lsnBatch.Last, VCtx->VDiskLogPrefix); info.Lsn = TLsnSeg(lsnBatch.First, lsnBatch.First); lsnBatch.First++; @@ -722,7 +722,7 @@ namespace NKikimr { } void HandlePutSyncGuidRecovery(TEvBlobStorage::TEvVPut::TPtr& ev, const TActorContext& ctx) { - Y_ABORT_UNLESS(ev->Get()->RewriteBlob); + Y_VERIFY_S(ev->Get()->RewriteBlob, VCtx->VDiskLogPrefix); Handle(ev, ctx); } @@ -1368,7 +1368,7 @@ namespace NKikimr { void Handle(TEvBlobStorage::TEvMonStreamActorDeathNote::TPtr& ev, const TActorContext& /*ctx*/) { auto it = MonStreamActors.find(ev->Get()->StreamId); - Y_ABORT_UNLESS(it != MonStreamActors.end()); + Y_VERIFY_S(it != MonStreamActors.end(), VCtx->VDiskLogPrefix); ActiveActors.Erase(it->second); MonStreamActors.erase(it); } @@ -1426,7 +1426,7 @@ namespace NKikimr { switch (opType) { case NKikimrBlobStorage::TEvVCompact::ASYNC: { - Y_ABORT_UNLESS(Db->LoggerID); + Y_VERIFY_S(Db->LoggerID, VCtx->VDiskLogPrefix); // forward this message to logger, because it knows correct lsn ctx.Send(ev->Forward(Db->LoggerID)); // reply back @@ -1460,7 +1460,7 @@ namespace NKikimr { } void Handle(TEvHullCompactResult::TPtr &ev, const TActorContext &ctx) { - Y_ABORT_UNLESS(VDiskCompactionState); + Y_VERIFY_S(VDiskCompactionState, VCtx->VDiskLogPrefix); VDiskCompactionState->Compacted(ctx, ev->Get()->RequestId, ev->Get()->Type, VCtx); } @@ -1487,7 +1487,7 @@ namespace NKikimr { if (!SelfVDiskId.SameDisk(record.GetVDiskID())) { ReplyError(NKikimrProto::RACE, "group generation mismatch", ev, ctx, now); } else { - Y_ABORT_UNLESS(Db->SyncLogID); + Y_VERIFY_S(Db->SyncLogID, VCtx->VDiskLogPrefix); // forward this message to SyncLog ctx.Send(ev->Forward(Db->SyncLogID)); // reply back @@ -1576,7 +1576,7 @@ namespace NKikimr { } #ifdef UNPACK_LOCALSYNCDATA - Y_ABORT_UNLESS(ev->Get()->Extracted.IsReady()); + Y_VERIFY_S(ev->Get()->Extracted.IsReady(), VCtx->VDiskLogPrefix); TLsnSeg seg = Hull->AllocateLsnForSyncDataCmd(ev->Get()->Extracted); #else TLsnSeg seg = Hull->AllocateLsnForSyncDataCmd(ev->Get()->Data); @@ -1740,8 +1740,8 @@ namespace NKikimr { TRope buf = std::move(msg->Data); const ui64 bufSize = buf.GetSize(); - Y_ABORT_UNLESS(bufSize <= Config->MaxLogoBlobDataSize, - "TEvRecoveredHugeBlob: blob is huge bufSize# %zu", bufSize); + Y_VERIFY_S(bufSize <= Config->MaxLogoBlobDataSize, VCtx->VDiskLogPrefix << + "TEvRecoveredHugeBlob: blob is huge bufSize# " << bufSize); UpdatePDiskWriteBytes(bufSize); auto oosStatus = VCtx->GetOutOfSpaceState().GetGlobalStatusFlags(); @@ -1781,7 +1781,7 @@ namespace NKikimr { } TString data; bool res = record.SerializeToString(&data); - Y_ABORT_UNLESS(res); + Y_VERIFY_S(res, VCtx->VDiskLogPrefix); intptr_t loggedRecId = LoggedRecsVault.Put(new TLoggedRecPhantoms(seg, true, ev)); void *loggedRecCookie = reinterpret_cast<void *>(loggedRecId); @@ -1808,7 +1808,7 @@ namespace NKikimr { // dump db TStringStream dump; typename TDumper::EDumpRes status = dumper.Dump(dump); - Y_ABORT_UNLESS(status == TDumper::EDumpRes::OK); + Y_VERIFY_S(status == TDumper::EDumpRes::OK, VCtx->VDiskLogPrefix); str << "========= " << VCtx->VDiskLogPrefix << " ==========\n"; str << dump.Str() << "\n"; @@ -1902,7 +1902,7 @@ namespace NKikimr { // check status if (ev->Get()->Status == NKikimrProto::OK) { ApplyHugeBlobSize(Config->MinHugeBlobInBytes); - Y_ABORT_UNLESS(MinHugeBlobInBytes); + Y_VERIFY_S(MinHugeBlobInBytes, VCtx->VDiskLogPrefix); // handle special case when donor disk starts and finds out that it has been wiped out if (ev->Get()->LsnMngr->GetOriginallyRecoveredLsn() == 0 && Config->BaseInfo.DonorMode) { @@ -1961,7 +1961,7 @@ namespace NKikimr { // run SyncLogActor std::unique_ptr<NSyncLog::TSyncLogRepaired> repairedSyncLog = std::move(ev->Get()->RepairedSyncLog); - Y_ABORT_UNLESS(SelfVDiskId == GInfo->GetVDiskId(VCtx->ShortSelfVDisk)); + Y_VERIFY_S(SelfVDiskId == GInfo->GetVDiskId(VCtx->ShortSelfVDisk), VCtx->VDiskLogPrefix); auto slCtx = MakeIntrusive<NSyncLog::TSyncLogCtx>( VCtx, Db->LsnMngr, @@ -1989,8 +1989,11 @@ namespace NKikimr { Db->LoggerID, Db->LogCutterID, ctx), ctx, NKikimrServices::BLOBSTORAGE); // create VDiskCompactionState - VDiskCompactionState = std::make_unique<TVDiskCompactionState>(Hull->GetHullDs()->LogoBlobs->LIActor, - Hull->GetHullDs()->Blocks->LIActor, Hull->GetHullDs()->Barriers->LIActor); + VDiskCompactionState = std::make_unique<TVDiskCompactionState>( + VCtx->VDiskLogPrefix, + Hull->GetHullDs()->LogoBlobs->LIActor, + Hull->GetHullDs()->Blocks->LIActor, + Hull->GetHullDs()->Barriers->LIActor); // initialize Out Of Space Logic OutOfSpaceLogic = std::make_shared<TOutOfSpaceLogic>(VCtx, Hull); @@ -2326,8 +2329,8 @@ namespace NKikimr { std::unique_ptr<NPDisk::TEvCutLog> msg(ev->Release().Release()); if (LocalDbInitialized) { - Y_DEBUG_ABORT_UNLESS(msg->Owner == PDiskCtx->Dsk->Owner); - Y_ABORT_UNLESS(!CutLogDelayedMsg); + Y_VERIFY_DEBUG_S(msg->Owner == PDiskCtx->Dsk->Owner, VCtx->VDiskLogPrefix); + Y_VERIFY_S(!CutLogDelayedMsg, VCtx->VDiskLogPrefix); LOG_DEBUG_S(ctx, BS_LOGCUTTER, VCtx->VDiskLogPrefix << "Handle " << msg->ToString() << " actorid# " << ctx.SelfID.ToString() @@ -2343,7 +2346,7 @@ namespace NKikimr { } void SpreadCutLog(std::unique_ptr<NPDisk::TEvCutLog> msg, const TActorContext &ctx) { - Y_DEBUG_ABORT_UNLESS(msg->Owner == PDiskCtx->Dsk->Owner); + Y_VERIFY_DEBUG_S(msg->Owner == PDiskCtx->Dsk->Owner, VCtx->VDiskLogPrefix); ui32 counter = 0; // setup FreeUpToLsn for Hull Database @@ -2392,9 +2395,9 @@ namespace NKikimr { LocalDbInitialized = true; if (CutLogDelayedMsg) { - Y_DEBUG_ABORT_UNLESS(CutLogDelayedMsg->Owner == PDiskCtx->Dsk->Owner); + Y_VERIFY_DEBUG_S(CutLogDelayedMsg->Owner == PDiskCtx->Dsk->Owner, VCtx->VDiskLogPrefix); SpreadCutLog(std::exchange(CutLogDelayedMsg, nullptr), ctx); - Y_ABORT_UNLESS(!CutLogDelayedMsg); + Y_VERIFY_S(!CutLogDelayedMsg, VCtx->VDiskLogPrefix); } } @@ -2588,7 +2591,7 @@ namespace NKikimr { void CheckSnapshotExpiration(TAutoPtr<IEventHandle> ev, const TActorContext& ctx) { auto schedIt = std::find(SnapshotExpirationCheckSchedule.begin(), SnapshotExpirationCheckSchedule.end(), TMonotonic::FromValue(ev->Cookie)); - Y_ABORT_UNLESS(schedIt != SnapshotExpirationCheckSchedule.end()); + Y_VERIFY_S(schedIt != SnapshotExpirationCheckSchedule.end(), VCtx->VDiskLogPrefix); SnapshotExpirationCheckSchedule.erase(schedIt); const TMonotonic now = ctx.Monotonic(); diff --git a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonerr.h b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonerr.h index fc77f756829..66ec6667866 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonerr.h +++ b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonerr.h @@ -290,7 +290,7 @@ namespace NKikimr { auto result = std::make_unique<TEvBlobStorage::TEvVMultiPutResult>(status, vdiskID, cookie, now, ev->Get()->GetCachedByteSize(), &record, skeletonFrontIDPtr, counterPtr, histoPtr, bufferSizeBytes, vdiskIncarnationGuid, errorReason); - Y_ABORT_UNLESS(record.ItemsSize() == statuses.size()); + Y_VERIFY_S(record.ItemsSize() == statuses.size(), vctx->VDiskLogPrefix); for (ui64 itemIdx = 0; itemIdx < record.ItemsSize(); ++itemIdx) { auto &item = record.GetItems(itemIdx); ui64 cookieValue = 0; diff --git a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonfront.cpp b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonfront.cpp index 54c09daf775..17eddf7d5aa 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonfront.cpp +++ b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonfront.cpp @@ -160,6 +160,7 @@ namespace NKikimr { }; private: + const TString VDiskLogPrefix; std::unique_ptr<TQueueType, TQueueType::TCleanDestructor> Queue; ui64 InFlightCount; ui64 InFlightCost; @@ -195,12 +196,14 @@ namespace NKikimr { public: TIntQueueClass( + const TString& logPrefix, const NKikimrBlobStorage::EVDiskInternalQueueId intQueueId, const TString &name, ui64 maxInFlightCount, ui64 maxInFlightCost, TIntrusivePtr<::NMonitoring::TDynamicCounters> skeletonFrontGroup) - : Queue(new TQueueType()) + : VDiskLogPrefix(logPrefix) + , Queue(new TQueueType()) , InFlightCount(0) , InFlightCost(0) , InFlightBytes(0) @@ -277,7 +280,7 @@ namespace NKikimr { const ui64 cost = rec->Cost; if (CanSendToSkeleton(cost) || forceError) { ui32 recByteSize = rec->ByteSize; - Y_DEBUG_ABORT_UNLESS(DelayedCount > 0 && DelayedBytes >= recByteSize); + Y_VERIFY_DEBUG_S(DelayedCount > 0 && DelayedBytes >= recByteSize, VDiskLogPrefix); --DelayedCount; DelayedBytes -= recByteSize; @@ -326,11 +329,14 @@ namespace NKikimr { return; } - Y_ABORT_UNLESS(InFlightCount >= 1 && InFlightBytes >= msgCtx.RecByteSize && InFlightCost >= msgCtx.Cost, - "IntQueueId# %s InFlightCount# %" PRIu64 " InFlightBytes# %" PRIu64 - " InFlightCost# %" PRIu64 " msgCtx# %s Deadlines# %" PRIu64, - NKikimrBlobStorage::EVDiskInternalQueueId_Name(IntQueueId).data(), - InFlightCount, InFlightBytes, InFlightCost, msgCtx.ToString().data(), Deadlines); + Y_VERIFY_S(InFlightCount >= 1 && InFlightBytes >= msgCtx.RecByteSize && InFlightCost >= msgCtx.Cost, + VDiskLogPrefix + << "IntQueueId# " << NKikimrBlobStorage::EVDiskInternalQueueId_Name(IntQueueId) + << " InFlightCount# " << InFlightCount + << " InFlightBytes# " << InFlightBytes + << " InFlightCost# " << InFlightCost + << " msgCtx# " << msgCtx.ToString() + << " Deadlines# " << Deadlines); --InFlightCount; InFlightCost -= msgCtx.Cost; @@ -342,7 +348,7 @@ namespace NKikimr { *SkeletonFrontCostProcessed += msgCtx.Cost; const size_t numErased = Msgs.erase(msgCtx.InternalMessageId); - Y_ABORT_UNLESS(numErased == 1); + Y_VERIFY_S(numErased == 1, VDiskLogPrefix); UpdateState(); ProcessNext(ctx, front, false); @@ -475,6 +481,7 @@ namespace NKikimr { //////////////////////////////////////////////////////////////////////////// class TExtQueueClass { private: + TString VDiskLogPrefix; std::unique_ptr<TMyQueueBackpressure> QueueBackpressure; NKikimrBlobStorage::EVDiskQueueId ExtQueueId; TString Name; @@ -499,9 +506,13 @@ namespace NKikimr { } public: - TExtQueueClass(NKikimrBlobStorage::EVDiskQueueId extQueueId, const TString &name, ui64 totalCost, - bool checkMsgId, TIntrusivePtr<::NMonitoring::TDynamicCounters> skeletonFrontGroup, - const TIntrusivePtr<TVDiskConfig>& config) + TExtQueueClass( + NKikimrBlobStorage::EVDiskQueueId extQueueId, + const TString &name, + ui64 totalCost, + bool checkMsgId, + TIntrusivePtr<::NMonitoring::TDynamicCounters> skeletonFrontGroup, + const TIntrusivePtr<TVDiskConfig>& config) : QueueBackpressure() , ExtQueueId(extQueueId) , Name(name) @@ -523,6 +534,10 @@ namespace NKikimr { config->WindowTimeout); } + void SetVDiskLogPrefix(const TString& logPrefix) { + VDiskLogPrefix = logPrefix; + } + std::optional<NBackpressure::TMessageId> GetExpectedMsgId(const TActorId& actorId) const { return QueueBackpressure->GetExpectedMsgId(actorId); } @@ -580,7 +595,7 @@ namespace NKikimr { void Completed(const TActorContext &ctx, const TVMsgContext &msgCtx, std::unique_ptr<IEventHandle> &evHandle) { TInstant now = TAppData::TimeProvider->Now(); - Y_ABORT_UNLESS(msgCtx.ActorId); + Y_VERIFY_S(msgCtx.ActorId, VDiskLogPrefix); auto feedback = QueueBackpressure->Processed(msgCtx.ActorId, msgCtx.MsgId, msgCtx.Cost, now); NKikimrBlobStorage::TMsgQoS *msgQoS = nullptr; switch (evHandle->Type) { @@ -599,7 +614,7 @@ namespace NKikimr { UPDATE_WINDOW_STATUS(TEvBlobStorage::TEvVGetBarrierResult) #undef UPDATE_WINDOW_STATUS } - Y_ABORT_UNLESS(msgQoS); + Y_VERIFY_S(msgQoS, VDiskLogPrefix); feedback.first.Serialize(*msgQoS->MutableWindow()); NotifyOtherClients(ctx, feedback); } @@ -728,7 +743,7 @@ namespace NKikimr { void SetupMonitoring(const TActorContext &ctx) { TAppData *appData = AppData(ctx); - Y_ABORT_UNLESS(appData); + Y_VERIFY_S(appData, VCtx->VDiskLogPrefix); auto mon = appData->Mon; if (mon) { NMonitoring::TIndexMonPage *actorsMonPage = mon->RegisterIndexPage("actors", "Actors"); @@ -751,48 +766,63 @@ namespace NKikimr { // create IntQueues IntQueueAsyncGets = std::make_unique<TIntQueueClass>( + VCtx->VDiskLogPrefix, NKikimrBlobStorage::EVDiskInternalQueueId::IntGetAsync, "AsyncGets", Config->SkeletonFrontGets_MaxInFlightCount, Config->SkeletonFrontGets_MaxInFlightCost, SkeletonFrontGroup); IntQueueFastGets = std::make_unique<TIntQueueClass>( + VCtx->VDiskLogPrefix, NKikimrBlobStorage::EVDiskInternalQueueId::IntGetFast, "FastGets", Config->SkeletonFrontGets_MaxInFlightCount, Config->SkeletonFrontGets_MaxInFlightCost, SkeletonFrontGroup); IntQueueDiscover = std::make_unique<TIntQueueClass>( + VCtx->VDiskLogPrefix, NKikimrBlobStorage::EVDiskInternalQueueId::IntGetDiscover, "DiscoverGets", Config->SkeletonFrontDiscover_MaxInFlightCount, Config->SkeletonFrontDiscover_MaxInFlightCost, SkeletonFrontGroup); IntQueueLowGets = std::make_unique<TIntQueueClass>( + VCtx->VDiskLogPrefix, NKikimrBlobStorage::EVDiskInternalQueueId::IntLowRead, "FastGets", Config->SkeletonFrontGets_MaxInFlightCount, Config->SkeletonFrontGets_MaxInFlightCost, SkeletonFrontGroup); IntQueueLogPuts = std::make_unique<TIntQueueClass>( + VCtx->VDiskLogPrefix, NKikimrBlobStorage::EVDiskInternalQueueId::IntPutLog, "LogPuts", Config->SkeletonFrontLogPuts_MaxInFlightCount, Config->SkeletonFrontLogPuts_MaxInFlightCost, SkeletonFrontGroup); IntQueueHugePutsForeground = std::make_unique<TIntQueueClass>( + VCtx->VDiskLogPrefix, NKikimrBlobStorage::EVDiskInternalQueueId::IntPutHugeForeground, "HugePutsForeground", Config->SkeletonFrontHugePuts_MaxInFlightCount, Config->SkeletonFrontHugePuts_MaxInFlightCost, SkeletonFrontGroup); IntQueueHugePutsBackground = std::make_unique<TIntQueueClass>( + VCtx->VDiskLogPrefix, NKikimrBlobStorage::EVDiskInternalQueueId::IntPutHugeBackground, "HugePutsBackground", Config->SkeletonFrontHugePuts_MaxInFlightCount, Config->SkeletonFrontHugePuts_MaxInFlightCost, SkeletonFrontGroup); + ExtQueueAsyncGets.SetVDiskLogPrefix(VCtx->VDiskLogPrefix); + ExtQueueFastGets.SetVDiskLogPrefix(VCtx->VDiskLogPrefix); + ExtQueueDiscoverGets.SetVDiskLogPrefix(VCtx->VDiskLogPrefix); + ExtQueueLowGets.SetVDiskLogPrefix(VCtx->VDiskLogPrefix); + ExtQueueTabletLogPuts.SetVDiskLogPrefix(VCtx->VDiskLogPrefix); + ExtQueueAsyncBlobPuts.SetVDiskLogPrefix(VCtx->VDiskLogPrefix); + ExtQueueUserDataPuts.SetVDiskLogPrefix(VCtx->VDiskLogPrefix); + UpdateWhiteboard(ctx); // create and run skeleton @@ -1143,9 +1173,10 @@ namespace NKikimr { template <class TEventPtr> inline void CheckEvent(TEventPtr &ev, const char *msgName) { - Y_DEBUG_ABORT_UNLESS(VCtx->CostModel); - Y_ABORT_UNLESS(ev->Get(), "Incoming message of type %s is null at the VDisk border. This MUST never happens, " - "check VDisk clients: bufSize# %u", msgName, unsigned(ev->GetSize())); + Y_VERIFY_DEBUG_S(VCtx->CostModel, VCtx->VDiskLogPrefix); + Y_VERIFY_S(ev->Get(), VCtx->VDiskLogPrefix + << "Incoming message of type " << msgName << " is null at the VDisk border. This MUST never happen, " + << "check VDisk clients: bufSize# " << unsigned(ev->GetSize())); } template <class TEventPtr> @@ -1269,9 +1300,10 @@ namespace NKikimr { // we don't work if queues are incompatible bool compatible = Compatible(extQueueId, intQueueId); - Y_ABORT_UNLESS(compatible, "%s: %s: extQueue is incompatible with intQueue; intQueue# %s extQueue# %s", - VCtx->VDiskLogPrefix.data(), msgName, NKikimrBlobStorage::EVDiskInternalQueueId_Name(intQueueId).data(), - NKikimrBlobStorage::EVDiskQueueId_Name(extQueueId).data()); + Y_VERIFY_S(compatible, VCtx->VDiskLogPrefix + << msgName << ": extQueue is incompatible with intQueue; intQueue# " + << NKikimrBlobStorage::EVDiskInternalQueueId_Name(intQueueId) << " extQueue# " + << NKikimrBlobStorage::EVDiskQueueId_Name(extQueueId)); LOG_TRACE_S(TActivationContext::AsActorContext(), NKikimrServices::BS_REQUEST_COST, "SkeletonFront Request Type# " << TypeName(*ev) << " Cost# " << cost << @@ -1334,7 +1366,7 @@ namespace NKikimr { /*GetLowRead*/ {false, false, false, false, false, false, false, true} }; - Y_DEBUG_ABORT_UNLESS(int(extId) >= 0 && int(extId) <= 7 && int(intId) >= 0 && int(intId) <= 7); + Y_VERIFY_DEBUG_S(int(extId) >= 0 && int(extId) <= 7 && int(intId) >= 0 && int(intId) <= 7, VCtx->VDiskLogPrefix); return compatibilityMatrix[extId][intId]; } @@ -1439,7 +1471,7 @@ namespace NKikimr { void Handle(TEvBlobStorage::TEvVGet::TPtr &ev, const TActorContext &ctx) { const ui64 cost = VCtx->CostModel->GetCost(*ev->Get()); // select correct internal queue - Y_ABORT_UNLESS(ev->Get()->Record.HasHandleClass()); + Y_VERIFY_S(ev->Get()->Record.HasHandleClass(), VCtx->VDiskLogPrefix); auto cls = ev->Get()->Record.GetHandleClass(); NKikimrBlobStorage::EVDiskInternalQueueId intQueueId; switch (cls) { @@ -1497,14 +1529,14 @@ namespace NKikimr { LOG_CRIT_S(ctx, NKikimrServices::BS_SKELETON, VCtx->VDiskLogPrefix << "VDiskId mismatch expected# " << SelfVDiskId << " provided# " << vdiskId << " Marker# BSVSF05"); - Y_DEBUG_ABORT("VDiskId mismatch"); + Y_DEBUG_ABORT_S(VCtx->VDiskLogPrefix << "VDiskId mismatch"); return Reply(ev, ctx, NKikimrProto::ERROR, "VDiskId mismatch", TAppData::TimeProvider->Now()); } if (vdiskId != SelfVDiskId) { if (SelfVDiskId.GroupGeneration < vdiskId.GroupGeneration && record.HasRecentGroup()) { auto newInfo = TBlobStorageGroupInfo::Parse(record.GetRecentGroup(), nullptr, nullptr); ChangeGeneration(vdiskId, newInfo, ctx); - Y_ABORT_UNLESS(vdiskId == SelfVDiskId); + Y_VERIFY_S(vdiskId == SelfVDiskId, VCtx->VDiskLogPrefix); const TGroupId groupId = newInfo->GroupID; const ui32 generation = newInfo->GroupGeneration; auto ev = std::make_unique<TEvBlobStorage::TEvUpdateGroupInfo>(groupId, generation, *newInfo->Group); @@ -1517,7 +1549,7 @@ namespace NKikimr { std::optional<NBackpressure::TMessageId> expectedMsgId; if (record.HasQoS()) { const auto& qos = record.GetQoS(); - Y_DEBUG_ABORT_UNLESS(qos.HasExtQueueId()); + Y_VERIFY_DEBUG_S(qos.HasExtQueueId(), VCtx->VDiskLogPrefix); if (qos.HasExtQueueId()) { auto& queue = GetExtQueue(qos.GetExtQueueId()); expectedMsgId = queue.GetExpectedMsgId(ev->Sender); @@ -1662,18 +1694,19 @@ namespace NKikimr { void ChangeGeneration(const TVDiskID& vdiskId, const TIntrusivePtr<TBlobStorageGroupInfo>& info, const TActorContext& ctx) { // check group id - Y_ABORT_UNLESS(info->GroupID == GInfo->GroupID, "GroupId# %" PRIu32 " new GroupId# %" PRIu32, - GInfo->GroupID.GetRawId(), info->GroupID.GetRawId()); + Y_VERIFY_S(info->GroupID == GInfo->GroupID, VCtx->VDiskLogPrefix + << "GroupId# " << GInfo->GroupID.GetRawId() << " new GroupId# " << info->GroupID.GetRawId()); // check target disk id - Y_ABORT_UNLESS(TVDiskIdShort(SelfVDiskId) == TVDiskIdShort(vdiskId), "Incorrect target VDiskId" - " SelfVDiskId# %s new VDiskId# %s", SelfVDiskId.ToString().data(), vdiskId.ToString().data()); + Y_VERIFY_S(TVDiskIdShort(SelfVDiskId) == TVDiskIdShort(vdiskId), VCtx->VDiskLogPrefix + << "Incorrect target VDiskId" + << " SelfVDiskId# " << SelfVDiskId.ToString() << " new VDiskId# " << vdiskId.ToString()); // check the disk location inside group - Y_ABORT_UNLESS(info->GetVDiskId(TVDiskIdShort(vdiskId)) == vdiskId); + Y_VERIFY_S(info->GetVDiskId(TVDiskIdShort(vdiskId)) == vdiskId, VCtx->VDiskLogPrefix); // check that NewInfo has the same topology as the one VDisk started with - Y_ABORT_UNLESS(VCtx->Top->EqualityCheck(info->GetTopology())); + Y_VERIFY_S(VCtx->Top->EqualityCheck(info->GetTopology()), VCtx->VDiskLogPrefix); // check generation for possible race if (info->GroupGeneration <= GInfo->GroupGeneration) { @@ -2029,7 +2062,7 @@ namespace NKikimr { LOG_CRIT_S(ctx, NKikimrServices::BS_SKELETON, VCtx->VDiskLogPrefix << "VDiskId mismatch expected# " << SelfVDiskId << " provided# " << vdiskId << " Type# " << TypeName<TEventType>() << " Marker# BSVSF06"); - Y_DEBUG_ABORT("VDiskId mismatch"); + Y_DEBUG_ABORT_S(VCtx->VDiskLogPrefix << "VDiskId mismatch"); return Reply(ev, ctx, NKikimrProto::ERROR, "VDiskId mismatch", TAppData::TimeProvider->Now()); } else if (!vdiskId.SameDisk(SelfVDiskId)) { return Reply(ev, ctx, NKikimrProto::RACE, "group generation mismatch", TAppData::TimeProvider->Now()); @@ -2158,7 +2191,7 @@ namespace NKikimr { HFuncStatus(TEvBlobStorage::TEvVGetBlock, status, errorReason, now, wstatus); HFuncStatus(TEvBlobStorage::TEvVCollectGarbage, status, errorReason, now, wstatus); HFuncStatus(TEvBlobStorage::TEvVGetBarrier, status, errorReason, now, wstatus); - default: Y_DEBUG_ABORT("Unsupported message %d", ev->GetTypeRewrite()); + default: Y_DEBUG_ABORT_S(VCtx->VDiskLogPrefix << "Unsupported message " << ev->GetTypeRewrite()); } } diff --git a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_syncfull.cpp b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_syncfull.cpp index 3affa6b5f02..f2d9842f2ee 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_syncfull.cpp +++ b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_syncfull.cpp @@ -104,14 +104,14 @@ namespace NKikimr { pres = Process(ctx, FullSnap.LogoBlobsSnap, KeyLogoBlob, LogoBlobFilter); if (pres & (MsgFullFlag | LongProcessing)) break; - Y_ABORT_UNLESS(pres & EmptyFlag); + Y_VERIFY_S(pres & EmptyFlag, HullCtx->VCtx->VDiskLogPrefix); [[fallthrough]]; case NKikimrBlobStorage::Blocks: Stage = NKikimrBlobStorage::Blocks; pres = Process(ctx, FullSnap.BlocksSnap, KeyBlock, FakeFilter); if (pres & (MsgFullFlag | LongProcessing)) break; - Y_ABORT_UNLESS(pres & EmptyFlag); + Y_VERIFY_S(pres & EmptyFlag, HullCtx->VCtx->VDiskLogPrefix); [[fallthrough]]; case NKikimrBlobStorage::Barriers: Stage = NKikimrBlobStorage::Barriers; diff --git a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_syncfullhandler.cpp b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_syncfullhandler.cpp index 39a5d901719..0073fc6a75f 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_syncfullhandler.cpp +++ b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_syncfullhandler.cpp @@ -78,7 +78,7 @@ namespace NKikimr { return; } - Y_DEBUG_ABORT_UNLESS(SourceVDisk != SelfVDiskId); + Y_VERIFY_DEBUG_S(SourceVDisk != SelfVDiskId, HullCtx->VCtx->VDiskLogPrefix); Run(ctx, clientSyncState); } diff --git a/ydb/core/blobstorage/vdisk/skeleton/skeleton_block_and_get.cpp b/ydb/core/blobstorage/vdisk/skeleton/skeleton_block_and_get.cpp index d2eadac371b..2f4b3f76231 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/skeleton_block_and_get.cpp +++ b/ydb/core/blobstorage/vdisk/skeleton/skeleton_block_and_get.cpp @@ -30,9 +30,9 @@ public: , VDiskIncarnationGuid(vDiskIncarnationGuid) , GInfo(gInfo) { - Y_ABORT_UNLESS(ev->Get()->Record.HasForceBlockTabletData()); - Y_ABORT_UNLESS(ev->Get()->Record.GetForceBlockTabletData().HasId()); - Y_ABORT_UNLESS(ev->Get()->Record.GetForceBlockTabletData().HasGeneration()); + Y_VERIFY_S(ev->Get()->Record.HasForceBlockTabletData(), VCtx->VDiskLogPrefix); + Y_VERIFY_S(ev->Get()->Record.GetForceBlockTabletData().HasId(), VCtx->VDiskLogPrefix); + Y_VERIFY_S(ev->Get()->Record.GetForceBlockTabletData().HasGeneration(), VCtx->VDiskLogPrefix); Request = std::move(ev); } diff --git a/ydb/core/blobstorage/vdisk/skeleton/skeleton_compactionstate.cpp b/ydb/core/blobstorage/vdisk/skeleton/skeleton_compactionstate.cpp index 869c0a228ff..31753307072 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/skeleton_compactionstate.cpp +++ b/ydb/core/blobstorage/vdisk/skeleton/skeleton_compactionstate.cpp @@ -8,10 +8,12 @@ namespace NKikimr { TVDiskCompactionState::TVDiskCompactionState( + const TString& logPrefix, TActorId logoBlobsActorId, TActorId blocksActorId, TActorId barriersActorId) - : LogoBlobsActorId(logoBlobsActorId) + : VDiskLogPrefix(logPrefix) + , LogoBlobsActorId(logoBlobsActorId) , BlocksActorId(blocksActorId) , BarriersActorId(barriersActorId) {} @@ -20,7 +22,7 @@ namespace NKikimr { ui64 requestId = ++RequestIdCounter; const auto mode = cReq.Mode; auto insRes = Requests.insert({requestId, std::move(cReq)}); - Y_ABORT_UNLESS(insRes.second); + Y_VERIFY_S(insRes.second, VDiskLogPrefix); auto &req = insRes.first->second; if (req.CompactLogoBlobs) { @@ -35,7 +37,7 @@ namespace NKikimr { } void TVDiskCompactionState::Setup(const TActorContext &ctx, std::optional<ui64> lsn, TCompactionReq cReq) { - Y_ABORT_UNLESS(!cReq.AllDone()); + Y_VERIFY_S(!cReq.AllDone(), VDiskLogPrefix); if (!lsn && WaitQueue.empty()) { SendLocalCompactCmd(ctx, std::move(cReq)); } else { @@ -49,7 +51,7 @@ namespace NKikimr { EHullDbType dbType, const TIntrusivePtr<TVDiskContext>& vCtx) { auto it = Requests.find(reqId); - Y_ABORT_UNLESS(it != Requests.end()); + Y_VERIFY_S(it != Requests.end(), VDiskLogPrefix); auto &req = it->second; switch (dbType) { diff --git a/ydb/core/blobstorage/vdisk/skeleton/skeleton_compactionstate.h b/ydb/core/blobstorage/vdisk/skeleton/skeleton_compactionstate.h index b2ada9d163e..9f4430aec19 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/skeleton_compactionstate.h +++ b/ydb/core/blobstorage/vdisk/skeleton/skeleton_compactionstate.h @@ -23,7 +23,8 @@ namespace NKikimr { bool AllDone() const { return !(CompactLogoBlobs || CompactBlocks || CompactBarriers); } }; - TVDiskCompactionState(TActorId logoBlobsActorId, TActorId blocksActorId, TActorId barriersActorId); + TVDiskCompactionState(const TString& logPrefix, + TActorId logoBlobsActorId, TActorId blocksActorId, TActorId barriersActorId); // setup input compaction request void Setup(const TActorContext &ctx, std::optional<ui64> lsn, TCompactionReq cState); // when hull db reports compaction finish we change state by calling this function @@ -42,6 +43,7 @@ namespace NKikimr { void RenderHtml(IOutputStream &str, TDbMon::ESubRequestID subId) const; private: + const TString VDiskLogPrefix; // Actor ids for Hull Dbs TActorId LogoBlobsActorId; TActorId BlocksActorId; diff --git a/ydb/core/blobstorage/vdisk/skeleton/skeleton_oos_tracker.cpp b/ydb/core/blobstorage/vdisk/skeleton/skeleton_oos_tracker.cpp index c4375b43eeb..c4affd614c0 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/skeleton_oos_tracker.cpp +++ b/ydb/core/blobstorage/vdisk/skeleton/skeleton_oos_tracker.cpp @@ -82,8 +82,9 @@ namespace NKikimr { CHECK_PDISK_RESPONSE(VCtx, ev, ctx); - Y_ABORT_UNLESS(msg->Status == NKikimrProto::OK, "Expected OK from PDisk on every TEvCheckSpace request, " - "but got Status# %s", NKikimrProto::EReplyStatus_Name(msg->Status).data()); + Y_VERIFY_S(msg->Status == NKikimrProto::OK, VCtx->VDiskLogPrefix + << "Expected OK from PDisk on every TEvCheckSpace request, " + << "but got Status# " << NKikimrProto::EReplyStatus_Name(msg->Status)); TotalChunks = msg->TotalChunks; FreeChunks = msg->FreeChunks; @@ -107,7 +108,7 @@ namespace NKikimr { } void Handle(NMon::TEvHttpInfo::TPtr &ev, const TActorContext &ctx) { - Y_DEBUG_ABORT_UNLESS(ev->Get()->SubRequestId == TDbMon::DskSpaceTrackerId); + Y_VERIFY_DEBUG_S(ev->Get()->SubRequestId == TDbMon::DskSpaceTrackerId, VCtx->VDiskLogPrefix); TStringStream str; auto oosStatus = VCtx->OutOfSpaceState.GetGlobalStatusFlags(); diff --git a/ydb/core/blobstorage/vdisk/skeleton/skeleton_shred.cpp b/ydb/core/blobstorage/vdisk/skeleton/skeleton_shred.cpp index 4170c1a3ff1..b31e603799c 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/skeleton_shred.cpp +++ b/ydb/core/blobstorage/vdisk/skeleton/skeleton_shred.cpp @@ -85,9 +85,9 @@ namespace NKikimr { if (const auto it = ChunkTypes.find(chunkId); it != ChunkTypes.end()) { it->second = type; FoundAnyChunks = true; - Y_DEBUG_ABORT_UNLESS(ChunksToShred.contains(chunkId)); + Y_VERIFY_DEBUG_S(ChunksToShred.contains(chunkId), ShredCtx->VCtx->VDiskLogPrefix); } else { - Y_DEBUG_ABORT_UNLESS(!ChunksToShred.contains(chunkId)); + Y_VERIFY_DEBUG_S(!ChunksToShred.contains(chunkId), ShredCtx->VCtx->VDiskLogPrefix); } } }; @@ -156,9 +156,9 @@ namespace NKikimr { STLOG(PRI_DEBUG, BS_SHRED, BSSV13, ShredCtx->VCtx->VDiskLogPrefix << "going to compact SST", (SstId, seg.AssignedSstId), (AllChunks, seg.AllChunks)); FoundAnyChunks = true; - Y_DEBUG_ABORT_UNLESS(ChunksToShred.contains(chunkId)); + Y_VERIFY_DEBUG_S(ChunksToShred.contains(chunkId), ShredCtx->VCtx->VDiskLogPrefix); } else { - Y_DEBUG_ABORT_UNLESS(!ChunksToShred.contains(chunkId)); + Y_VERIFY_DEBUG_S(!ChunksToShred.contains(chunkId), ShredCtx->VCtx->VDiskLogPrefix); } } diff --git a/ydb/core/blobstorage/vdisk/skeleton/skeleton_vmovedpatch_actor.cpp b/ydb/core/blobstorage/vdisk/skeleton/skeleton_vmovedpatch_actor.cpp index b44857df937..7a50c592f63 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/skeleton_vmovedpatch_actor.cpp +++ b/ydb/core/blobstorage/vdisk/skeleton/skeleton_vmovedpatch_actor.cpp @@ -49,13 +49,13 @@ namespace NKikimr { , VCtx(vCtx) { NKikimrBlobStorage::TEvVMovedPatch &record = Event->Get()->Record; - Y_ABORT_UNLESS(record.HasOriginalGroupId()); + Y_VERIFY_S(record.HasOriginalGroupId(), VCtx->VDiskLogPrefix); OriginalGroupId = record.GetOriginalGroupId(); - Y_ABORT_UNLESS(record.HasPatchedGroupId()); + Y_VERIFY_S(record.HasPatchedGroupId(), VCtx->VDiskLogPrefix); PatchedGroupId = record.GetPatchedGroupId(); - Y_ABORT_UNLESS(record.HasOriginalBlobId()); + Y_VERIFY_S(record.HasOriginalBlobId(), VCtx->VDiskLogPrefix); OriginalId = LogoBlobIDFromLogoBlobID(record.GetOriginalBlobId()); - Y_ABORT_UNLESS(record.HasPatchedBlobId()); + Y_VERIFY_S(record.HasPatchedBlobId(), VCtx->VDiskLogPrefix); PatchedId = LogoBlobIDFromLogoBlobID(record.GetPatchedBlobId()); Deadline = TInstant::Seconds(record.GetMsgQoS().HasDeadlineSeconds()); if (record.HasMsgQoS() && record.GetMsgQoS().HasDeadlineSeconds()) { @@ -66,9 +66,9 @@ namespace NKikimr { Diffs.reset(new TEvBlobStorage::TEvPatch::TDiff[DiffCount]); for (ui32 idx = 0; idx < DiffCount; ++idx) { const NKikimrBlobStorage::TDiffBlock &diff = record.GetDiffs(idx); - Y_ABORT_UNLESS(diff.HasOffset()); + Y_VERIFY_S(diff.HasOffset(), VCtx->VDiskLogPrefix); Diffs[idx].Offset = diff.GetOffset(); - Y_ABORT_UNLESS(diff.HasBuffer()); + Y_VERIFY_S(diff.HasBuffer(), VCtx->VDiskLogPrefix); Diffs[idx].Buffer = TRcBuf(diff.GetBuffer()); } } diff --git a/ydb/core/blobstorage/vdisk/skeleton/skeleton_vmultiput_actor.cpp b/ydb/core/blobstorage/vdisk/skeleton/skeleton_vmultiput_actor.cpp index e807ac3f5c4..4b8c4e95148 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/skeleton_vmultiput_actor.cpp +++ b/ydb/core/blobstorage/vdisk/skeleton/skeleton_vmultiput_actor.cpp @@ -63,7 +63,7 @@ namespace NKikimr { , IncarnationGuid(incarnationGuid) , VCtx(vCtx) { - Y_ABORT_UNLESS(statuses.size() == Items.size()); + Y_VERIFY_S(statuses.size() == Items.size(), VCtx->VDiskLogPrefix); for (ui64 idx = 0; idx < Items.size(); ++idx) { Items[idx].Status = statuses[idx]; } @@ -102,11 +102,16 @@ namespace NKikimr { void Handle(TEvVMultiPutItemResult::TPtr &ev, const TActorContext &ctx) { TLogoBlobID blobId = ev->Get()->BlobId; ui64 idx = ev->Get()->ItemIdx; - Y_ABORT_UNLESS(idx < Items.size(), "itemIdx# %" PRIu64 " ItemsSize# %" PRIu64, idx, (ui64)Items.size()); + Y_VERIFY_S(idx < Items.size(), VCtx->VDiskLogPrefix + << "itemIdx# " << idx << " ItemsSize# " << (ui64)Items.size()); + TItem &item = Items[idx]; - Y_ABORT_UNLESS(blobId == item.BlobId, "itemIdx# %" PRIu64 " blobId# %s item# %s", idx, blobId.ToString().data(), item.ToString().data()); + Y_VERIFY_S(blobId == item.BlobId, VCtx->VDiskLogPrefix + << "itemIdx# " << idx << " blobId# " << blobId.ToString() << " item# " << item.ToString()); + + Y_VERIFY_S(!item.Received, VCtx->VDiskLogPrefix + << "itemIdx# " << idx << " item# " << item.ToString()); - Y_ABORT_UNLESS(!item.Received, "itemIdx# %" PRIu64 " item# %s", idx, item.ToString().data()); item.Received = true; item.Status = ev->Get()->Status; item.ErrorReason = ev->Get()->ErrorReason; diff --git a/ydb/core/blobstorage/vdisk/skeleton/skeleton_vpatch_actor.cpp b/ydb/core/blobstorage/vdisk/skeleton/skeleton_vpatch_actor.cpp index 46c9af0f2d5..5e06f126deb 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/skeleton_vpatch_actor.cpp +++ b/ydb/core/blobstorage/vdisk/skeleton/skeleton_vpatch_actor.cpp @@ -165,13 +165,13 @@ namespace NKikimr::NPrivate { Deadline = now + CommonLiveTime; } - Y_ABORT_UNLESS(record.HasOriginalBlobId()); + Y_VERIFY_S(record.HasOriginalBlobId(), VDiskLogPrefix); OriginalBlobId = LogoBlobIDFromLogoBlobID(record.GetOriginalBlobId()); - Y_ABORT_UNLESS(record.HasPatchedBlobId()); + Y_VERIFY_S(record.HasPatchedBlobId(), VDiskLogPrefix); PatchedBlobId = LogoBlobIDFromLogoBlobID(record.GetPatchedBlobId()); - Y_ABORT_UNLESS(record.HasVDiskID()); + Y_VERIFY_S(record.HasVDiskID(), VDiskLogPrefix); VDiskId = VDiskIDFromVDiskID(record.GetVDiskID()); - Y_ABORT_UNLESS(record.HasCookie()); + Y_VERIFY_S(record.HasCookie(), VDiskLogPrefix); FoundPartsEvent = std::make_unique<TEvBlobStorage::TEvVPatchFoundParts>( NKikimrProto::OK, OriginalBlobId, PatchedBlobId, VDiskId, record.GetCookie(), now, ErrorReason, &record, SkeletonFrontIDPtr, VPatchFoundPartsMsgsPtr, getHistogram, IncarnationGuid); @@ -257,7 +257,7 @@ namespace NKikimr::NPrivate { void HandleVGetRangeResult(TEvBlobStorage::TEvVGetResult::TPtr &ev) { Become(&TThis::WaitState); NKikimrBlobStorage::TEvVGetResult &record = ev->Get()->Record; - Y_ABORT_UNLESS(record.HasStatus()); + Y_VERIFY_S(record.HasStatus(), VCtx->VDiskLogPrefix); STLOG(PRI_INFO, BS_VDISK_PATCH, BSVSP06, VDiskLogPrefix << " TEvVPatch: received parts index;", @@ -287,7 +287,7 @@ namespace NKikimr::NPrivate { // it has to have only one result auto &item = record.GetResult(0); FoundOriginalParts.reserve(item.PartsSize()); - Y_ABORT_UNLESS(item.HasStatus()); + Y_VERIFY_S(item.HasStatus(), VDiskLogPrefix); if (item.GetStatus() == NKikimrProto::OK) { for (ui32 partId : item.GetParts()) { FoundOriginalParts.push_back(partId); @@ -313,7 +313,7 @@ namespace NKikimr::NPrivate { (PatchedPartId, (ui32)PatchedPartId), (Status, status), (ErrorReason, ErrorReason)); - Y_ABORT_UNLESS(ResultEvent); + Y_VERIFY_S(ResultEvent, VDiskLogPrefix); ResultEvent->SetStatus(status, ErrorReason); #if VDISK_SKELETON_TRACE if (CurrentEventTrace) { @@ -331,7 +331,7 @@ namespace NKikimr::NPrivate { void HandleVGetResult(TEvBlobStorage::TEvVGetResult::TPtr &ev) { NKikimrBlobStorage::TEvVGetResult &record = ev->Get()->Record; AddMark("Recieve VGetResult"); - Y_ABORT_UNLESS(record.HasStatus()); + Y_VERIFY_S(record.HasStatus(), VDiskLogPrefix); if (record.GetStatus() != NKikimrProto::OK) { ErrorReason = TStringBuilder() << "Recieve not OK status from VGetResult," << " received status# " << NKikimrProto::EReplyStatus_Name(record.GetStatus()); @@ -352,7 +352,7 @@ namespace NKikimr::NPrivate { } auto &item = *record.MutableResult(0); - Y_ABORT_UNLESS(item.HasStatus()); + Y_VERIFY_S(item.HasStatus(), VDiskLogPrefix); if (item.GetStatus() != NKikimrProto::OK) { ErrorReason = TStringBuilder() << "Recieve not OK status from VGetResult," << " received status# " << NKikimrProto::EReplyStatus_Name(record.GetStatus()) @@ -364,10 +364,10 @@ namespace NKikimr::NPrivate { return; } - Y_ABORT_UNLESS(item.HasBlobID()); + Y_VERIFY_S(item.HasBlobID(), VDiskLogPrefix); TLogoBlobID blobId = LogoBlobIDFromLogoBlobID(item.GetBlobID()); - Y_ABORT_UNLESS(ev->Get()->HasBlob(item)); + Y_VERIFY_S(ev->Get()->HasBlob(item), VDiskLogPrefix); Buffer = ev->Get()->GetBlobData(item); STLOG(PRI_INFO, BS_VDISK_PATCH, BSVSP08, @@ -470,15 +470,15 @@ namespace NKikimr::NPrivate { TLogoBlobID(PatchedBlobId, xorReceiver.PartId), xorReceiver.VDiskId, OriginalPartId, Deadline, 0); for (auto &diff : xorDiffs) { - Y_ABORT_UNLESS(diff.Offset < GType.PartSize(PatchedBlobId)); - Y_ABORT_UNLESS(diff.Offset + diff.GetDiffLength() <= GType.PartSize(PatchedBlobId)); + Y_VERIFY_S(diff.Offset < GType.PartSize(PatchedBlobId), VDiskLogPrefix); + Y_VERIFY_S(diff.Offset + diff.GetDiffLength() <= GType.PartSize(PatchedBlobId), VDiskLogPrefix); xorDiff->AddDiff(diff.Offset, diff.Buffer); } TVDiskIdShort shortId(xorReceiver.VDiskId); - Y_ABORT_UNLESS(VPatchCtx); - Y_ABORT_UNLESS(VPatchCtx->AsyncBlobQueues); + Y_VERIFY_S(VPatchCtx, VDiskLogPrefix); + Y_VERIFY_S(VPatchCtx->AsyncBlobQueues, VDiskLogPrefix); auto it = VPatchCtx->AsyncBlobQueues.find(shortId); - Y_ABORT_UNLESS(it != VPatchCtx->AsyncBlobQueues.end()); + Y_VERIFY_S(it != VPatchCtx->AsyncBlobQueues.end(), VDiskLogPrefix); TInstant now = TActivationContext::Now(); NKikimrBlobStorage::TEvVPatchXorDiff &record = xorDiff->Record; @@ -545,7 +545,7 @@ namespace NKikimr::NPrivate { CurrentEventTrace->AdditionalTrace = PatchActorTrace; } #endif - Y_ABORT_UNLESS(record.HasCookie()); + Y_VERIFY_S(record.HasCookie(), VDiskLogPrefix); AddMark("Receive TEvVPatchDiff"); TLogoBlobID originalPartBlobId = LogoBlobIDFromLogoBlobID(record.GetOriginalPartBlobId()); @@ -576,7 +576,7 @@ namespace NKikimr::NPrivate { (ParityPart, (PatchedPartId <= GType.DataParts() ? "no" : "yes")), (ForceEnd, (forceEnd ? "yes" : "no"))); - Y_ABORT_UNLESS(!ResultEvent); + Y_VERIFY_S(!ResultEvent, VDiskLogPrefix); TInstant now = TActivationContext::Now(); ResultEvent = std::make_unique<TEvBlobStorage::TEvVPatchResult>( @@ -594,8 +594,8 @@ namespace NKikimr::NPrivate { } for (auto &protoXorReceiver : record.GetXorReceivers()) { - Y_ABORT_UNLESS(protoXorReceiver.HasVDiskID()); - Y_ABORT_UNLESS(protoXorReceiver.HasPartId()); + Y_VERIFY_S(protoXorReceiver.HasVDiskID(), VDiskLogPrefix); + Y_VERIFY_S(protoXorReceiver.HasPartId(), VDiskLogPrefix); XorReceivers.emplace_back( VDiskIDFromVDiskID(protoXorReceiver.GetVDiskID()), protoXorReceiver.GetPartId()); @@ -616,7 +616,7 @@ namespace NKikimr::NPrivate { void Handle(TEvBlobStorage::TEvVPutResult::TPtr &ev) { NKikimrBlobStorage::TEvVPutResult &record = ev->Get()->Record; - Y_ABORT_UNLESS(record.HasStatus()); + Y_VERIFY_S(record.HasStatus(), VDiskLogPrefix); STLOG(PRI_INFO, BS_VDISK_PATCH, BSVSP10, VDiskLogPrefix << " TEvVPatch: received put result;", @@ -658,7 +658,7 @@ namespace NKikimr::NPrivate { void Handle(TEvBlobStorage::TEvVPatchXorDiff::TPtr &ev) { NKikimrBlobStorage::TEvVPatchXorDiff &record = ev->Get()->Record; - Y_ABORT_UNLESS(record.HasFromPartId()); + Y_VERIFY_S(record.HasFromPartId(), VDiskLogPrefix); ui8 fromPart = record.GetFromPartId(); ui8 toPart = OriginalPartId; TVector<TDiff> xorDiffs = PullDiff(record, true); diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclog.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclog.cpp index 2d51ba5744f..00950bbbb9e 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclog.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclog.cpp @@ -106,7 +106,7 @@ namespace NKikimr { friend class TActorBootstrapped<TSyncLogActor>; ui64 GetDbBirthLsn() { - Y_ABORT_UNLESS(DbBirthLsn.Defined()); + Y_VERIFY_S(DbBirthLsn.Defined(), SlCtx->VCtx->VDiskLogPrefix); return *DbBirthLsn; } @@ -230,12 +230,10 @@ namespace NKikimr { NeighborsPtr->UpdateSyncedLsn(vdisk, syncedLsn); // get current min value ui64 curMinLsn = NeighborsPtr->GlobalSyncedLsn(); - Y_ABORT_UNLESS(prevMinLsn <= curMinLsn, - "TSyncLogActor::CutLog: currentSyncedLsn# %" PRIu64 - " syncedLsn# %" PRIu64 " vdisk# %s prevMinLsn# %" PRIu64 - " curMinLsn# %" PRIu64, - currentSyncedLsn, syncedLsn, vdisk.ToString().data(), - prevMinLsn, curMinLsn); + Y_VERIFY_S(prevMinLsn <= curMinLsn, SlCtx->VCtx->VDiskLogPrefix + << "TSyncLogActor::CutLog: currentSyncedLsn# " << currentSyncedLsn + << " syncedLsn# " << syncedLsn << " vdisk# " << vdisk.ToString() + << " prevMinLsn# " << prevMinLsn << " curMinLsn# " << curMinLsn); if (prevMinLsn < curMinLsn) { ctx.Send(KeeperId, new TEvSyncLogTrim(curMinLsn)); } @@ -269,7 +267,8 @@ namespace NKikimr { Y_UNUSED(ctx); auto *msg = ev->Get(); GInfo = msg->NewInfo; - Y_ABORT_UNLESS(msg->NewVDiskId == msg->NewInfo->GetVDiskId(SlCtx->VCtx->ShortSelfVDisk)); + Y_VERIFY_S(msg->NewVDiskId == msg->NewInfo->GetVDiskId(SlCtx->VCtx->ShortSelfVDisk), + SlCtx->VCtx->VDiskLogPrefix); SelfVDiskId = msg->NewVDiskId; } diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_syncloghttp.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_syncloghttp.cpp index 1b86632e62f..6ea19caac9d 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_syncloghttp.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_syncloghttp.cpp @@ -41,7 +41,7 @@ namespace NKikimr { } void Handle(TEvSyncLogSnapshotResult::TPtr &ev, const TActorContext &ctx) { - Y_ABORT_UNLESS(!SnapPtr); + Y_VERIFY_S(!SnapPtr, VCtx->VDiskLogPrefix); SnapPtr = std::move(ev->Get()->SnapshotPtr); SublogContent = std::move(ev->Get()->SublogContent); if (NodesInfoMsg) @@ -49,7 +49,7 @@ namespace NKikimr { } void Handle(TEvInterconnect::TEvNodesInfo::TPtr &ev, const TActorContext &ctx) { - Y_ABORT_UNLESS(!NodesInfoMsg); + Y_VERIFY_S(!NodesInfoMsg, VCtx->VDiskLogPrefix); NodesInfoMsg = ev; if (SnapPtr) Finish(ctx); @@ -133,4 +133,3 @@ namespace NKikimr { } // NSyncLog } // NKikimr - diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper.cpp index d329607b285..fc6a7b15d01 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper.cpp @@ -57,7 +57,7 @@ namespace NKikimr { // we don't need to commit because we either remove mem pages or // schedule to remove some chunks (but they may be used by snapshots, // so wait until TEvSyncLogFreeChunk message) - Y_ABORT_UNLESS(!hasToCommit); + Y_VERIFY_S(!hasToCommit, SlCtx->VCtx->VDiskLogPrefix); return false; } @@ -91,7 +91,7 @@ namespace NKikimr { generateCommit |= PerformInitialCommit(); if (generateCommit) { - Y_ABORT_UNLESS(!CommitterId); + Y_VERIFY_S(!CommitterId, SlCtx->VCtx->VDiskLogPrefix); // we must save recovery log records after const ui64 recoveryLogConfirmedLsn = SlCtx->LsnMngr->GetConfirmedLsnForSyncLog(); // create and run committer diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_committer.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_committer.cpp index ec9b5785ce6..7052e2985c2 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_committer.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_committer.cpp @@ -146,7 +146,7 @@ namespace NKikimr { void Handle(NPDisk::TEvLogResult::TPtr &ev, const TActorContext &ctx) { CHECK_PDISK_RESPONSE(SlCtx->VCtx, ev, ctx); - Y_ABORT_UNLESS(ev->Get()->Results.size() == 1); + Y_VERIFY_S(ev->Get()->Results.size() == 1, SlCtx->VCtx->VDiskLogPrefix); const ui64 entryPointLsn = ev->Get()->Results[0].Lsn; TCommitHistory commitHistory(TAppData::TimeProvider->Now(), entryPointLsn, EntryPointSerializer.RecoveryLogConfirmedLsn); ctx.Send(NotifyID, new TEvSyncLogCommitDone(commitHistory, diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_state.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_state.cpp index dc9a93e984e..b4892f8355e 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_state.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_state.cpp @@ -94,7 +94,7 @@ namespace NKikimr { it.Next(); ++lsn; } - Y_ABORT_UNLESS(lsn <= seg->Info.LastLsn + 1); + Y_VERIFY_S(lsn <= seg->Info.LastLsn + 1, VCtx->VDiskLogPrefix); // Check for memory overflow if (SyncLogPtr->GetNumberOfPagesInMemory() > MaxMemPages) DelayedActions.SetMemOverflow(); @@ -335,7 +335,7 @@ namespace NKikimr { SyncLogPtr->GetNumberOfPagesInMemory() - MaxMemPages : 0; // if wantToCutRecoveryLog, then FreeUpToLsn must > 0 - Y_ABORT_UNLESS(!wantToCutRecoveryLog || (FreeUpToLsn > 0)); + Y_VERIFY_S(!wantToCutRecoveryLog || (FreeUpToLsn > 0), VCtx->VDiskLogPrefix); const ui64 freeUpToLsn = wantToCutRecoveryLog ? FreeUpToLsn : 0; // build swap snap @@ -407,4 +407,3 @@ namespace NKikimr { } // NSyncLog } // NKikimr - diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_ut.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_ut.cpp index 654ec081498..29800995c31 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_ut.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_ut.cpp @@ -95,7 +95,7 @@ namespace NKikimr { TString explanation; auto r = TSyncLogRepaired::Construct(std::move(params), ep.EntryPoint, ep.EntryPointLsn, explanation); Y_ABORT_UNLESS(r); - std::unique_ptr<NSyncLog::TSyncLogRecovery> recovery = std::make_unique<NSyncLog::TSyncLogRecovery>(std::move(r)); + std::unique_ptr<NSyncLog::TSyncLogRecovery> recovery = std::make_unique<NSyncLog::TSyncLogRecovery>("", std::move(r)); const ui64 lastLsnOfIndexRecord = recovery->GetLastLsnOfIndexRecord(); std::unique_ptr<TSyncLogRepaired> repaired = recovery->ReleaseRepaired(); @@ -226,7 +226,7 @@ namespace NKikimr { NSyncLog::TLogEssence e; State->FillInSyncLogEssence(&e); auto reportInternals = [] () { return TString(); }; - TWhatsNextOutcome outcome = WhatsNext(syncedLsn, dbBirthLsn, &e, reportInternals); + TWhatsNextOutcome outcome = WhatsNext("", syncedLsn, dbBirthLsn, &e, reportInternals); STR << "Sync result: outcome# " << Name2Str(outcome.WhatsNext) << " explanation# " << outcome.Explanation << "\n"; UNIT_ASSERT(outcome.WhatsNext == EReadWhatsNext::EWnDiskSynced); diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgreader.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgreader.cpp index d6a86cff3d9..a6bc205097b 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgreader.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgreader.cpp @@ -136,7 +136,7 @@ namespace NKikimr { Impl.reset(new TCustomCodecFragmentReader(data)); break; default: - Y_ABORT("Unknwon codec"); + Y_ABORT("Unknown codec"); } } diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogneighbors.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogneighbors.cpp index c5bcd968377..9585bd43d7f 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogneighbors.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogneighbors.cpp @@ -68,7 +68,7 @@ namespace NKikimr { vdisk.ToString().data(), lsn)); TNeighbors::TValue &ref = Neighbors[vdisk]; - Y_ABORT_UNLESS(ref.Get().LockedLsn == (ui64)-1); + Y_VERIFY_S(ref.Get().LockedLsn == (ui64)-1, LogPrefix); ref.Get().LockedLsn = lsn; LocksNum++; } @@ -79,7 +79,7 @@ namespace NKikimr { vdisk.ToString().data())); TNeighbors::TValue &ref = Neighbors[vdisk]; - Y_ABORT_UNLESS(ref.Get().LockedLsn != (ui64)-1); + Y_VERIFY_S(ref.Get().LockedLsn != (ui64)-1, LogPrefix); ref.Get().LockedLsn = (ui64)-1; LocksNum--; } diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogneighbors.h b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogneighbors.h index 8b97878dc5e..4028f8d0902 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogneighbors.h +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogneighbors.h @@ -68,7 +68,7 @@ namespace NKikimr { if (Neighbors.GetTotalDisks() == 1) { return (ui64)-1; } - Y_DEBUG_ABORT_UNLESS(CheckSyncPosQueue()); + Y_VERIFY_DEBUG_S(CheckSyncPosQueue(), LogPrefix); // TAvlTree doesn't have const Begin, se we have to remove 'const' qualifier ui64 result = (const_cast<TSyncLogNeighbors*>(this))->SyncPosQueue.Begin()->SyncedLsn; return result; @@ -96,12 +96,12 @@ namespace NKikimr { TNeighbors::TValue &diskData = Neighbors[vdisk]; TSyncPos &ref = diskData.Get(); // reorder - Y_DEBUG_ABORT_UNLESS(syncedLsn > ref.SyncedLsn); + Y_VERIFY_DEBUG_S(syncedLsn > ref.SyncedLsn, LogPrefix); ref.SyncedLsn = syncedLsn; ref.Unlink(); SyncPosQueue.Insert(&ref); - Y_DEBUG_ABORT_UNLESS(CheckSyncPosQueue()); + Y_VERIFY_DEBUG_S(CheckSyncPosQueue(), LogPrefix); } ui64 GetSyncedLsn(const TVDiskID &vdisk) { @@ -128,7 +128,7 @@ namespace NKikimr { SyncPosQueue.Insert(&(it->Get())); } } - Y_DEBUG_ABORT_UNLESS(CheckSyncPosQueue()); + Y_VERIFY_DEBUG_S(CheckSyncPosQueue(), LogPrefix); } private: @@ -147,4 +147,3 @@ namespace NKikimr { } // NSyncLog } // NKikimr - diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogreader.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogreader.cpp index ab94ec83084..037577cda56 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogreader.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogreader.cpp @@ -29,7 +29,8 @@ namespace NKikimr { } } - TWhatsNextOutcome WhatsNext(ui64 syncedLsn, + TWhatsNextOutcome WhatsNext(const TString& logPrefix, + ui64 syncedLsn, ui64 dbBirthLsn, const NSyncLog::TLogEssence *e, std::function<TString()> reportInternals) { @@ -61,7 +62,7 @@ namespace NKikimr { ui64 firstLogLsn = 0; if (!e->MemLogEmpty && !e->DiskLogEmpty) { - Y_ABORT_UNLESS(e->FirstDiskLsn <= e->FirstMemLsn, "%s", reportInternals().data()); + Y_VERIFY_S(e->FirstDiskLsn <= e->FirstMemLsn, logPrefix << reportInternals()); firstLogLsn = e->FirstDiskLsn; } else if (e->MemLogEmpty) { firstLogLsn = e->FirstDiskLsn; @@ -69,9 +70,10 @@ namespace NKikimr { firstLogLsn = e->FirstMemLsn; } - Y_ABORT_UNLESS(lastLogLsn != 0 && firstLogLsn <= lastLogLsn, - " firstLogLsn# %" PRIu64 " lastLogLsn# %" PRIu64 " %s", - firstLogLsn, lastLogLsn, reportInternals().data()); + Y_VERIFY_S(lastLogLsn != 0 && firstLogLsn <= lastLogLsn, logPrefix + << " firstLogLsn# " << firstLogLsn + << " lastLogLsn# " << lastLogLsn + << " " << reportInternals()); if (!(syncedLsn + 1 >= logStartLsn)) { return TWhatsNextOutcome::Error(2); @@ -262,7 +264,7 @@ namespace NKikimr { TLogEssence e {}; SnapPtr->FillInLogEssence(&e); auto ri = std::bind(InternalsToString, Ev->Get(), SnapPtr.Get(), DbBirthLsn); - TWhatsNextOutcome wno = WhatsNext(syncedLsn, DbBirthLsn, &e, ri); + TWhatsNextOutcome wno = WhatsNext(SlCtx->VCtx->VDiskLogPrefix, syncedLsn, DbBirthLsn, &e, ri); // process outcome if (wno.WhatsNext == EWnError) { @@ -339,21 +341,20 @@ namespace NKikimr { // FIXME: optimize, batch reads; use Db->RecommendedReadSize CHECK_PDISK_RESPONSE_READABLE(SlCtx->VCtx, ev, ctx); - Y_ABORT_UNLESS(DiskIt.Valid()); + Y_VERIFY_S(DiskIt.Valid(), SlCtx->VCtx->VDiskLogPrefix); std::pair<ui32, const TDiskIndexRecord *> p = DiskIt.Get(); ui32 chunkIdx = p.first; const TDiskIndexRecord *idxRec = p.second; auto msg = ev->Get(); const TBufferWithGaps &readData = ev->Get()->Data; - Y_ABORT_UNLESS(chunkIdx == msg->ChunkIdx && + Y_VERIFY_S(chunkIdx == msg->ChunkIdx && idxRec->OffsetInPages * SnapPtr->AppendBlockSize == msg->Offset && idxRec->PagesNum * SnapPtr->AppendBlockSize == readData.Size(), - "SyncLog read command failed: chunkIdx# %" PRIu32 - " msgChunkIdx# %" PRIu32 " OffsetInPages# %" PRIu32 - " appendBlockSize# %" PRIu32 " msgOffset# %" PRIu32 - " PagesNum# %" PRIu32 " readDataSize# %" PRIu32, - chunkIdx, msg->ChunkIdx, idxRec->OffsetInPages, SnapPtr->AppendBlockSize, - msg->Offset, idxRec->PagesNum, ui32(readData.Size())); + SlCtx->VCtx->VDiskLogPrefix + << "SyncLog read command failed: chunkIdx# " << chunkIdx + <<" msgChunkIdx# " << msg->ChunkIdx << " OffsetInPages# " << idxRec->OffsetInPages + << " appendBlockSize# " << SnapPtr->AppendBlockSize << " msgOffset# " << msg->Offset + << " PagesNum# " << idxRec->PagesNum << " readDataSize# " << ui32(readData.Size())); // process all pages for (ui32 pi = 0; pi < idxRec->PagesNum; pi++) { @@ -455,4 +456,3 @@ namespace NKikimr { } // NSyncLog } // NKikimr - diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogreader.h b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogreader.h index b04d98f8d90..dbb7e9e2951 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogreader.h +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogreader.h @@ -46,7 +46,8 @@ namespace NKikimr { }; const char *Name2Str(EReadWhatsNext w); - TWhatsNextOutcome WhatsNext(ui64 syncedLsn, // lsn our peer VDisk synced to + TWhatsNextOutcome WhatsNext(const TString& logPrefix, + ui64 syncedLsn, // lsn our peer VDisk synced to ui64 dbBirthLsn,// our db birth lsn const NSyncLog::TLogEssence *e, std::function<TString()> reportInternals); diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogrecovery.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogrecovery.cpp index 7326fbb74fc..e29845bd166 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogrecovery.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogrecovery.cpp @@ -54,9 +54,11 @@ namespace NKikimr { //////////////////////////////////////////////////////////////////////////// // TSyncLogRecovery //////////////////////////////////////////////////////////////////////////// - TSyncLogRecovery::TSyncLogRecovery(std::unique_ptr<TSyncLogRepaired> &&repaired) { - Repaired = std::move(repaired); - } + TSyncLogRecovery::TSyncLogRecovery(const TString& logPrefix, + std::unique_ptr<TSyncLogRepaired> &&repaired) + : VDiskLogPrefix(logPrefix) + , Repaired(std::move(repaired)) + {} void TSyncLogRecovery::PutLogoBlob( const TBlobStorageGroupType >ype, @@ -64,8 +66,8 @@ namespace NKikimr { const TLogoBlobID &id, const TIngress &ingress) { - Y_ABORT_UNLESS(GetLastLsnOfIndexRecord() < lsn, - "State# %s lsn# %" PRIu64, ToString().data(), lsn); + Y_VERIFY_S(GetLastLsnOfIndexRecord() < lsn, + VDiskLogPrefix << "State# " << ToString() << " lsn# " << lsn); ++LogoBlobs; char buf[NSyncLog::MaxRecFullSize]; @@ -74,8 +76,8 @@ namespace NKikimr { } void TSyncLogRecovery::PutBlock(ui64 lsn, ui64 tabletId, ui32 gen) { - Y_ABORT_UNLESS(GetLastLsnOfIndexRecord() < lsn, - "State# %s lsn# %" PRIu64, ToString().data(), lsn); + Y_VERIFY_S(GetLastLsnOfIndexRecord() < lsn, + VDiskLogPrefix << "State# " << ToString() << " lsn# " << lsn); ++Blocks; char buf[NSyncLog::MaxRecFullSize]; @@ -89,8 +91,8 @@ namespace NKikimr { const NKikimrBlobStorage::TEvVCollectGarbage &record, const TBarrierIngress &ingress) { - Y_ABORT_UNLESS(GetLastLsnOfIndexRecord() < lsn, - "State# %s lsn# %" PRIu64, ToString().data(), lsn); + Y_VERIFY_S(GetLastLsnOfIndexRecord() < lsn, + VDiskLogPrefix << "State# " << ToString() << " lsn# " << lsn); ++Gcs; const bool collect = record.HasCollectGeneration(); @@ -120,8 +122,8 @@ namespace NKikimr { bool hard, const TBarrierIngress &ingress) { - Y_ABORT_UNLESS(GetLastLsnOfIndexRecord() < lsn, - "State# %s lsn# %" PRIu64, ToString().data(), lsn); + Y_VERIFY_S(GetLastLsnOfIndexRecord() < lsn, + VDiskLogPrefix << "State# " << ToString() << " lsn# " << lsn); ++Barriers; char buf[NSyncLog::MaxRecFullSize]; @@ -134,8 +136,8 @@ namespace NKikimr { std::unique_ptr<TSyncLogRepaired> TSyncLogRecovery::ReleaseRepaired() { // after finishing recovery check that Dsk and Mem do not intersect - Y_ABORT_UNLESS(Repaired->SyncLogPtr->CheckMemAndDiskRecLogsDoNotIntersect(), - "%s", Repaired->SyncLogPtr->BoundariesToString().data()); + Y_VERIFY_S(Repaired->SyncLogPtr->CheckMemAndDiskRecLogsDoNotIntersect(), + VDiskLogPrefix << Repaired->SyncLogPtr->BoundariesToString()); return std::exchange(Repaired, nullptr); } @@ -154,7 +156,7 @@ namespace NKikimr { void TSyncLogRecovery::GetOwnedChunks(TSet<TChunkIdx>& chunks) const { for (TChunkIdx chunkIdx : Repaired->ChunksToDelete) { const bool inserted = chunks.insert(chunkIdx).second; - Y_ABORT_UNLESS(inserted); + Y_VERIFY_S(inserted, VDiskLogPrefix); } Repaired->SyncLogPtr->GetOwnedChunks(chunks); } diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogrecovery.h b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogrecovery.h index c585559f36c..30d60d4ad73 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogrecovery.h +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogrecovery.h @@ -55,7 +55,7 @@ namespace NKikimr { using TLevelSegmentPtr = TIntrusivePtr<TLevelSegment>; public: - TSyncLogRecovery(std::unique_ptr<TSyncLogRepaired> &&repaired); + TSyncLogRecovery(const TString& logPrefix, std::unique_ptr<TSyncLogRepaired> &&repaired); void PutLogoBlob( const TBlobStorageGroupType >ype, ui64 lsn, @@ -86,6 +86,7 @@ namespace NKikimr { private: TString ToString() const; + const TString VDiskLogPrefix; std::unique_ptr<TSyncLogRepaired> Repaired; ui64 AddSegs = 0; ui64 LogoBlobs = 0; diff --git a/ydb/core/test_tablet/load_actor_impl.cpp b/ydb/core/test_tablet/load_actor_impl.cpp index 43ec5379570..338fbeb68bf 100644 --- a/ydb/core/test_tablet/load_actor_impl.cpp +++ b/ydb/core/test_tablet/load_actor_impl.cpp @@ -79,11 +79,12 @@ namespace NKikimr::NTestShard { return; } } - ui64 barrier = 2 * Settings.GetMaxDataBytes(); - if (Settings.HasValidateAfterBytes()) { - barrier = Settings.GetValidateAfterBytes(); - } - if (BytesProcessed > barrier) { // time to perform validation +// ui64 barrier = 2 * Settings.GetMaxDataBytes(); +// if (Settings.HasValidateAfterBytes()) { +// barrier = Settings.GetValidateAfterBytes(); +// } + if (0) { +// if (BytesProcessed > barrier) { // time to perform validation if (WritesInFlight.empty() && PatchesInFlight.empty() && DeletesInFlight.empty() && ReadsInFlight.empty() && TransitionInFlight.empty()) { RunValidation(false); @@ -92,7 +93,10 @@ namespace NKikimr::NTestShard { const TMonotonic now = TActivationContext::Monotonic(); bool canWriteMore = false; - if (WritesInFlight.size() + PatchesInFlight.size() < Settings.GetMaxInFlight() && !DisableWrites) { + if (BytesOfData < Settings.GetMaxDataBytes() && + WritesInFlight.size() + PatchesInFlight.size() < Settings.GetMaxInFlight() + && !DisableWrites) + { if (NextWriteTimestamp <= now) { if (Settings.HasPatchRequestsFractionPPM() && !ConfirmedKeys.empty() && RandomNumber(1'000'000u) < Settings.GetPatchRequestsFractionPPM()) { @@ -114,13 +118,13 @@ namespace NKikimr::NTestShard { } bool canReadMore = false; - if (ReadsInFlight.size() < Settings.GetMaxReadsInFlight()) { - canReadMore = IssueRead(); - } +// if (ReadsInFlight.size() < Settings.GetMaxReadsInFlight()) { +// canReadMore = IssueRead(); +// } - if (BytesOfData > Settings.GetMaxDataBytes()) { // delete some data if needed - IssueDelete(); - } +// if (BytesOfData > Settings.GetMaxDataBytes()) { // delete some data if needed +// IssueDelete(); +// } if (!DoSomeActionInFlight && (canWriteMore || canReadMore)) { TActivationContext::Send(new IEventHandle(EvDoSomeAction, 0, SelfId(), {}, nullptr, 0)); |
