Details
-
Bug
-
Status: Resolved
-
Low
-
Resolution: Fixed
-
None
-
Low
Description
Related to CASSANDRA-6812, but a little simpler: when compacting, we mess quite badly with the page cache. One thing we can do to mitigate this problem is to use the sstable we're writing before we've finished writing it, and to drop the regions from the old sstables from the page cache as soon as the new sstables have them (even if they're only written to the page cache). This should minimise any page cache churn, as the old sstables must be larger than the new sstable, and since both will be in memory, dropping the old sstables is at least as good as dropping the new.
The approach is quite straight-forward. Every X MB written:
- grab flushed length of index file;
- grab second to last index summary record, after excluding those that point to positions after the flushed length;
- open index file, and check that our last record doesn't occur outside of the flushed length of the data file (pretty unlikely)
- Open the sstable with the calculated upper bound
Some complications:
- must keep running copy of compression metadata for reopening with
- we need to be able to replace an sstable with itself but a different lower bound
- we need to drop the old page cache only when readers have finished
Attachments
Attachments
Issue Links
- breaks
-
CASSANDRA-8157 Opening results early with leveled compactions broken
- Resolved
-
CASSANDRA-8683 Ensure early reopening has no overlap with replaced files
- Resolved
-
CASSANDRA-9508 Avoid early opening of compaction results when doing anticompaction
- Resolved
-
CASSANDRA-11886 Streaming will miss sections for early opened sstables during compaction
- Resolved
-
CASSANDRA-13752 Corrupted SSTables created in 3.11
- Resolved
-
CASSANDRA-8034 AssertionError when STOP:ing compactions
- Resolved
-
CASSANDRA-8061 tmplink files are not removed
- Resolved
-
CASSANDRA-8248 Possible memory leak
- Resolved
-
CASSANDRA-8535 java.lang.RuntimeException: Failed to rename XXX to YYY
- Resolved
-
CASSANDRA-8832 SSTableRewriter.abort() should be more robust to failure
- Resolved
-
CASSANDRA-9396 Canonical view of compacting SSTables not working as expected
- Resolved
-
CASSANDRA-10357 mmap file boundary selection is broken for some large files
- Resolved
-
CASSANDRA-10534 CompressionInfo not being fsynced on close
- Resolved
-
CASSANDRA-11468 Reading from early opened, and compressed, sstable throws CorruptSSTableException
- Resolved
-
CASSANDRA-8766 SSTableRewriter opens all sstables as early before completing the compaction
- Resolved
-
CASSANDRA-8750 Ensure SSTableReader.last corresponds exactly with the file end
- Resolved
- depends upon
-
CASSANDRA-6912 SSTableReader.isReplaced does not allow for safe resource cleanup
- Resolved
- is depended upon by
-
CASSANDRA-6987 sstablesplit fails in 2.1
- Resolved
-
CASSANDRA-6812 Iterative Memtable->SSTable Replacement
- Open
- is related to
-
CASSANDRA-6746 Reads have a slow ramp up in speed
- Resolved
- relates to
-
CASSANDRA-8764 Refactor the way we notify compaction strategies about early opened files
- Resolved
-
CASSANDRA-9699 Make choice of sstable reader types explicit
- Resolved
-
CASSANDRA-7167 o.a.c.db.KeyCacheTest unit test failing intermittently in 2.1
- Resolved
-
CASSANDRA-8750 Ensure SSTableReader.last corresponds exactly with the file end
- Resolved
- supercedes
-
CASSANDRA-6746 Reads have a slow ramp up in speed
- Resolved