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

Zookeeper should be tolerant of clock adjustments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 3.5.1, 3.6.0
    • None
    • 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-3.4.5-ZK1366-SC01.patch
          55 kB
          Chris Seawood
        2. ZOOKEEPER-1366-3.3.3.patch
          11 kB
          Ted Dunning
        3. ZOOKEEPER-1366.patch
          43 kB
          Ted Dunning
        4. ZOOKEEPER-1366.patch
          43 kB
          Ted Dunning
        5. ZOOKEEPER-1366.patch
          47 kB
          Ted Dunning
        6. ZOOKEEPER-1366.patch
          47 kB
          Ted Dunning
        7. ZOOKEEPER-1366.patch
          45 kB
          Marshall McMullen
        8. ZOOKEEPER-1366.patch
          45 kB
          Marshall McMullen
        9. ZOOKEEPER-1366.patch
          45 kB
          Marshall McMullen
        10. ZOOKEEPER-1366.patch
          47 kB
          Michi Mutsuzaki
        11. ZOOKEEPER-1366.patch
          44 kB
          Patrick D. Hunt
        12. ZOOKEEPER-1366.patch
          45 kB
          Patrick D. Hunt
        13. ZOOKEEPER-1366.patch
          55 kB
          Hongchao Deng
        14. ZOOKEEPER-1366.patch
          55 kB
          Hongchao Deng
        15. ZOOKEEPER-1366.patch
          57 kB
          Hongchao Deng
        16. ZOOKEEPER-1366.patch
          57 kB
          Hongchao Deng
        17. ZOOKEEPER-1366.patch
          58 kB
          Hongchao Deng
        18. ZOOKEEPER-1366.patch
          60 kB
          Hongchao Deng

        Issue Links

          Activity

            People

              hdeng Hongchao Deng
              tdunning Ted Dunning
              Votes:
              7 Vote for this issue
              Watchers:
              28 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: