Uploaded image for project: 'Kudu'
  1. Kudu
  2. KUDU-1345

HybridClock can run backwards when clocks are far out of sync

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.7.0
    • Fix Version/s: 0.7.1, 0.8.0
    • Component/s: None
    • Labels:
      None

      Description

      Nick Wolf reported an error he hit on his cluster where transactions were assigned out-of-order timestamps. After looking at his WALs for a while, I realized we have this bug:

      • the clock gets an update from another node a second in the future
      • we generate a lot of timestamps locally, which causes the clock to increment its logical portion
      • the logical portion exceeds the number of bits allocated to it (12 bits iirc). The way we return timestamps, this is OK – we simply add the logical and physical portions, so it "wraps" into the physical portion, causing it to increment forward a few microseconds as we do thousands of writes.
      • however, our host clock eventually reaches a higher value than the last physical portion. This causes us to reset our logical clock portion back to 1, which may actually rewind it back in time.

        Attachments

          Activity

            People

            • Assignee:
              tlipcon Todd Lipcon
              Reporter:
              tlipcon Todd Lipcon
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: