import_authority::admit_run checks item_count <= maxItems - committed_items
and debits nothing. Two runs under one open authority, or the same file
submitted twice, both pass admission; the second stops partway when the
counter fills. Import is create-only, so the second run duplicates records up
to the remaining volume. crates/registry-breg/tests/postgres_import_authority.rs
a_second_run_cannot_spend_volume_the_first_already_committed shows the
partial commit. The volume bound itself holds, and the security review notes
in products/breg/SECURITY-REVIEW-NOTES.md record this as an accepted
residual (introduced in #1632).
Options: (a) a reserved_items column debited under the row lock at
admission and released on complete, cancel, or block; (b) at most one
non-terminal run per authority (partial unique index on the run's authority
id). Either way, add a concurrent-admission test, and align
docs/site/src/content/docs/operate/breg-data.mdx, which says a run is
created only when the authority has room for the whole file.
import_authority::admit_runchecksitem_count <= maxItems - committed_itemsand debits nothing. Two runs under one open authority, or the same file
submitted twice, both pass admission; the second stops partway when the
counter fills. Import is create-only, so the second run duplicates records up
to the remaining volume.
crates/registry-breg/tests/postgres_import_authority.rsa_second_run_cannot_spend_volume_the_first_already_committedshows thepartial commit. The volume bound itself holds, and the security review notes
in
products/breg/SECURITY-REVIEW-NOTES.mdrecord this as an acceptedresidual (introduced in #1632).
Options: (a) a
reserved_itemscolumn debited under the row lock atadmission and released on complete, cancel, or block; (b) at most one
non-terminal run per authority (partial unique index on the run's authority
id). Either way, add a concurrent-admission test, and align
docs/site/src/content/docs/operate/breg-data.mdx, which says a run iscreated only when the authority has room for the whole file.