Bookkeeper
  1. Bookkeeper
  2. BOOKKEEPER-93

bookkeeper doesn't work correctly on OpenLedgerNoRecovery

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.0
    • Fix Version/s: 4.0.0
    • Component/s: None
    • Labels:
      None

      Description

      1) bookkeeper hang when openLedgerNoRecovery, since LedgerOpenOp didn't trigger callback when opening ledger no recovery.

      2) race condition in ReadLastConfirmOp

      ReadLastConfirmOp callback on readEntryComplete.
      a) first decrement numResponsePending
      b) then increment validResponses
      c) check validResponses to callback with OK
      b) check numResponsePending to callback with LedgerRecoveryException

      support two callbacks returns on readEntryComplete: A, B. (quorum/ensemble size : 2)

      a) A first decrement numResponsePending from 2 to 1.
      b) A increment validResponses from 0 to 1.
      c) B then decrement numResponsePending from 1 to 0.
      d) A check numResponsePending before B check validResponse, A found the numResponsePending is 0 now. A will callback with exception. But the right action is B check validResponse and callback with OK.

      3) if an LegerHandle is opened by openLedgerNoRecovery, the lastAddConfirmed will be set to -1. so all read requests will be failed since readEntry id > lastAddConfirmed.

      so I suggested that if an LegerHandle is opened by openLegerNoRecovery, the ledgerHandle is under unsafeRead mode. close/write operations will be failed, read operations should not check condition entry_id > lastAddConfirmed.

      1. bookkeeper-93_v3.patch
        8 kB
        Sijie Guo
      2. bookkeeper-93_v2.patch
        8 kB
        Sijie Guo
      3. bookkeeper-93.patch
        12 kB
        Sijie Guo

        Issue Links

          Activity

          Sijie Guo created issue -
          Sijie Guo made changes -
          Field Original Value New Value
          Attachment bookkeeper-93.patch [ 12500688 ]
          Sijie Guo made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Fix Version/s 3.4.0 [ 12316840 ]
          Sijie Guo made changes -
          Link This issue depends on BOOKKEEPER-94 [ BOOKKEEPER-94 ]
          Sijie Guo made changes -
          Attachment bookkeeper-93_v2.patch [ 12500807 ]
          Sijie Guo made changes -
          Link This issue blocks BOOKKEEPER-77 [ BOOKKEEPER-77 ]
          Sijie Guo made changes -
          Link This issue depends on BOOKKEEPER-94 [ BOOKKEEPER-94 ]
          Sijie Guo made changes -
          Link This issue is related to BOOKKEEPER-94 [ BOOKKEEPER-94 ]
          Sijie Guo made changes -
          Attachment bookkeeper-93_v3.patch [ 12500879 ]
          Ivan Kelly made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Assignee Sijie Guo [ hustlmsp ] Ivan Kelly [ ikelly ]
          Resolution Fixed [ 1 ]
          Ivan Kelly made changes -
          Affects Version/s 4.0.0 [ 12317843 ]
          Affects Version/s 3.4.0 [ 12316840 ]
          Fix Version/s 4.0.0 [ 12317843 ]
          Fix Version/s 3.4.0 [ 12316840 ]
          Ivan Kelly made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Link This issue blocks BOOKKEEPER-77 [ BOOKKEEPER-77 ]
          Gavin made changes -
          Link This issue is depended upon by BOOKKEEPER-77 [ BOOKKEEPER-77 ]

            People

            • Assignee:
              Ivan Kelly
              Reporter:
              Sijie Guo
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development