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

Zookeeper should be tolerant of clock adjustments

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.1, 3.6.0
    • Component/s: None
    • Labels:
      None

      Description

      If you want to wreak havoc on a ZK based system just do [date -s "+1hour"] and watch the mayhem as all sessions expire at once.

      This shouldn't happen. Zookeeper could easily know handle elapsed times as elapsed times rather than as differences between absolute times. The absolute times are subject to adjustment when the clock is set while a timer is not subject to this problem. In Java, System.currentTimeMillis() gives you absolute time while System.nanoTime() gives you time based on a timer from an arbitrary epoch.

      I have done this and have been running tests now for some tens of minutes with no failures. I will set up a test machine to redo the build again on Ubuntu and post a patch here for discussion.

        Attachments

        1. ZOOKEEPER-1366.patch
          60 kB
          Hongchao Deng
        2. ZOOKEEPER-1366.patch
          58 kB
          Hongchao Deng
        3. ZOOKEEPER-1366.patch
          57 kB
          Hongchao Deng
        4. ZOOKEEPER-1366.patch
          57 kB
          Hongchao Deng
        5. ZOOKEEPER-1366.patch
          55 kB
          Hongchao Deng
        6. ZOOKEEPER-1366.patch
          55 kB
          Hongchao Deng
        7. ZOOKEEPER-1366.patch
          45 kB
          Patrick Hunt
        8. ZOOKEEPER-1366.patch
          44 kB
          Patrick Hunt
        9. ZOOKEEPER-1366.patch
          47 kB
          Michi Mutsuzaki
        10. ZOOKEEPER-1366.patch
          45 kB
          Marshall McMullen
        11. ZOOKEEPER-1366.patch
          45 kB
          Marshall McMullen
        12. ZOOKEEPER-1366.patch
          45 kB
          Marshall McMullen
        13. ZOOKEEPER-1366.patch
          47 kB
          Ted Dunning
        14. ZOOKEEPER-1366.patch
          47 kB
          Ted Dunning
        15. ZOOKEEPER-1366.patch
          43 kB
          Ted Dunning
        16. ZOOKEEPER-1366.patch
          43 kB
          Ted Dunning
        17. ZOOKEEPER-1366-3.3.3.patch
          11 kB
          Ted Dunning
        18. zookeeper-3.4.5-ZK1366-SC01.patch
          55 kB
          Chris Seawood

          Issue Links

          There are no Sub-Tasks for this issue.

            Activity

              People

              • Assignee:
                hdeng Hongchao Deng
                Reporter:
                tdunning Ted Dunning
              • Votes:
                7 Vote for this issue
                Watchers:
                31 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: