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
          43 kB
          Ted Dunning
        2. ZOOKEEPER-1366.patch
          43 kB
          Ted Dunning
        3. ZOOKEEPER-1366.patch
          47 kB
          Ted Dunning
        4. ZOOKEEPER-1366.patch
          47 kB
          Ted Dunning
        5. ZOOKEEPER-1366-3.3.3.patch
          11 kB
          Ted Dunning
        6. ZOOKEEPER-1366.patch
          45 kB
          Marshall McMullen
        7. ZOOKEEPER-1366.patch
          45 kB
          Marshall McMullen
        8. ZOOKEEPER-1366.patch
          45 kB
          Marshall McMullen
        9. zookeeper-3.4.5-ZK1366-SC01.patch
          55 kB
          Chris Seawood
        10. ZOOKEEPER-1366.patch
          47 kB
          Michi Mutsuzaki
        11. ZOOKEEPER-1366.patch
          44 kB
          Patrick Hunt
        12. ZOOKEEPER-1366.patch
          45 kB
          Patrick 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

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

                Dates

                • Created:
                  Updated:
                  Resolved: