Skip to content

[ENH]: Update collection#6163

Merged
sanketkedia merged 3 commits intomainfrom
01-14-_enh_update_collection
Jan 16, 2026
Merged

[ENH]: Update collection#6163
sanketkedia merged 3 commits intomainfrom
01-14-_enh_update_collection

Conversation

@sanketkedia
Copy link
Copy Markdown
Contributor

@sanketkedia sanketkedia commented Jan 15, 2026

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • collection.modify() handling all cases
  • New functionality
    • ...

Test plan

How are these changes tested?
Added tests

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

Migration plan

None

Observability plan

None

Documentation Changes

None

@github-actions
Copy link
Copy Markdown

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)

Copy link
Copy Markdown
Contributor Author

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

@sanketkedia sanketkedia marked this pull request as ready for review January 15, 2026 07:37
@propel-code-bot
Copy link
Copy Markdown
Contributor

propel-code-bot bot commented Jan 15, 2026

Implement collection update workflow across API, backend, and schema layers

Introduces end-to-end support for UpdateCollectionRequest, wiring protobuf conversion, backend routing, Spanner storage logic, and extensive integration tests. The new flow supports renaming, dimension adjustments, metadata replacement/reset, and schema updates for SPANN and embedding function configuration while enforcing name uniqueness and transaction safety.

Key Changes

• Added UpdateCollectionRequest/UpdateCollectionResponse conversions in rust/rust-sysdb/src/types.rs, including metadata parsing and JSON configuration handling
• Exposed Backend::update_collection for dispatch and implemented SysdbService::update_collection to execute requests via assign/run pattern
• Implemented SpannerBackend::update_collection to validate existence, enforce unique names, mutate metadata rows, and propagate schema updates across all collection_compaction_cursors regions within a single transaction
• Extended Schema::apply_update_configuration to reject HNSW updates and mutate SPANN/embedding function defaults and overrides consistently
• Added comprehensive async integration tests covering name/dimension changes, metadata replace/reset, schema updates (SPANN/embedding function), conflict/error cases, and no-op behavior

Affected Areas

rust/rust-sysdb/src/types.rs
rust/rust-sysdb/src/backend.rs
rust/rust-sysdb/src/server.rs
rust/rust-sysdb/src/spanner.rs
rust/types/src/collection_schema.rs
rust/rust-sysdb/src/tests

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

/// - `dimension`: New dimension value
/// - `metadata`: New metadata (replaces existing if provided)
/// - `reset_metadata`: If true, deletes all existing metadata
/// - `new_configuration`: New configuration (selective update of hnsw, spann, or embedding function)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what about schema_str? would need to update that during compactions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah, I am doing only the user facing update. Later this should be modified to account for all internal updates also such as schema, segment file paths, etc

@blacksmith-sh

This comment has been minimized.

.await;

// Update spann config
let spann_update = chroma_types::UpdateSpannConfiguration {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should separate out the tests sometime, this file is huge now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yea, will do next week

// Update Operations
// ============================================================

/// Update a collection.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i take it there's no reason to have a batch API for this? Could be beneficial for GC?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will modify when needed. Will have to read GC code

@sanketkedia sanketkedia merged commit 01de04d into main Jan 16, 2026
128 of 130 checks passed
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