Buggy code:
private PriorityQueue < FileStruct > initializePriorityQueue ( List < String > files , List < Range > ranges , int minBufferSize ) { } static Set < List < String > > getCompactionBuckets ( List < String > files , long min ) { } int doCompaction ( int threshold ) throws IOException { } void doMajorCompaction ( long skip ) throws IOException { } void doMajorCompactionInternal ( long skip ) throws IOException { } long getExpectedCompactedFileSize ( List < String > files ) { } String getMaxSizeFile ( List < String > files ) { } boolean doAntiCompaction ( List < Range > ranges , EndPoint target , List < String > fileList ) throws IOException { } void forceCleanup ( ) { } void doCleanupCompaction ( ) throws IOException { } void doCleanup ( String file ) throws IOException { } boolean doFileAntiCompaction ( List < String > files , List < Range > ranges , EndPoint target , List < String > fileList ) throws IOException { boolean result = false ; long startTime = System . currentTimeMillis ( ) ; long totalBytesRead = 0 ; long totalBytesWritten = 0 ; long totalkeysRead = 0 ; long totalkeysWritten = 0 ; String rangeFileLocation ; String mergedFileName ; IPartitioner p = StorageService . getPartitioner ( ) ; long expectedRangeFileSize = getExpectedCompactedFileSize ( files ) ; expectedRangeFileSize = expectedRangeFileSize // 2 ; rangeFileLocation = DatabaseDescriptor . getCompactionFileLocation ( expectedRangeFileSize ) ; if ( rangeFileLocation == null ) { ColumnFamilyStore . logger_ . warn ( ( ( "Total<seq2seq4repair_space>bytes<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>written<seq2seq4repair_space>for<seq2seq4repair_space>range<seq2seq4repair_space>compaction<seq2seq4repair_space>..." + expectedRangeFileSize ) + "<seq2seq4repair_space>is<seq2seq4repair_space>greater<seq2seq4repair_space>than<seq2seq4repair_space>the<seq2seq4repair_space>safe<seq2seq4repair_space>limit<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>disk<seq2seq4repair_space>space<seq2seq4repair_space>available." ) ) ; return result ; } PriorityQueue < FileStruct > pq = initializePriorityQueue ( files , ranges , ColumnFamilyStore . BUFSIZE ) ; if ( pq . isEmpty ( ) ) { return result ; } mergedFileName = getTempSSTableFileName ( ) ; SSTable ssTableRange = null ; String lastkey = null ; List < FileStruct > lfs = new ArrayList < FileStruct > ( ) ; DataOutputBuffer bufOut = new DataOutputBuffer ( ) ; int expectedBloomFilterSize = SSTable . getApproximateKeyCount ( files ) ; expectedBloomFilterSize = ( expectedBloomFilterSize > 0 ) ? expectedBloomFilterSize : SSTable . indexInterval ( ) ; if ( ColumnFamilyStore . logger_ . isDebugEnabled ( ) ) ColumnFamilyStore . logger_ . debug ( ( "Expected<seq2seq4repair_space>bloom<seq2seq4repair_space>filter<seq2seq4repair_space>size<seq2seq4repair_space>:<seq2seq4repair_space>" + expectedBloomFilterSize ) ) ; List < ColumnFamily > columnFamilies = new ArrayList < ColumnFamily > ( ) ; while ( ( ( pq . size ( ) ) > 0 ) || ( ( lfs . size ( ) ) > 0 ) ) { FileStruct fs = null ; if ( ( pq . size ( ) ) > 0 ) { fs = pq . poll ( ) ; } if ( ( fs != null ) && ( ( lastkey == null ) || ( lastkey . equals ( fs . getKey ( ) ) ) ) ) { lastkey = fs . getKey ( ) ; lfs . add ( fs ) ; } else { Collections . sort ( lfs , new FileStructComparator ( ) ) ; ColumnFamily columnFamily ; bufOut . reset ( ) ; if ( ( lfs . size ( ) ) > 1 ) { for ( FileStruct filestruct : lfs ) { try { filestruct . getBufIn ( ) . readInt ( ) ; IndexHelper . skipBloomFilterAndIndex ( filestruct . getBufIn ( ) ) ; if ( ( columnFamilies . size ( ) ) > 1 ) { ColumnFamilyStore . merge ( columnFamilies ) ; } columnFamilies . add ( ColumnFamily . serializer ( ) . deserialize ( filestruct . getBufIn ( ) ) ) ; } catch ( Exception ex ) { ColumnFamilyStore . logger_ . warn ( LogUtil . throwableToString ( ex ) ) ; } } columnFamily = ColumnFamilyStore . resolveAndRemoveDeleted ( columnFamilies ) ; columnFamilies . clear ( ) ; if ( columnFamily != null ) { ColumnFamily . serializerWithIndexes ( ) . serialize ( columnFamily , bufOut ) ; } } else { FileStruct filestruct = lfs . get ( 0 ) ; int size = filestruct . getBufIn ( ) . readInt ( ) ; bufOut . write ( filestruct . getBufIn ( ) , size ) ; } if ( Range . isTokenInRanges ( StorageService . getPartitioner ( ) . getInitialToken ( lastkey ) , ranges ) ) { if ( ssTableRange == null ) { if ( target != null ) { <START_BUG> rangeFileLocation = ( rangeFileLocation + ( System . getProperty ( "file.separator" ) ) ) + "bootstrap" ; <END_BUG> } FileUtils . createDirectory ( rangeFileLocation ) ; String fname = new File ( rangeFileLocation , mergedFileName ) . getAbsolutePath ( ) ; ssTableRange = new SSTable ( fname , expectedBloomFilterSize , StorageService . getPartitioner ( ) ) ; } try { ssTableRange . append ( lastkey , bufOut ) ; } catch ( Exception ex ) { ColumnFamilyStore . logger_ . warn ( LogUtil . throwableToString ( ex ) ) ; } } totalkeysWritten ++ ; for ( FileStruct filestruct : lfs ) { try { filestruct . advance ( ) ; if ( filestruct . isExhausted ( ) ) { continue ; } while ( ! ( Range . isTokenInRanges ( StorageService . getPartitioner ( ) . getInitialToken ( filestruct . getKey ( ) ) , ranges ) ) ) { filestruct . advance ( ) ; if ( filestruct . isExhausted ( ) ) { break ; } } if ( ! ( filestruct . isExhausted ( ) ) ) { pq . add ( filestruct ) ; } totalkeysRead ++ ; } catch ( Exception ex ) { ColumnFamilyStore . logger_ . warn ( "corrupt<seq2seq4repair_space>sstable?" , ex ) ; filestruct . close ( ) ; } } lfs . clear ( ) ; lastkey = null ; if ( fs != null ) { pq . add ( fs ) ; } } }

Fix:
rangeFileLocation = ( rangeFileLocation + ( File . separator ) ) + "bootstrap" ;