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

Index building fails to start CFS.readOrdering when reading

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

Details

    • Bug
    • Status: Resolved
    • Urgent
    • Resolution: Fixed
    • 3.0.7, 3.6
    • None
    • None
    • Critical

    Description

      This code for indexing partition when building index in 3.0 is:

      SinglePartitionReadCommand cmd = SinglePartitionReadCommand.fullPartitionRead(cfs.metadata, FBUtilities.nowInSeconds(), key);
      
      try (OpOrder.Group opGroup = cfs.keyspace.writeOrder.start();
            UnfilteredRowIterator partition = cmd.queryMemtableAndDisk(cfs, opGroup))
      {
          cfs.indexManager.indexPartition(partition, opGroup, indexes, cmd.nowInSec());
      }
      

      which is clearly incorrect as the OpOrder that queryMemtableAndDisk expects is the one from cfs.readOrdering, not the one for writes on the keyspace.
      This wasn't a problem prior to 3.0 as the similar code was using the pager, which ended up properly taking the read OpOrder internally but I messed this up in CASSANDRA-8099.

      Thanks to Stefania Alborghetti for pointing that out.

      Attachments

        Activity

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

          People

            slebresne Sylvain Lebresne Assign to me
            slebresne Sylvain Lebresne
            Sylvain Lebresne
            Stefania Alborghetti
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment