-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENH] Update compactor to flush total records upon compaction (#3483)
## Description of changes Updates the compactor to calculate the total records per collection and flush to the sysdb upon every compaction. *Summarize the changes made by this PR.* - New functionality - `FlushCollectionCompaction` struct includes `TotalRecordsPostCompaction` - `SysDB` populates the `total_records_post_compaction` column when receiving a flush - `ArrowBlockfileFlusher` contains a new attribute, `total_keys` - `ArrowUnorderedBlockfileWriter` sums the total keys using the `SparseIndexWriter` and returns an `ArrowBlockfileFlusher` with the summed count - `RegisterInput` contains a new attribute, `total_records_post_compaction ` - If `CompactOrchestrator`, when handling `CommitSegmentWriterOutput`, receives a `ChromaSegmentFlusher::RecordSegment`, it reads `total_keys()` and sets it as an attribute on itself. - `ChromaSegmentFlusher::RecordSegment` has `total_keys()` through its `ArrowBlockfileFlusher` - `CompactOrchestrator` sends its `num_records_last_compaction` value to a `RegisterInput` to be flushed to the `SysDB` ## Test plan *How are these changes tested?* - [x] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust - [x] Tested locally and confirmed that compaction correctly updates the column in the `SysDB` ## Documentation Changes *Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs repository](https://github.com/chroma-core/docs)?*
- Loading branch information
Showing
19 changed files
with
286 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.