heesung-sohn commented on issue #4668:
URL: https://github.com/apache/bookkeeper/issues/4668#issuecomment-3354255673

   One fix idea is that bookies can skip the over-replication gc for the 
ledgers owned by "read-only" and "draining" bookies, because ledgers from such 
bookies might be actively replicated to other bookies by the admin recover 
command. The readonly update api could pass an additional Bookie property, 
"draining:true" to the bookie info, to share this draining state with other 
bookies. Then, we can update the `isNotBookieIncludedInLedgerEnsembles` check 
like the following.
   
   ```java
   private boolean 
isNotBookieIncludedInLedgerEnsembles(Versioned<LedgerMetadata> metadata, 
Set<BookieId> readOnlyAndDrainingBookies) {
           // do not delete a ledger that is not closed, since the ensemble 
might
           // change again and include the current bookie while we are deleting 
it
           if (!metadata.getValue().isClosed()) {
               return false;
           }
   
           SortedMap<Long, ? extends List<BookieId>> ensembles =
                   metadata.getValue().getAllEnsembles();
           for (List<BookieId> ensemble : ensembles.values()) {
               // <------------add the logic here ------>
               // this ledger might be being replicated to this bk, skip.
               for(BookieId bookieId : ensemble) {
                   readOnlyAndDrainingBookies.contains(bookieId);
                   return false;
               }
               if (ensemble.contains(selfBookieAddress) ) {
                   return false;
               }
           }
   
           return true;
       }
   ```


-- 
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