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

Provide timestamp with true microsecond resolution

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Low
    • Resolution: Won't Fix
    • Fix Version/s: 2.2.0 beta 1
    • Component/s: None
    • Labels:
    • Environment:

      DSE Cassandra 3.1, but also HEAD

      Description

      I noticed this blog post: http://aphyr.com/posts/294-call-me-maybe-cassandra mentioned issues with millisecond rounding in timestamps and was able to reproduce the issue. If I specify a timestamp in a mutating query, I get microsecond precision, but if I don't, I get timestamps rounded to the nearest millisecond, at least for my first query on a given connection, which substantially increases the possibilities of collision.

      I believe I found the offending code, though I am by no means sure this is comprehensive. I think we probably need a fairly comprehensive replacement of all uses of System.currentTimeMillis() with System.nanoTime().

        Attachments

        1. microtimstamp_random_rev2.patch
          2 kB
          Christopher Smith
        2. microtimstamp_random.patch
          2 kB
          Christopher Smith
        3. microtimstamp.patch
          2 kB
          Christopher Smith

          Issue Links

            Activity

              People

              • Assignee:
                benedict Benedict
                Reporter:
                xcbsmith Christopher Smith
                Authors:
                Benedict
              • Votes:
                1 Vote for this issue
                Watchers:
                20 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: