@@ -88,7 +88,6 @@ void TBlobBatch::SendWriteBlobRequest(const TString& blobData, const TUnifiedBlo
88
88
}
89
89
90
90
void TBlobBatch::OnBlobWriteResult (const TLogoBlobID& blobId, const NKikimrProto::EReplyStatus status) {
91
- BatchInfo->Counters .OnPutResult (blobId.BlobSize ());
92
91
Y_ABORT_UNLESS (status == NKikimrProto::OK, " The caller must handle unsuccessful status" );
93
92
Y_ABORT_UNLESS (BatchInfo);
94
93
Y_ABORT_UNLESS (blobId.Cookie () < BatchInfo->InFlight .size ());
@@ -204,6 +203,22 @@ class TBlobManager::TGCContext {
204
203
YDB_ACCESSOR_DEF (std::deque<TUnifiedBlobId>, KeepsToErase);
205
204
YDB_READONLY_DEF (std::shared_ptr<NDataSharing::TStorageSharedBlobsManager>, SharedBlobsManager);
206
205
public:
206
+ ui64 GetKeepBytes () const {
207
+ ui64 size = 0 ;
208
+ for (auto && i : KeepsToErase) {
209
+ size += i.BlobSize ();
210
+ }
211
+ return size;
212
+ }
213
+
214
+ ui64 GetDeleteBytes () const {
215
+ ui64 size = 0 ;
216
+ for (TTabletsByBlob::TIterator it (ExtractedToRemoveFromDB); it.IsValid (); ++it) {
217
+ size += it.GetBlobId ().BlobSize ();
218
+ }
219
+ return size;
220
+ }
221
+
207
222
TGCContext (const std::shared_ptr<NDataSharing::TStorageSharedBlobsManager>& sharedBlobsManager)
208
223
: SharedBlobsManager(sharedBlobsManager)
209
224
{
@@ -270,11 +285,11 @@ bool TBlobManager::DrainKeepTo(const TGenStep& dest, TGCContext& gcContext) {
270
285
if (BlobsToDelete.ExtractBlobTo (keepUnified, gcContext.MutableExtractedToRemoveFromDB ())) {
271
286
if (logoBlobId.Generation () == CurrentGen) {
272
287
AFL_INFO (NKikimrServices::TX_COLUMNSHARD_BLOBS_BS)(" to_not_keep" , keepUnified.ToStringNew ());
273
- continue ;
288
+ return ;
274
289
}
275
290
if (gcContext.GetSharedBlobsManager ()->BuildStoreCategories ({ keepUnified }).GetDirect ().IsEmpty ()) {
276
291
AFL_INFO (NKikimrServices::TX_COLUMNSHARD_BLOBS_BS)(" to_not_keep_not_direct" , keepUnified.ToStringNew ());
277
- continue ;
292
+ return ;
278
293
}
279
294
AFL_INFO (NKikimrServices::TX_COLUMNSHARD_BLOBS_BS)(" to_not_keep_old" , keepUnified.ToStringNew ());
280
295
gcContext.MutablePerGroupGCListsInFlight ()[bAddress].DontKeepList .insert (logoBlobId);
@@ -284,7 +299,7 @@ bool TBlobManager::DrainKeepTo(const TGenStep& dest, TGCContext& gcContext) {
284
299
}
285
300
};
286
301
287
- return BlobsToKeep.ExtractFront (dest, gcContext.GetFreeSpace (), pred);
302
+ return BlobsToKeep.ExtractTo (dest, gcContext.GetFreeSpace (), pred);
288
303
}
289
304
290
305
std::shared_ptr<NBlobOperations::NBlobStorage::TGCTask> TBlobManager::BuildGCTask (const TString& storageId,
@@ -345,12 +360,13 @@ std::shared_ptr<NBlobOperations::NBlobStorage::TGCTask> TBlobManager::BuildGCTas
345
360
PreviousGCTime = TInstant::Zero ();
346
361
}
347
362
348
- BlobsManagerCounters.OnGCTask (gcContext.GetKeepsToErase ().size (), gcContext.GetExtractedToRemoveFromDB ().GetSize (), gcContext.IsFull (), !!CollectGenStepInFlight);
363
+ BlobsManagerCounters.GCCounters .OnGCTask (gcContext.GetKeepsToErase ().size (), gcContext.GetKeepBytes (),
364
+ gcContext.GetExtractedToRemoveFromDB ().GetSize (), gcContext.GetDeleteBytes (), gcContext.IsFull (), !!CollectGenStepInFlight);
349
365
auto removeCategories = sharedBlobsInfo->BuildRemoveCategories (std::move (gcContext.MutableExtractedToRemoveFromDB ()));
350
366
auto result = std::make_shared<NBlobOperations::NBlobStorage::TGCTask>(storageId, std::move (gcContext.MutablePerGroupGCListsInFlight ()),
351
367
CollectGenStepInFlight, std::move (gcContext.MutableKeepsToErase ()), manager, std::move (removeCategories), counters, TabletInfo->TabletID , CurrentGen);
352
368
if (result->IsEmpty ()) {
353
- BlobsManagerCounters.OnEmptyGCTask ();
369
+ BlobsManagerCounters.GCCounters . OnEmptyGCTask ();
354
370
CollectGenStepInFlight = {};
355
371
return nullptr ;
356
372
}
0 commit comments