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

chore(weave): soft deletion for objects server #3259

Merged
merged 16 commits into from
Jan 6, 2025

Conversation

gtarpenning
Copy link
Member

@gtarpenning gtarpenning commented Dec 16, 2024

Description

WB-20784

Server side objects deletion. This pr introduces two main features:

  • the object query now filters out deleted objects
  • add an obj_delete endpoint to delete object versions (and the whole object)

Usage:

api = weave.init("griffin_wb/test-delete")

v0 = weave.publish({"i": 1}, name="obj_1")
v1 = weave.publish({"i": 2}, name="obj_1")
v2 = weave.publish({"i": 3}, name="obj_1")

# delete the object version v1
client.server.obj_delete(tsi.ObjDeleteReq(
     project_id="griffin_wb/test-delete",
     object_id="obj_1",
     digests=[v1.digest],
))
# now we should have only v0 and v2...

# delete v2 with the "latest" alias
client.server.obj_delete(tsi.ObjDeleteReq(
     project_id="griffin_wb/test-delete",
     object_id="obj_1",
     digests=["latest"],
))

# now delete all versions
client.server.obj_delete(tsi.ObjDeleteReq(
     project_id="griffin_wb/test-delete",
     object_id="obj_1",
))

Testing

  • adds tests
  • decent coverage on existing tests

Using the clickhouse console in production, with the new objects query, I identified no discernible performance impact. We only add an extra count, which appears to add little to no overhead.

Prod:
Screenshot 2024-12-16 at 11 44 50 AM

Branch:
Screenshot 2024-12-16 at 2 19 51 PM

@gtarpenning gtarpenning marked this pull request as ready for review December 16, 2024 23:54
@gtarpenning gtarpenning requested a review from a team as a code owner December 16, 2024 23:54
@@ -0,0 +1,260 @@
import pytest
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice test suite

@gtarpenning gtarpenning merged commit 1959497 into master Jan 6, 2025
121 checks passed
@gtarpenning gtarpenning deleted the griffin/backend-soft-object-deletion branch January 6, 2025 21:17
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants