Skip to content

[CLN] Add max_batch_size to sqlite_log, use in push_logs #5010

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

Merged
merged 1 commit into from
Jul 1, 2025

Conversation

jairad26
Copy link
Contributor

@jairad26 jairad26 commented Jul 1, 2025

Description of changes

This PR removes the push_logs_batch_size from sqlite config, and replaces it with max_batch_size. It sets up with OnceLock for thread safe lazy initialization with the existing get_max_batch_sizes() on frontend creation.

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

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

Copy link
Contributor Author

jairad26 commented Jul 1, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

github-actions bot commented Jul 1, 2025

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)

@jairad26 jairad26 force-pushed the jai/fix-local-push-logs branch from 778eca5 to 89bf55b Compare July 1, 2025 15:32
@jairad26 jairad26 marked this pull request as ready for review July 1, 2025 15:33
Copy link
Contributor

propel-code-bot bot commented Jul 1, 2025

Remove push_logs_batch_size from Sqlite Config, Use get_max_batch_size()

This PR removes the push_logs_batch_size parameter from the SqliteDBConfig and related usage in the codebase, migrating batch sizing for sqlite push_logs operations to dynamically use the computed max batch size via get_max_batch_size(). Associated struct fields, defaults, and constructor parameters are updated for consistency, and usage of batch size in push_logs is refactored. The PR also includes a small conversion utility for ScalarEncoding to String.

Key Changes:
• Removed push_logs_batch_size from SqliteDBConfig and all usages
• Updated SqliteDb struct and constructors to remove push_logs_batch_size
• Refactored SqliteLog to store max_batch_size and use it in push_logs logic
• Added initialization and retrieval of max batch size from get_max_batch_size()
• Updated ServiceBasedFrontend to correctly initialize and propagate max_batch_size
• Added From<&ScalarEncoding> for String

Affected Areas:
• rust/sqlite/src/config.rs
• rust/sqlite/src/db.rs
• rust/log/src/sqlite_log.rs
• rust/frontend/src/impls/service_based_frontend.rs
• rust/types/src/scalar_encoding.rs

This summary was automatically generated by @propel-code-bot

@jairad26 jairad26 force-pushed the jai/fix-local-push-logs branch 3 times, most recently from b6aea1e to d7f6f55 Compare July 1, 2025 16:56
@jairad26 jairad26 force-pushed the jai/fix-local-push-logs branch from d7f6f55 to 38b9c72 Compare July 1, 2025 17:18
@jairad26 jairad26 changed the title [CLN] Use existing max_batch_size in sqlite push_logs [CLN] Add max_batch_size OnCeCell to sqlite_log, use in push_logs Jul 1, 2025
@jairad26 jairad26 changed the title [CLN] Add max_batch_size OnCeCell to sqlite_log, use in push_logs [CLN] Add max_batch_size OnceCell to sqlite_log, use in push_logs Jul 1, 2025
@jairad26 jairad26 changed the title [CLN] Add max_batch_size OnceCell to sqlite_log, use in push_logs [CLN] Add max_batch_size to sqlite_log, use in push_logs Jul 1, 2025
@jairad26 jairad26 merged commit d4994f0 into main Jul 1, 2025
116 of 118 checks passed
Inventrohyder pushed a commit to Inventrohyder/chroma that referenced this pull request Aug 5, 2025
…#5010)

## Description of changes

This PR removes the push_logs_batch_size from sqlite config, and
replaces it with max_batch_size. It sets up with OnceLock for thread
safe lazy initialization with the existing get_max_batch_sizes() on
frontend creation.

## Test plan

_How are these changes tested?_

- [ ] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes

_Are all docstrings for user-facing APIs updated if required? Do we need
to make documentation changes in the [docs
section](https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com)?_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants