Review Board 1.7.22


BOOKKEEPER-152 Can't recover a ledger whose current ensemble contain failed bookie.

Review Request #3737 - Created Feb. 2, 2012 and updated

Ivan Kelly
BOOKKEEPER-152
Reviewers
bookkeeper
bookkeeper-git
Proposed fix ensures that at least one of each quorum replies to ReadLastConfirmed.

Refactors code a bit to make the read last confirmed common for recovery and standalone read last confirmed.

The bug here was actually that we were waiting for quorumSize responses, from the bookies, when really all we need to get a response from one bookie in each possible quorum. in the 2/2 case as above this means only 1 bookie need response.

There's a fix for the timeouts and an improvement in fencing which fixing this uncovered.

 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/DistributionSchedule.java
Revision f2ed6bd New Change
[20] 45 lines
[+20] [+] public int getBookieIndex(long entryId, int replicaIndex);
46
     *         entryId
46
     *         entryId
47
     */
47
     */
48
    public int getReplicaIndex(long entryId, int bookieIndex);
48
    public int getReplicaIndex(long entryId, int bookieIndex);
49

    
   
49

   
50
    /**
50
    /**
51
     * Specifies whether its ok to proceed with recovery given that we have
51
     * Interface to keep track of which bookies in an ensemble, an action
52
     * heard back from the given bookie index. These calls will be a made in a
52
     * has been performed for.
53
     * sequence and an implementation of this interface should accumulate
53
     */
54
     * history about which bookie indexes we have heard from. Once this method
54
    public interface QuorumCoverageSet {
55
     * has returned true, it wont be called again on the same instance
55
        /**
56
     *
56
         * Add a bookie to the set, and check if all quorum in the set
57
     * @param bookieIndexHeardFrom
57
         * have had the action performed for it.
58
     * @return true if its ok to proceed with recovery
58
         * @param bookieIndexHeardFrom Bookie we've just heard from

    
   
59
         * @return whether all quorums have been covered
59
     */
60
         */
60
    public boolean canProceedWithRecovery(int bookieIndexHeardFrom);
61
        public boolean addBookieAndCheckCovered(int bookieIndexHeardFrom);

    
   
62
    }

    
   
63

   

    
   
64
    public QuorumCoverageSet getCoverageSet();
61
}
65
}
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
Revision e3d1847 New Change
 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerRecoveryOp.java
Revision 4625bbb New Change
 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/ReadLastConfirmedOp.java
Revision 43e999d New Change
 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RoundRobinDistributionSchedule.java
Revision 4a88747 New Change
 
bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java
Revision a68fc8c New Change
 
bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookieRecoveryTest.java
Revision cbd2277 New Change
 
bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BaseTestCase.java
Revision da52ca5 New Change
 
bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieFailureTest.java
Revision 5873255 New Change
 
bookkeeper-server/src/test/java/org/apache/bookkeeper/test/LedgerRecoveryTest.java
Revision 77a2f69 New Change
 
  1. bookkeeper-server/src/main/java/org/apache/bookkeeper/client/DistributionSchedule.java: Loading...
  2. bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java: Loading...
  3. bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerRecoveryOp.java: Loading...
  4. bookkeeper-server/src/main/java/org/apache/bookkeeper/client/ReadLastConfirmedOp.java: Loading...
  5. bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RoundRobinDistributionSchedule.java: Loading...
  6. bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java: Loading...
  7. bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookieRecoveryTest.java: Loading...
  8. bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BaseTestCase.java: Loading...
  9. bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieFailureTest.java: Loading...
  10. bookkeeper-server/src/test/java/org/apache/bookkeeper/test/LedgerRecoveryTest.java: Loading...