Coordinate rollout compression with active thread writers (#44138)

## Why

Cold rollout files can still have active writers. Compression must not replace their files while writes are pending, including background work that outlives the local thread store.

## What changed

- Share cross-process writer locks between the rollout compressor and local thread store. Skip busy threads and recheck file state under coordination before publishing compressed files.
- Retain writer ownership through recorder background I/O and compressed rollout materialization. Wait for writers to exit on shutdown or discard, and stop queued file work before deletion.
- Route rollout metadata patches through owned recorders, reject competing writers before updating SQLite, and serialize metadata appends with shutdown.

## Testing

Add regression coverage for compression with live and detached writers, parallel cold-file compression, publication locking, metadata ownership conflicts, updates to compressed rollouts, concurrent shutdown, and discarding deferred items.

GitOrigin-RevId: c52f4037eb2019e8095b554e29bf531af95aa4bd
This commit is contained in:
jif authored and copyberry committed 2026-09-09 12:30:07 +00:00
1 parent 20f109eadb
commit 73a1148c9c
20 files changed
+671 -177

No files matched your search

@@ -3411,8 +3411,10 @@ terminal_visualization_instructions = true
_ => None,
})
.expect("browser should resolve a saved owner");
// Archive stops the writer; unarchive leaves a stored thread eligible for compression.
server.thread_archive(saved_owner.id).await?;
let saved_path = server
.thread_read(saved_owner.id, /*include_turns*/ false)
.thread_unarchive(saved_owner.id)
.await?
.path
.expect("saved rollout path");