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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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
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.

1 participant