WIP: fix: retain attachment cleanup across transaction and provider failures #45
Draft
KofTwentyTwo wants to merge 6 commits from
fix/attachment-transactions-1289 into feature/collab
pull from: fix/attachment-transactions-1289
merge into: QRun-IO:feature/collab
QRun-IO:develop
QRun-IO:fix/read-path-statements-develop
QRun-IO:release/1.2
QRun-IO:fix/read-path-statements-1.2
QRun-IO:fix/aurora-full-page-writes-1.2
QRun-IO:release/1.1
QRun-IO:fix/aurora-full-page-writes-develop
QRun-IO:fix/aurora-full-page-writes-1.1
QRun-IO:feat/custom-field-validation-forge
QRun-IO:fix/custom-field-length-and-help-20261106
QRun-IO:feature/kof22-collab-canonical
QRun-IO:feat/record-files-standalone
QRun-IO:main
QRun-IO:ci-qrun-release-caller-develop-v2
QRun-IO:feat/per-session-presence
QRun-IO:archive/qrun-github-cutover-20261101/1ae65087936e/develop
QRun-IO:fix/presence-empty-viewers
QRun-IO:feature/collab-int-20261029
QRun-IO:integration/redis-collaboration-20261029
QRun-IO:fix/mywork-query-bounds-1291
QRun-IO:test/presence-capacity-1302
QRun-IO:feature/presence-recovery-1300
QRun-IO:dependabot/maven/develop/maven-minor-and-patch-c55d8d628c
QRun-IO:dependabot/github_actions/develop/github-actions-0fdda1077f
QRun-IO:feature/field-values-1196
QRun-IO:feature/collab
QRun-IO:feature/orb-0.8-track
QRun-IO:feature/orb-0.7.18
QRun-IO:feature/orb-0.7.17
QRun-IO:release/0.1
QRun-IO:feature/orb-standardize-release-0.1
QRun-IO:feature/orb-main-standardization
QRun-IO:feature/shared-codeql
QRun-IO:feature/orb-0712-stable-gate
QRun-IO:feature/orb-rc-worker
QRun-IO:feature/orb-0.7.11
QRun-IO:feature/central-ci
QRun-IO:ci/release-rc-secrets-inherit
QRun-IO:dependabot/maven/develop/com.puppycrawl.tools-checkstyle-14.3.0
QRun-IO:feature/ui-api-1.6
QRun-IO:fix/producer-version-from-build
QRun-IO:fix/help-bundle-version-test
QRun-IO:fix/help-bundle-version
QRun-IO:feature/help-bundle
QRun-IO:feature/tables-populated-defaults
QRun-IO:feature/qqq-rc7
QRun-IO:fix/issues-20-21
QRun-IO:feature/email-api
QRun-IO:feature/orb-0.6.9
QRun-IO:feature/object-storage-rc4
QRun-IO:feature/email-qbit
QRun-IO:fix/live-review
QRun-IO:feature/demo-dev-server
QRun-IO:feature/presence-custom-fields
QRun-IO:feature/ui-api-endpoints
QRun-IO:feature/contingent-fields
QRun-IO:fix/object-storage-api-only
QRun-IO:feature/sharing-tasks
QRun-IO:feature/tags
QRun-IO:feature/comments-follow-timeline
QRun-IO:feature/attachments
QRun-IO:feature/favorites-recents
QRun-IO:feature/scaffold-and-settings
No Reviewers
Labels
Clear labels
architecture
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
java
question
secuurity
wontfix
Architecture review: coupling, cohesion, UI API
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Pull requests that update GitHub Actions code
Good for newcomers
Extra attention is needed
This doesn't seem right
Pull requests that update java code
Further information is requested
This will not be worked on
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: QRun-IO/qbit-collaboration#45
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Attachment deletion previously removed provider bytes before database deletion succeeded, leaving retained metadata pointing to missing content on rollback. This change commits durable cleanup intent with metadata deletion, removes bytes after commit, and retries provider failures through the host scheduler.
On PostgreSQL and other backends supporting transactional FOR UPDATE SKIP LOCKED, uploads commit their locator before provider I/O and lock it until their transaction ends. Metadata insertion retires that intent in the same transaction. Cleanup workers skip active uploads and serialize deletion per intent. Backends without row-lock support retain callback-based compensation.
A successful DELETE alone cannot settle a timed-out PUT: the PUT may finish afterward. Generic storage retains uncertain upload intents with persisted 60-second backoff and bounded 100-row sweeps. The new Resolve settled uploads table action lets an identified collaboration administrator supply provider completion/cancellation evidence, review the selection, and resolve it. Apply rechecks permission, locks the row, refuses existing references, deletes current bytes, and preserves resolvedAt/resolvedBy/settlementEvidence on the service-managed row. Repeated requests preserve the original receipt; scheduled retries exclude resolved receipts. Provider or receipt-write failure leaves the intent recoverable. Evidence is an operator attestation, not automatic proof of external provider completion.
Validation at
dc65a82: full Maven verify passes 206 tests, zero failures/errors/skips; packaging, help coverage, architecture guardrails and JaCoCo gates pass. Real PostgreSQL tests cover rollback/commit, intent creation failure before I/O, concurrent workers, active-upload protection, late PUT completion, retained receipts, permission denial, reference protection, database/provider failures, and actual form/Review/Result execution with access revoked after Review. Abrupt child-JVM termination is tested with file storage. Real MinIO plain/versioned bucket tests verify deletion replay preserves unrelated objects. Kof22 draft PR338 adds the matching additive schema migration; seven focused PostgreSQL/H2/convention tests pass there.Related: QRun-IO/qqq#1289. Keep draft and issue open for remote CI, coordinated artifact adoption and actual staging/rollback acceptance. Late completion is a deterministic fixture, not an observed MinIO timeout; JVM termination does not prove power-loss durability. Apply schema before runtime adoption. Preserve pending intents and resolved receipts during rollback; do not run older cleanup workers that ignore resolvedAt. See docs/ATTACHMENT-RECOVERY.md.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.