Skip to content
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

[ENH] get collection info for compactor #1778

Merged
merged 12 commits into from
Feb 28, 2024

Conversation

weiligu
Copy link
Contributor

@weiligu weiligu commented Feb 27, 2024

Description of changes

https://linear.app/trychroma/issue/CHR-293/get-collection-ids-for-compactor

  • get collection information for collections that need to be compacted, order by timestamps of the log
  • DB retry is not included

Test plan

  • record_log_test and record_log_service_test

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?

Copy link
Contributor Author

weiligu commented Feb 27, 2024

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

Copy link

Please tag your PR title with one of: [ENH | BUG | DOC | TST | BLD | PERF | TYP | CLN | CHORE]. See https://docs.trychroma.com/contributing#contributing-code-and-ideas

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@weiligu weiligu changed the title proto [ENH] get collection info for compactor Feb 27, 2024
@weiligu weiligu added the enhancement New feature or request label Feb 27, 2024 — with Graphite App
Comment on lines -3 to -4
// protoc-gen-go v1.26.0
// protoc v4.24.4
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix this

@weiligu weiligu marked this pull request as ready for review February 27, 2024 00:51
Copy link
Contributor

@Ishiihara Ishiihara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

log.Error("error getting collection info", zap.Error(err))
return nil, grpcutils.BuildInternalGrpcError("error getting collection info")
}
for index := range recordLogs {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for _, recordLog := range recordLogs {
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

select r.collection_id, r.id, r.timestamp, row_number() over(partition by r.collection_id order by r.id) as rank
from record_logs r, collections c
where r.collection_id = c.id
and r.id>c.log_position
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will compactor update the log position?

Copy link
Contributor Author

@weiligu weiligu Feb 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes go API is tracked here https://linear.app/trychroma/issue/CHR-298/segment-compaction-flush
log position needs to be updated in the same transaction that also registers S3 files.

@weiligu weiligu force-pushed the 02-23-get_collection_ids_to_compact branch from 5d417b4 to 516b33b Compare February 28, 2024 18:59
@weiligu weiligu merged commit 44e8ff7 into main Feb 28, 2024
119 checks passed
atroyn pushed a commit to csbasil/chroma that referenced this pull request Apr 3, 2024
## Description of changes

https://linear.app/trychroma/issue/CHR-293/get-collection-ids-for-compactor
- get collection information for collections that need to be compacted,
order by timestamps of the log
- DB retry is not included

## Test plan
- [ ] record_log_test and record_log_service_test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants