⚡ Remove per-target re-validation redundancy in BOS deletion execution #13

Merged
longtao.wu merged 1 commits from fix/project-deletion-redundant-bos-revalidation into dev 2026-09-23 02:26:14 +08:00

1 Commits

Author SHA1 Message Date
eust-w
116a162aaf ⚡ Remove per-target re-validation redundancy in BOS deletion execution
deleteProjectTarget's "bos" case called validateDeletionReferences again
for every single BOS target — with SL-data's ~2,600 BOS targets, that
meant re-running the (already expensive, now individually fast but still
~10s including Mongo I/O) org-wide reference check up to 2,600 times
during actual deletion execution, not just once during preview. Caught
live: SL-data's real deletion run was in the BOS cleanup phase at
~1.5 items/minute, which would have taken roughly 29 hours to finish.

executeProjectDeletion already re-runs validateDeletionReferences once,
right before it starts processing non-runtime targets (the runtimeDone
gate at line ~724) — that is the correct point to catch a run created
between plan-build and execution referencing a path about to be deleted.
Repeating it per-target adds no additional safety, since nothing about
processing one BOS target changes what other runs reference within the
same execution pass.

The only other caller (supplier_deletion.go:442) passes an empty
ProjectDeletionPlan{}, so the removed call was already a no-op there.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 02:25:56 +08:00