Uploaded image for project: 'Bookkeeper'
  1. Bookkeeper
  2. BOOKKEEPER-584

Data loss when ledger metadata is overwritten

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.2.2, 4.3.0
    • Component/s: bookkeeper-client
    • Labels:
      None

      Description

      this is an issue introduced when fixing BOOKKEEPER-337. the original #resolveConflicts logic was removed by just checking state and current ensemble, which tends to fixing multiple bookies changed in same ensemble.

      the issue could be reproduce by a test case in following steps:

      1. Ledger L writing several entries to ensemble A, B, C.
      2. C succeed, B failed with slow responses and A failed with unrecoverable issue.
      3. L would fail all the pending add ops and close the ledger with lastEntryId = -1. (since no add operations succeed).
      4. The ownership of this Ledger is released and transferred to other machines (it is the normal use case for Hedwig).
      5. the new owner tried to open Ledger L and recover the ensemble, suppose A, B is back to normal at this case. so L is closed with lastEntryId is not -1.
      6. the old owner although closed the ledger, but doesn't blocking the responses for already failed pending add ops. so failures for B would kick in some ensemble changes and since the ledger metadata is already changed by new owner, so it needs to resolve the conflicts and update the ledger metadata with lastEntryId = -1 again. so we get different lastEntryId at different time, which cause inconsistency and data loss.

      for details of this sequence, a test case could describe it more clearly.

        Attachments

        1. BOOKKEEPER-584.diff
          14 kB
          Sijie Guo
        2. BOOKKEEPER-584.diff
          16 kB
          Sijie Guo
        3. BOOKKEEPER-584.diff
          22 kB
          Sijie Guo
        4. BOOKKEEPER-584.branch4-2.diff
          13 kB
          Ivan Kelly

          Activity

            People

            • Assignee:
              hustlmsp Sijie Guo
              Reporter:
              hustlmsp Sijie Guo
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: