gaozhangmin opened a new issue, #4800:
URL: https://github.com/apache/bookkeeper/issues/4800

   **BUG REPORT**
   
   ***Describe the bug***
   
   `ScanAndCompareGarbageCollector` creates a new metadata bookie driver every 
time it runs over-replicated ledger cleanup. This repeatedly initializes 
metadata client resources during GC cycles instead of reusing them for the 
lifetime of the garbage collector.
   
   This can add unnecessary overhead to the over-replicated ledger cleanup path 
and may repeatedly create short-lived metadata resources.
   
   ***To Reproduce***
   
   Steps to reproduce the behavior:
   
   1. Enable over-replicated ledger GC with `gcOverreplicatedLedgerWaitTime` 
greater than `0`.
   2. Start a bookie with scan-and-compare garbage collection.
   3. Let the GC thread run multiple over-replicated ledger cleanup cycles.
   4. Observe that each cleanup cycle instantiates a new metadata bookie driver 
and ledger manager factory.
   
   ***Expected behavior***
   
   The garbage collector should reuse the metadata bookie driver and ledger 
manager factory across over-replicated ledger cleanup cycles, and release those 
resources when the garbage collector thread shuts down.
   
   ***Screenshots***
   
   Not applicable.
   
   ***Additional context***
   
   The repeated metadata driver creation happens in the over-replicated ledger 
cleanup path. Reusing the metadata driver avoids unnecessary metadata client 
initialization while preserving existing cleanup behavior.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to