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

Assertion in SSTableReader during repair.

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
    • Normal
    • Resolution: Fixed
    • None
    • None
    • None
    • Normal

    Description

      I ran a git bisect run using the attached bisect script. Repro code:

      # 5dfe241: trunk as of my git bisect run
      # 345772d: empirically determined "good" commit.
      git bisect start 5dfe241 345772d
      git bisect run ./sstablereader-assertion-bisect-helper-v2
      

      The first failing commit is 5ebadc1 (first parent of refs/bisect/bad).

      Prior to 5ebadc1, SSTableReader#close() never checked reference count. After 5ebadc1, there was an assertion for references.get() == 0. However, since the reference count is initialized to 1, a SSTableReader#close() was always guaranteed to either throw an AssertionError or to be a second call to SSTableReader#tidy() on the same SSTableReader.

      The attached patch chooses an in-between behavior. It requires the reference count to match the initialization value of 1 for SSTableReader#close(), and the same behavior as 5ebadc1 otherwise.

      This allows repair to finish successfully, but I'm not 100% certain what the desired behavior is for SSTableReader#close(). Should it close without regard to reference count, as it did pre-5ebadc1?

      Edit: accidentally uploaded a flawed version of sstablereader-assertion-bisect-helper (doesn't work out-of-the-box with git bisect).

      Attachments

        1. 7000.supplement.txt
          2 kB
          Benedict Elliott Smith
        2. 7000-2.1-v2.txt
          2 kB
          Yuki Morishita
        3. sstablereader-assertion-bisect-helper-v2
          2 kB
          Ben Chan
        4. sstablereader-assertion.patch
          2 kB
          Ben Chan
        5. sstablereader-assertion-bisect-helper
          2 kB
          Ben Chan

        Issue Links

        Activity

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

          People

            usrbincc Ben Chan Assign to me
            usrbincc Ben Chan
            Ben Chan
            Yuki Morishita
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment