Skip to content

[ENH]: allow deleting v0 from version file & correctly propagate errors on DeleteCollectionVersion #4579

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
May 23, 2025

Conversation

codetheweb
Copy link
Contributor

@codetheweb codetheweb commented May 19, 2025

Description of changes

Prior to this change, v0 could not be deleted from a version file. This also correctly propagates errors for the DeleteCollectionVersion method.

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?

n/a

@@ -131,6 +133,7 @@ func convertToCreateCollectionModel(req *coordinatorpb.CreateCollectionRequest)
GetOrCreate: req.GetGetOrCreate(),
TenantID: req.GetTenant(),
DatabaseName: req.GetDatabase(),
Ts: time.Now().Unix(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

prior to this, v0 in the version file always had created_at_secs: 0

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)

@codetheweb codetheweb force-pushed the feat-gc-list-files-at-version-operator branch from 7a408ad to c3dbe3a Compare May 20, 2025 18:03
@codetheweb codetheweb force-pushed the fix-sysdb-allow-v0-deletion branch from ea5808a to 491f743 Compare May 20, 2025 18:03
@codetheweb codetheweb force-pushed the feat-gc-list-files-at-version-operator branch from c3dbe3a to 40357ea Compare May 20, 2025 18:44
@codetheweb codetheweb force-pushed the fix-sysdb-allow-v0-deletion branch from 491f743 to 9007b34 Compare May 20, 2025 18:44
@codetheweb codetheweb force-pushed the feat-gc-list-files-at-version-operator branch from 40357ea to aa00a67 Compare May 20, 2025 19:42
@codetheweb codetheweb force-pushed the fix-sysdb-allow-v0-deletion branch from 9007b34 to b2ad54c Compare May 20, 2025 19:42
@codetheweb codetheweb changed the title [ENH]: allow deleting v0 from version file [ENH]: allow deleting v0 from version file & correctly propogate errors on DeleteCollectionVersion May 20, 2025
@codetheweb codetheweb force-pushed the fix-sysdb-allow-v0-deletion branch from b2ad54c to 7f84029 Compare May 20, 2025 19:44
@codetheweb codetheweb changed the title [ENH]: allow deleting v0 from version file & correctly propogate errors on DeleteCollectionVersion [ENH]: allow deleting v0 from version file & correctly propagate errors on DeleteCollectionVersion May 20, 2025
@codetheweb codetheweb marked this pull request as ready for review May 20, 2025 19:45
@codetheweb codetheweb requested a review from sanketkedia May 20, 2025 19:45
Copy link
Contributor

propel-code-bot bot commented May 20, 2025

Enable Deletion of v0 from Version File & Improve Error Propagation in DeleteCollectionVersion

This PR updates logic so that version 0 (v0) can be deleted from the version file where previously it could not, and ensures errors arising during DeleteCollectionVersion are correctly propagated to the caller. It also includes some adjustments to method signatures and tests to reflect the improved error handling, and minor adjustments in related Rust and Go code to support the new behavior.

Key Changes:
• Allows deletion of v0 (version 0) from the collection version file in sysdb (Go).
• Correctly propagates errors in DeleteCollectionVersion, returning the first encountered error to the caller.
• Refactors test assertions to expect errors where appropriate.
• Improves proto-to-model conversion by ensuring timestamps are set.
• Adds explicit UnknownError in Rust side for SysDB deletion failures and checks individual version deletion results.

Affected Areas:
• go/pkg/sysdb/coordinator/table_catalog.go
• go/pkg/sysdb/coordinator/table_catalog_test.go
• go/pkg/sysdb/grpc/proto_model_convert.go
• rust/garbage_collector/src/operators/delete_versions_at_sysdb.rs
• rust/sysdb/src/sysdb.rs

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

@@ -759,7 +759,7 @@ func TestCatalog_DeleteCollectionVersion_CollectionNotFound(t *testing.T) {
resp, err := catalog.DeleteCollectionVersion(context.Background(), req)

// Verify results
assert.NoError(t, err)
assert.Error(t, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

[BestPractice]

The code is returning a successful response (assert.NoError(t, err)) even when the collection does not exist, but that seems to conflict with the implementation which now returns the first error encountered. The test should expect an error in this case.

@codetheweb codetheweb force-pushed the feat-gc-list-files-at-version-operator branch from a124ff5 to 20cf4db Compare May 22, 2025 23:24
@codetheweb codetheweb force-pushed the fix-sysdb-allow-v0-deletion branch from 1d4c6d1 to 7d21e46 Compare May 22, 2025 23:24
@codetheweb codetheweb force-pushed the feat-gc-list-files-at-version-operator branch from 20cf4db to 100a8d5 Compare May 22, 2025 23:59
@codetheweb codetheweb force-pushed the fix-sysdb-allow-v0-deletion branch from 7d21e46 to 3cbfa34 Compare May 22, 2025 23:59
@codetheweb codetheweb force-pushed the feat-gc-list-files-at-version-operator branch from 100a8d5 to 9accc22 Compare May 23, 2025 00:47
@codetheweb codetheweb force-pushed the fix-sysdb-allow-v0-deletion branch from 3cbfa34 to 7d4d78b Compare May 23, 2025 00:47
@codetheweb codetheweb force-pushed the feat-gc-list-files-at-version-operator branch 2 times, most recently from 4b76db0 to 43ad358 Compare May 23, 2025 01:25
@codetheweb codetheweb force-pushed the fix-sysdb-allow-v0-deletion branch from 7d4d78b to dbab3d2 Compare May 23, 2025 01:25
@codetheweb codetheweb changed the base branch from feat-gc-list-files-at-version-operator to graphite-base/4579 May 23, 2025 02:06
@codetheweb codetheweb force-pushed the fix-sysdb-allow-v0-deletion branch from dbab3d2 to 68b21f3 Compare May 23, 2025 02:07
@codetheweb codetheweb force-pushed the graphite-base/4579 branch from 43ad358 to 1676e9e Compare May 23, 2025 02:07
@graphite-app graphite-app bot changed the base branch from graphite-base/4579 to main May 23, 2025 02:07
@codetheweb codetheweb force-pushed the fix-sysdb-allow-v0-deletion branch from 68b21f3 to 8f416dd Compare May 23, 2025 02:07
@codetheweb codetheweb merged commit 038dae8 into main May 23, 2025
72 checks passed
Copy link
Contributor Author

Merge activity

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