Skip to content

Publish migrated recordings without overwriting competing files - #699

Merged
matteius merged 5 commits into
mainfrom
fix/storage-migration-publication
Nov 1, 2026
Merged

matteius merged 5 commits into
mainfrom
fix/storage-migration-publication

Conversation

@matteius

@matteius matteius commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #701; merge the shared CI cleanup first. This branch includes that exact shared commit so its workflow changes disappear from this PR after #701 merges. Suite membership is declared beside the tests in CMake; this fix has no independent workflow edits. All three remaining fix branches merge cleanly with each other.

A filesystem migration could overwrite a destination created during the copy, publish a substituted temporary file, or remove an unowned artifact during cancellation or cleanup.

Keep the verified temporary file open through no-replace publication and the final metadata check. Use fresh temporary names when an existing artifact is encountered, and retain uncertain artifacts instead of treating a predictable path or matching bytes as ownership proof.

  • After the shared CI cleanup merges, three files: one production file, one regression suite, and its CMake registration.
  • Independently on main: 24 of 28 cases fail before the fix; all 28 pass under ASan/UBSan. Private filesystem/SQLite fixtures cover copy/move, collisions, cancellation, substitution and unsupported publication.
  • Run: ctest --test-dir build/focused-debug --output-on-failure -R '^test_storage_migration_publication$'.

Unsupported atomic no-replace publication fails without overwriting. Retained artifacts can require manual cleanup. The final identity check is not an atomic filesystem/SQLite transaction and cannot exclude existing open writers. S3 transfers and source removal are outside this change.

Extracted independently from #693; no foundation framework or policy exceptions. Hosted CI is required before merge.

Revalidated after updating from main and adopting the shared CI suites: focused ASan/UBSan regressions pass, and CTest labels select the existing suite plus only this PR’s regressions.

Give copy attempts fresh temporary names, hold verified file identity
through no-replace publication and metadata commit, and retain uncertain
artifacts instead of unlinking replacements. Abandoned-job cleanup no
longer treats matching bytes or a predictable path as ownership evidence.

Add 28 real-filesystem/private-SQLite regression cases for copy/move,
collisions, cancellation, substitution and unsupported publication. Use
the existing CMake and integration/sanitizer registrations. The fixture
fails 24/28 on origin/main 8927bc8 and passes 28/28 with this isolated fix
under Debug ASan/UBSan. No services or legacy shared-path tests were run.
Uncertain artifacts remain cleanup debt rather than being deleted.
@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 24 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/storage/storage_migration.c 86.66% 24 Missing ⚠️

📢 Thoughts on this report? Let us know!

@matteius
matteius merged commit a7a5458 into main Nov 1, 2026
13 checks passed
@matteius
matteius deleted the fix/storage-migration-publication branch November 1, 2026 00:18
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.

1 participant