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

StandaloneVerifier does not fail when unable to verify SSTables, it only fails if Corruption is thrown

    XMLWordPrintableJSON

Details

    Description

      offline_tools_test.py::TestOfflineTools::test_sstableverify has the following check

             try:
                 (out, error, rc) = node1.run_sstableverify("keyspace1", "standard1", options=['-v'])
             except ToolError as e:
                 # Process sstableverify output to normalize paths in string to Python casing as above
                 error = re.sub("(?<=Corrupted: ).*", lambda match: os.path.normcase(match.group(0)), str(e))
      
                 assert re.search("Corrupted: " + sstable1, error)
                 assert e.exit_status == 1, str(e.exit_status)
      

      This checks if the corrupt log is present IFF ToolError is thrown, but does not validate that the error is actually thrown. I tried calling the same logic before the try to validate and see that it does not fail. If we fix the test to check for error we also see that the log that is returned to the user does not match 2.2’s behavior but instead returns different logic as digest validation throws IOException, which we do not convert to a CorruptSSTableException (which is the message the test checks for).

      This also shows another big issue, that when the digest fails verify passes

      Attachments

        Issue Links

          Activity

            People

              dcapwell David Capwell
              dcapwell David Capwell
              David Capwell
              Marcus Eriksson
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 0.5h
                  0.5h