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

Slow query log indicates opposite LTE when GTE operator

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Slow query log is indicating a '<=' when a ">=" operator was sent. This appears to be a logging only issue, but it threw off development for a day figuring this out. Please fix.

      How to reproduce. Set slow query log timeout to 1 millisecond.

      In cqlsh run

      CREATE TABLE atable (
            .id text,
            timestamp timestamp,
            PRIMARY KEY ((id), timestamp)
       ) WITH CLUSTERING ORDER BY (timestamp DESC);
      insert into atable (id, timestamp) VALUES ( '1',1);
      insert into atable (id, timestamp) VALUES ( '2',2);
      insert into atable (id, timestamp) VALUES ( '3',3);
      insert into atable (id, timestamp) VALUES ( '4',4);
      insert into atable (id, timestamp) VALUES ( '5',5);
      insert into atable (id, timestamp) VALUES ( '6',6);
      insert into atable (id, timestamp) VALUES ( '7',7);
      insert into atable (id, timestamp) VALUES ( '8',8);
      insert into atable (id, timestamp) VALUES ( '9',9);
      insert into atable (id, timestamp) VALUES ( '10',10);
      insert into atable (id, timestamp) VALUES ( '11',11);
      
      select * from atable where timestamp >= '1970-01-01 00:00:00.006+0000' allow filtering;
      

      In the logs it prints:

      DEBUG 1 operations were slow in the last 5003 msecs:
      <SELECT * FROM ks.atable WHERE timestamp <= 1970-01-01 00:00Z LIMIT 100>, time 7 msec - slow timeout 1 msec
      

      But the query works appropriately and returns

       id | timestamp
      ----+---------------------------------
        6 | 1970-01-01 00:00:00.006000+0000
        7 | 1970-01-01 00:00:00.007000+0000
        9 | 1970-01-01 00:00:00.009000+0000
       10 | 1970-01-01 00:00:00.010000+0000
        8 | 1970-01-01 00:00:00.008000+0000
       11 | 1970-01-01 00:00:00.011000+0000
      
      (6 rows)
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            adelapena Andres de la Peña Assign to me
            wally.baggaley@smartrg.com Wallace Baggaley
            Andres de la Peña
            Andres de la Peña, Berenguer Blasi
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 50m
                50m

                Slack

                  Issue deployment