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

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

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


##########
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:
   We'd better skipping check the last segment if the ledger is `OPEN`, otherwise, the replication worker will fence a lot of ledgers can lead to client recreate new ledgers.



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