Details
- Reviewers
tomek ashoat - Commits
- rCOMM4f2c8b6b4af4: [keyserver] Remove holders in upload deleters
Used local Blob Service for testing.
For deleteUpload, used the delete_upload keyserver endpoint (easy way is canceling media message on web, with blob uploads enabled). Called the endpoint and verified that blob associated with the upload was deleted from DDB.
For deleting unassigned uploads: Manually modified MariaDB by setting containers to null and age to be older than 24h. Modified the cron job call to instead run during keyserver startup. Verified that holders were removed.
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
keyserver/src/deleters/upload-deleters.js | ||
---|---|---|
76 | Not sure how to handle failures for removeBlobHolders (HTTP call). Possible approaches:
Besides, the removeBlobHolders() could potentially perform a retry-with-backoff |
keyserver/src/deleters/upload-deleters.js | ||
---|---|---|
76 | My instinct is that this solution:
Is the easiest one here |
keyserver/src/deleters/upload-deleters.js | ||
---|---|---|
76 | Before landing, please update to: const holdersQuery = SQL` SELECT extra FROM uploads WHERE container IS NULL AND user_container IS NULL AND creation_time < ${oldestUnassignedUploadToKeep} `; const [rows] = await dbQuery(holdersQuery); const blobHolders = blobHoldersFromUploadRows(rows); await removeBlobHolders(blobHolders); const deletionQuery = SQL` DELETE u, i FROM uploads u LEFT JOIN ids i ON i.id = u.id WHERE u.container IS NULL AND u.user_container IS NULL AND creation_time < ${oldestUnassignedUploadToKeep} `; await dbQuery(deletionQuery); |