remote_rpm: stop caching repodata as immutable #8

Merged
unkinben merged 1 commits from benvin/rpm-repodata-mutable into main 2026-07-18 14:15:53 +10:00
Owner

Why: repodata (repomd.xml + its referenced index files) is a mutable index that upstream RPM repos rotate frequently. Marking it immutable (immutable_ttl: 0) makes artifactapi cache repomd.xml forever — classifier.go checks immutable_patterns before the RPM provider's own rule (rpm.go mutableRe already classifies repodata/ as mutable), and SetTTL with ttl=0 writes a Redis key with no expiry. The stale repomd.xml then keeps pointing at checksum-named metadata files upstream has already deleted -> 404 on dnf refresh. This broke rpmbuilder's almalinux8 builds via the epel remote and would eventually hit any rolling RPM remote.

Changes:

  • Remove .*/repodata/.*\.{xml,sqlite,yaml}.*$ immutable patterns from all 14 config/remote_rpm/*.yaml (20 lines). repodata now falls through to the provider's Mutable classification (re-fetched every mutable_ttl). RPMs, noarch, GPG keys and .img files stay immutable.

Follow-up after apply: evict the already-cached stale repodata for each remote_rpm repo (no expiry was set, so they won't self-clear).

Why: repodata (repomd.xml + its referenced index files) is a mutable index that upstream RPM repos rotate frequently. Marking it immutable (immutable_ttl: 0) makes artifactapi cache repomd.xml forever — classifier.go checks immutable_patterns before the RPM provider's own rule (rpm.go mutableRe already classifies `repodata/` as mutable), and SetTTL with ttl=0 writes a Redis key with no expiry. The stale repomd.xml then keeps pointing at checksum-named metadata files upstream has already deleted -> 404 on dnf refresh. This broke rpmbuilder's almalinux8 builds via the epel remote and would eventually hit any rolling RPM remote. Changes: - Remove `.*/repodata/.*\.{xml,sqlite,yaml}.*$` immutable patterns from all 14 config/remote_rpm/*.yaml (20 lines). repodata now falls through to the provider's Mutable classification (re-fetched every mutable_ttl). RPMs, noarch, GPG keys and .img files stay immutable. Follow-up after apply: evict the already-cached stale repodata for each remote_rpm repo (no expiry was set, so they won't self-clear).
unkinben added 1 commit 2026-07-18 14:12:03 +10:00
remote_rpm: stop caching repodata as immutable
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
d168962f82
repodata (repomd.xml and its referenced index files) is a mutable index that
upstream RPM repos rotate frequently. Marking it immutable (immutable_ttl: 0)
makes artifactapi cache repomd.xml forever: classifier.go checks
immutable_patterns before the RPM provider's own rule (which already classifies
repodata/ as mutable), and SetTTL with ttl=0 writes a Redis key with no expiry.
The result is a stale repomd.xml that keeps pointing at checksum-named metadata
files upstream has already deleted -> 404 on dnf metadata refresh. This broke
rpmbuilder's almalinux8 builds via the epel remote and would eventually hit any
rolling RPM remote.

Remove the repodata immutable patterns from every remote_rpm config so repodata
falls through to the provider's Mutable classification and is re-fetched every
mutable_ttl. RPMs, noarch, GPG keys and .img files stay immutable.

- Drop ".*/repodata/.*\.{xml,sqlite,yaml}.*$" from all config/remote_rpm/*.yaml
  (14 files, 20 lines).

After apply, the already-cached stale repodata entries must be evicted (they
have no expiry); that is done per-remote as a follow-up.
unkinben merged commit 79f4d244e8 into main 2026-07-18 14:15:53 +10:00
benvin deleted branch benvin/rpm-repodata-mutable 2026-07-18 14:16:04 +10:00
Sign in to join this conversation.