Do not touch last_downloaded_at when on a geo secondary
What does this MR do and why?
🔥 Problem
In Add last_downloaded_at to packages (!97143 - merged), we added a last_downloaded_at
to the package model.
The problem is that users could pull packages from geo secondaries but geo secondaries are read-only mirrors, so guess what happens when we try to bump a column in the packages table? Yes,
🚒 Solution
Fortunately, bumping the last_downloaded_at
field is centralized in a model function. So the solution is quite trivial:
- Add a guard to that function: if we are in a geo secondary, return early. Note that since geo is a premium feature, we need to override the
last_downloaded_at
bumping method in EE module.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- Install a secondary geo node in your local gdk instance.
- Publish any package to the package registry to test with a published one.
- Download any package file, the
last_downloaded_at
column for this package record in thepackages_package
table shouldn't be bumped.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #405297 (closed)