Skip to content

Maven Registry: Cached responses destruction

🔭 Issues plan

  1. Maven Virtual Registry: Database models (#467972 - closed).
  2. Maven Virtual Registry: Permissions policy (#467977 - closed).
  3. Maven Virtual Registry: Registry models API (#467979 - closed).
  4. Maven Virtual Registry: Maven API endpoint (#467982 - closed).
  5. Maven Virtual Registry: Cache logic (#467983 - closed).
  6. Maven Registry: Cached responses destruction (#468113 - closed). 👈 You're here.
  7. Improve workhorse dependencyproxy logic (#461561 - closed).
  8. Maven Virtual Registry: Documentation (#468115 - closed).
  9. Maven Virtual Registry: Performance review (#468116 - closed).
  10. Maven Virtual Registry: feature flag cleanup (#468117).

🗒 Description

Cached response destruction operation can happen:

  • For a single record, through the Rest API.
  • For several records, through upstream object destruction.
  • For several records, through (root) group destruction.

The destruction logic should handle all 3 scenarios. On top of that, the cached response usage should be counted towards the package group statistic. The destruction logic should properly update this statistic too.

Use the approach that we have in the package registry: use a soft delete and delay the actual destruction of cached responses with a background job (see Maven Virtual Registry: Cleanup background job ... (#479957 - closed)).

For the soft delete, either use the status column or nullify the upstream_id foreign key. The object storage quota (see below) should be updated properly.

So basically the mark can either: nullify the parent object foreign key or update the status column. I'm tempted to use this issue to explore #475204 (closed) and use the loose foreign key to introduce a new action that will update the status column to a defined value (something like marked_for_destruction).

This way, the background jobs can simply look for the status column and we don't need to handle two different marks (= we will not need two different indexes to speed up the cleanup background jobs queries).

📊 Object storage quota

The cached responses creation and destruction (described above) should update the packages project statistic accordingly on the parent object, in this case, the (root) Group.

Edited by David Fernandez