ankit-j commented on a change in pull request #2096: Entries must be 
acknowledged by bookies in multiple fault domains before being acknowledged to 
client
URL: https://github.com/apache/bookkeeper/pull/2096#discussion_r287155848
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/PendingAddOp.java
 ##########
 @@ -363,10 +380,30 @@ public void writeComplete(int rc, long ledgerId, long 
entryId, BookieSocketAddre
         }
 
         if (ackQuorum && !completed) {
-            completed = true;
-            this.qwcLatency = MathUtils.elapsedNanos(requestTimeNanos);
+            if (clientCtx.getConf().enforceMinNumFaultDomainsForWrite
+                && 
!(clientCtx.getPlacementPolicy().areAckedBookiesAdheringToPlacementPolicy(addEntrySuccessBookies)))
 {
+                LOG.warn("Write success for entry ID {} delayed, not 
acknowledged by bookies in enough fault domains",
+                         entryId);
+                // Increment to indicate write did not complete due to not 
enough fault domains
+                
clientCtx.getClientStats().getWriteDelayedDueToNotEnoughFaultDomains().inc();
+
+                // Only do this for the first time.
+                if (writeDelayedStartTime == -1) {
+                    writeDelayedStartTime = MathUtils.nowInNano();
+                }
+            } else {
+                completed = true;
 
 Review comment:
   Not exactly.
   
   What I'm doing here, if `enforceMinNumFaultDomainsForWrite` is set, is 
preventing the addEntry from being completing till bookies from 
`minNumRacksPerWriteQuorum`(or `writeQuorumSize`, whichever is lower) number of 
racks have acknowledged the addEntry. If `enforceMinNumFaultDomainsForWrite` is 
not set, no change to the existing logic.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to