Skip to content

fix(core): stop nist-nvd2 extracts from filling the node - #3795

Merged
mfreeman451 merged 5 commits into
stagingfrom
fix/nist-nvd2-disk-budget
Aug 19, 2026
Merged

fix(core): stop nist-nvd2 extracts from filling the node#3795
mfreeman451 merged 5 commits into
stagingfrom
fix/nist-nvd2-disk-budget

Conversation

@mfreeman451

Copy link
Copy Markdown
Collaborator

Why

Demo's Software tab showed CPE catalog is not current because nist-nvd2 was disabled after leftover extracts filled k8s-cp3-worker3 (~255 GiB). The PVC is local-path (no quota). Each Oban attempt uses a new run_id, and a timeout kills the worker with :kill, so after cleanup never runs. The next retry downloaded another zip.

What

  • Keep at most one nist-nvd2 staging dir; prune leftovers on every scheduler tick
  • Drop leftover extracts before a new download
  • Refuse a download when staging is over 6 GiB or the filesystem has less than 4 GiB free
  • Always emit SERVICERADAR_ADVISORY_NIST_NVD2_ENABLED from Helm (demo overlay turns the feed back on)

Demo is being rolled to a prune/budget core image separately. This PR is the product-side fix so a future release cannot refill a node the same way.

Test plan

  • Staging.prune_feed/2 keep 1 / keep 0
  • ensure_budget/1 fails over the cap
  • reap_orphans/1 drops extra nist-nvd2 dirs even when they are fresh
  • Demo load after the signed sha-db61aeec8b core roll: one staging dir, generation current=true, Software banner gone

Copilot AI lite review requested due to automatic review settings August 18, 2026 21:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Oban timeouts kill the worker with :kill, so after-cleanup never runs
and each retry downloaded a new zip. Keep at most one nist-nvd2 run
dir, prune leftovers on every scheduler tick, and refuse a download
when staging is over budget. Demo turns the CPE catalog back on.
The 60s feed scheduler only reaped as a side effect of enqueue, and
Oban :kill still skips after-cleanup. Give leftover extracts a real
self-scheduling job, drop a run dir when acquire fails, and keep at
most one nist-nvd2 dir while a load is executing.
Flipping current on ~360k advisory rows hit demo CNPG's default
statement_timeout. Oban then retried the whole download. Raise the
timeout for the generation swap so a finished load can become current.
current_by_device ORDER BY kev/exploit/cvss was using the global
priority index and filtering device_uid after scanning ~74k active
rows. Partial index on (device_uid, kev, exploit, cvss, last_seen)
WHERE status=active lets LIMIT 50 stop after the device's top rows.
Elixir Quality --check-formatted failed on the nist-nvd2 disk-safety
changes.
@mfreeman451
mfreeman451 force-pushed the fix/nist-nvd2-disk-budget branch from 06ec9ed to 32e160c Compare August 19, 2026 02:17
@mfreeman451
mfreeman451 merged commit bd77432 into staging Aug 19, 2026
13 checks passed
@mfreeman451
mfreeman451 deleted the fix/nist-nvd2-disk-budget branch August 19, 2026 02:57
@mfreeman451 mfreeman451 mentioned this pull request Aug 19, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants