Page MenuHomePhabricator

[keyserver] Remove holders in account deleters
ClosedPublic

Authored by bartek on Mon, Sep 30, 3:16 AM.
Tags
None
Referenced Files
F2873045: D13514.diff
Wed, Oct 2, 11:22 PM
Unknown Object (File)
Tue, Oct 1, 12:03 AM
Unknown Object (File)
Tue, Oct 1, 12:02 AM
Unknown Object (File)
Mon, Sep 30, 11:59 PM
Unknown Object (File)
Mon, Sep 30, 1:36 PM
Unknown Object (File)
Mon, Sep 30, 1:10 PM
Unknown Object (File)
Mon, Sep 30, 12:18 PM
Subscribers
None

Details

Summary

Address ENG-9353.
Before calling DELETE FROM uploads, we need to select the extra column first and remove blob holders if present in the column JSON.

Depends on D13513

Test Plan

Enabled blob-hosted user avatars. Created an account, set image avatar, then deleted the account and watched the logs. Similiarly to D13513, a blob was uploaded and then its holder was removed

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Mon, Sep 30, 4:28 AM
bartek edited the summary of this revision. (Show Details)
bartek edited the test plan for this revision. (Show Details)
bartek added inline comments.
keyserver/src/deleters/account-deleters.js
84
ashoat requested changes to this revision.Mon, Sep 30, 5:45 AM
ashoat added inline comments.
keyserver/src/deleters/account-deleters.js
84

This one is a bit more complicated than the others. I don't think we should fail the account deletion if the holders fail to be deleted.

Instead, I think we should mark the uploads as "unassigned" by wiping container and user_container. Then later, the delete will be retried by deleteUnassignedUploads.

So I'm suggesting:

  1. Remove DELETE u, i FROM uploads u from the transaction above.
  2. Introduce a separate function (or async IIFE) called deleteUploadsForUser that first fetches all of the uploads for a user, then deletes their holders, and then deletes the uploads
  3. Call that new function with ignorePromiseRejections
This revision now requires changes to proceed.Mon, Sep 30, 5:45 AM

Move upload deletion into ignorePromiseRejections

keyserver/src/deleters/account-deleters.js
41–49 ↗(On Diff #44749)

I'm not sure about this part. I tried to achieve this:

Instead, I think we should mark the uploads as "unassigned" by wiping container and user_container. Then later, the delete will be retried by deleteUnassignedUploads.

This revision is now accepted and ready to land.Tue, Oct 1, 6:05 AM