Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-11547

Add background thread to check for clock drift

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Low
    • Resolution: Won't Fix
    • Fix Version/s: None
    • Component/s: Legacy/Core
    • Labels:

      Description

      The system clock has the potential to drift while a system is running. As a simple way to check if this occurs, we can run a background thread that wakes up every n seconds, reads the system clock, and checks to see if, indeed, n seconds have passed.

      • If the clock's current time is less than the last recorded time (captured n seconds in the past), we know the clock has jumped backward.
      • If n seconds have not elapsed, we know the system clock is running slow or has moved backward (by a value less than n)
      • If (n + a small offset) seconds have elapsed, we can assume we are within an acceptable window of clock movement. Reasons for including an offset are the clock checking thread might not have been scheduled on time, or garbage collection, and so on.
      • If the clock is greater than (n + a small offset) seconds, we can assume the clock jumped forward.

      In the unhappy cases, we can write a message to the log and increment some metric that the user's monitoring systems can trigger/alert on.

        Attachments

          Activity

            People

            • Assignee:
              jasobrown Jason Brown
              Reporter:
              jasobrown Jason Brown
              Authors:
              Jason Brown
              Reviewers:
              T Jake Luciani
            • Votes:
              1 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: