-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[db] Soft delete entries in the db_volume_snapshot
table
#13391
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
Conversation
/hold |
started the job as gitpod-build-af-soft-delete-in-volume-snapshot-table.6 because the annotations in the pull request description changed |
9033463
to
ee95f69
Compare
Replace the existing hard-deletion of volume snapshot rows in the database with soft-deletion that will allow `db-sync` to propagate deletions between clusters.
For each workspaceId, add a deleted volume snapshot.
Filter out deleted volume snapshots from the result sets.
Add tests (`testCantFindDeletedVolumeSnapshotById` fails). The failing test is due to `findVolumeSnapshotById` not taking deleted entries into account.
aeb810b
to
f598cc1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tho not an expert on our TypeORM models
/hold for Q
return volumeSnapshots | ||
.createQueryBuilder("vs") | ||
.where("vs.deleted = 0") | ||
.andWhereInIds(volumeSnapshotId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between findOne
and andWhereInIds
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering the same. Using .andWhere("vs.id = :id", { id: volumneSnapshotId })
would be more direct, and require less TypeORM knowledge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've rebased to make this change.
Filter soft deleted entries out of the result set.
f598cc1
to
3f1dc66
Compare
Description
Replace the existing hard-deletion of rows in the
db_volume_snapshot
table with soft-deletion.This will allow
db-sync
to propagate deletions between clusters.Related Issue(s)
Follow up to #13348
Part of #9198
How to test
Unit tests
Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide