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: [email protected]

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

Reply via email to