Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-387

closeLedger shouldn't shut down all QuorumEngines

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • contrib-bookkeeper
    • None

    Description

      We had initially assumed one ledger open at a time, and LedgerRecoverMonitor reads and closes a ledger without instantiating a QuorumEngine. Consequently, when closing a ledger, we have to shut down a QuorumEngine only if there is one. A poor way of implementing it is by having a for loop that iterates over all available QuorumEngines and shut them down. Given the assumptions of one ledger at a time and no QuorumEngine for LedgerRecoveryMonitor, this implementation works. However, as we move to a more flexible model in which multiple ledgers can be open and closed at arbitrary times, the for loop choice no longer works.

      The attached patch fixes this problem by just shutting down the QuorumEngine instance corresponding to the ledger being closed, and it checks if a QuorumEngine exists before submitting a STOP operation. The patch also includes a test that opens four ledger, and then sequentially writes to the each ledger and closes it.

      Attachments

        1. ZOOKEEPER-387.patch
          12 kB
          Flavio Paiva Junqueira

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            fpj Flavio Paiva Junqueira
            fpj Flavio Paiva Junqueira
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment