You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "wenbingshen (via GitHub)" <gi...@apache.org> on 2023/06/15 07:07:15 UTC

[GitHub] [bookkeeper] wenbingshen commented on a diff in pull request #3977: Do not skip opened ledger in repair not adhering placement ledger

wenbingshen commented on code in PR #3977:
URL: https://github.com/apache/bookkeeper/pull/3977#discussion_r1230537776


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorPlacementPolicyCheckTask.java:
##########
@@ -257,66 +257,66 @@ void doPlacementPolicyCheck(Long ledgerId,
         LedgerMetadata metadata = metadataVer.getValue();
         int writeQuorumSize = metadata.getWriteQuorumSize();
         int ackQuorumSize = metadata.getAckQuorumSize();
-        if (metadata.isClosed()) {
-            boolean foundSegmentNotAdheringToPlacementPolicy = false;
-            boolean foundSegmentSoftlyAdheringToPlacementPolicy = false;
-            for (Map.Entry<Long, ? extends List<BookieId>> ensemble : metadata
-                    .getAllEnsembles().entrySet()) {
-                long startEntryIdOfSegment = ensemble.getKey();
-                List<BookieId> ensembleOfSegment = ensemble.getValue();
-                EnsemblePlacementPolicy.PlacementPolicyAdherence segmentAdheringToPlacementPolicy = admin
-                        .isEnsembleAdheringToPlacementPolicy(ensembleOfSegment, writeQuorumSize,
-                                ackQuorumSize);
-                if (segmentAdheringToPlacementPolicy == EnsemblePlacementPolicy.PlacementPolicyAdherence.FAIL) {
-                    foundSegmentNotAdheringToPlacementPolicy = true;
-                    LOG.warn(
-                            "For ledger: {}, Segment starting at entry: {}, with ensemble: {} having "
-                                    + "writeQuorumSize: {} and ackQuorumSize: {} is not adhering to "
-                                    + "EnsemblePlacementPolicy",
+        if (!metadata.isClosed()) {

Review Comment:
   +1
   
   If there is a rack failure and enforceMinNumRacksPerWriteQuorum=false, the open segment will never satisfy the rack distribution, and the auditor will cause all open ledger fences in the cluster. We can try to repair the closed ledger or segment, but for the open segment, the frequent fence ledgers can be a bit bad when rack failures.
   
   We should be consistent with the behavior of the bookie client write side. Especially for open segments.



-- 
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: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org