@@ -83,11 +83,18 @@ void TEngineLogsCounters::OnActualizationTask(const ui32 evictCount, const ui32
8383void TEngineLogsCounters::TPortionsInfoGuard::OnNewPortion (const std::shared_ptr<NOlap::TPortionInfo>& portion) const {
8484 const ui32 producedId = (ui32)(portion->HasRemoveSnapshot () ? NOlap::NPortion::EProduced::INACTIVE : portion->GetMeta ().Produced );
8585 Y_ABORT_UNLESS (producedId < BlobGuards.size ());
86+ THashSet<NOlap::TUnifiedBlobId> blobIds;
8687 for (auto && i : portion->GetRecords ()) {
87- BlobGuards[producedId]->Add (i.GetBlobRange ().Size , i.GetBlobRange ().Size );
88+ const auto blobId = portion->GetBlobId (i.GetBlobRange ().GetBlobIdxVerified ());
89+ if (blobIds.emplace (blobId).second ) {
90+ BlobGuards[producedId]->Add (blobId.BlobSize (), blobId.BlobSize ());
91+ }
8892 }
8993 for (auto && i : portion->GetIndexes ()) {
90- BlobGuards[producedId]->Add (i.GetBlobRange ().Size , i.GetBlobRange ().Size );
94+ const auto blobId = portion->GetBlobId (i.GetBlobRange ().GetBlobIdxVerified ());
95+ if (blobIds.emplace (blobId).second ) {
96+ BlobGuards[producedId]->Add (blobId.BlobSize (), blobId.BlobSize ());
97+ }
9198 }
9299 PortionRecordCountGuards[producedId]->Add (portion->GetRecordsCount (), 1 );
93100 PortionSizeGuards[producedId]->Add (portion->GetTotalBlobBytes (), 1 );
@@ -96,11 +103,18 @@ void TEngineLogsCounters::TPortionsInfoGuard::OnNewPortion(const std::shared_ptr
96103void TEngineLogsCounters::TPortionsInfoGuard::OnDropPortion (const std::shared_ptr<NOlap::TPortionInfo>& portion) const {
97104 const ui32 producedId = (ui32)(portion->HasRemoveSnapshot () ? NOlap::NPortion::EProduced::INACTIVE : portion->GetMeta ().Produced );
98105 Y_ABORT_UNLESS (producedId < BlobGuards.size ());
106+ THashSet<NOlap::TUnifiedBlobId> blobIds;
99107 for (auto && i : portion->GetRecords ()) {
100- BlobGuards[producedId]->Sub (i.GetBlobRange ().Size , i.GetBlobRange ().Size );
108+ const auto blobId = portion->GetBlobId (i.GetBlobRange ().GetBlobIdxVerified ());
109+ if (blobIds.emplace (blobId).second ) {
110+ BlobGuards[producedId]->Sub (blobId.BlobSize (), blobId.BlobSize ());
111+ }
101112 }
102113 for (auto && i : portion->GetIndexes ()) {
103- BlobGuards[producedId]->Sub (i.GetBlobRange ().Size , i.GetBlobRange ().Size );
114+ const auto blobId = portion->GetBlobId (i.GetBlobRange ().GetBlobIdxVerified ());
115+ if (blobIds.emplace (blobId).second ) {
116+ BlobGuards[producedId]->Sub (blobId.BlobSize (), blobId.BlobSize ());
117+ }
104118 }
105119 PortionRecordCountGuards[producedId]->Sub (portion->GetRecordsCount (), 1 );
106120 PortionSizeGuards[producedId]->Sub (portion->GetTotalBlobBytes (), 1 );
0 commit comments