-
Notifications
You must be signed in to change notification settings - Fork 3.8k
CASSANDRA-20918 Add cursor-based low allocation optimized compaction implementation #4402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
src/java/org/apache/cassandra/db/compaction/CompactionTask.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionTask.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionTask.java
Outdated
Show resolved
Hide resolved
blambov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It must be stated that this approach that bundles all the steps of the processing in one single file will be quite difficult to maintain and keep in sync with the combination of iterators and transformations that we use in other parts of the code such as the query path. However, once we have reached a point of stability for a piece of functionality where we do not expect it to change significantly for a long time, it does makes sense to unpack the code and present it in a way that makes its execution as direct as possible, and this patch is a good such representation of the compaction process.
Personally, I am very unhappy about switching to mutable, pooled and reused objects, which are significantly more unwieldy and error prone, especially in contexts where concurrent access can occur. It seems this is becoming a necessity if we need to achieve acceptable performance with the current state of our heap usage, but we still need to very carefully separate the mutable versions of concepts from the immutable ones used throughout the code base. Suddenly making a DeletionTime mutable is not an acceptable change.
First batch of targeted comments below, mainly going over CompactionCursor.java.
src/java/org/apache/cassandra/db/compaction/CompactionTask.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionTask.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionCursor.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionCursor.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionCursor.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionCursor.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionCursor.java
Outdated
Show resolved
Hide resolved
blambov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next batch of comments.
| } | ||
| if (!UnfilteredSerializer.hasAllColumns(flags)) | ||
| { | ||
| // TODO: re-implement GC free |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DataStax's branch has an implementation of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's an important optimization, but it should not block this PR IMO.
src/java/org/apache/cassandra/io/sstable/format/SortedTableWriter.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/writers/DefaultCompactionWriter.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/io/sstable/metadata/MetadataCollector.java
Show resolved
Hide resolved
src/java/org/apache/cassandra/io/sstable/metadata/MetadataCollector.java
Outdated
Show resolved
Hide resolved
blambov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next batch of comments.
src/java/org/apache/cassandra/io/util/ReusableDecoratedKey.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/io/sstable/AbstractSSTableSimpleWriter.java
Show resolved
Hide resolved
src/java/org/apache/cassandra/io/sstable/SSTableCursorReader.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/io/sstable/SSTableCursorReader.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionTask.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionCursor.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionCursor.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/AbstractCompactionPipeline.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionCursor.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionCursor.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionCursor.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionCursor.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionTask.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/AbstractCompactionPipeline.java
Outdated
Show resolved
Hide resolved
4a3bed8 to
ef0a4ba
Compare
|
Squashed fixup commits and rebased on top of latest trunk for clarity |
|
@blambov I think your concerns have been addressed and OK to proceed? Looking for a second reviewer |
Adds a compaction implementation utilizing new fixed allocation SSTable reader/writer implementations, and other purpose built code, leading to improved efficiencies. patch by Nitsan Wakart; reviewed by Branimir Lambov, +TBD for CASSANDRA-20918
ef0a4ba to
2243d4f
Compare
8844205 to
ebf366d
Compare
patch by Nitsan Wakart; reviewed by TBD for CASSANDRA-TBD
Thanks for sending a pull request! Here are some tips if you're new here:
Commit messages should follow the following format:
The Cassandra Jira