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

Race condition on repair snapshots

    XMLWordPrintableJSON

Details

    Description

      If an endpoint is convicted and that endpoint is a coordinator then ActiveRepairService::removeParentRepairSession is called.

      The issue is that this occurs on clearSnapshotExecutor and can happen while RepairMessageVerbHandler is in process of taking a snapshot. So then you get a race condition and clearSnapshot will throw a java.nio.file.DirectoryNotEmptyException

       

      public static void deleteRecursiveWithThrottle(File dir, RateLimiter rateLimiter)
      {
          if (dir.isDirectory())
          {
              String[] children = dir.list();
              for (String child : children)
                  deleteRecursiveWithThrottle(new File(dir, child), rateLimiter);
          }
      
          // The directory is now empty so now it can be smoked
          deleteWithConfirmWithThrottle(dir, rateLimiter);
      } 

      Due to the directory not being empty when it goes to remove the directory at the end.

      Attachments

        1. signature.asc
          0.5 kB
          miklosovic

        Activity

          People

            smiklosovic Stefan Miklosovic
            cam1982 Cameron Zemek
            Stefan Miklosovic
            Votes:
            1 Vote for this issue
            Watchers:
            7 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 - 1h
                1h