feat(snapshot): add tmpfs PageBroker daemon - #12958
Conversation
2294ea7 to
9bc01a9
Compare
|
b14c053 to
90d0fe9
Compare
f3ca9b2 to
02756ad
Compare
19d4b04 to
84dc9ff
Compare
07f2f96 to
f38502c
Compare
| Broker::Broker(Path staging_root) : staging_root_(fs::weakly_canonical(std::move(staging_root))) | ||
| { | ||
| io_engines_.push_back(std::make_unique<PosixCopyEngine>()); | ||
| fs::create_directories(staging_root_ / "restore"); | ||
| fs::create_directories(staging_root_ / "checkpoint"); | ||
| } |
There was a problem hiding this comment.
Commit/Abort retryability currently survives only while this Broker process survives. A sidecar restart reconstructs an empty transaction map while the Pod’s shared staging volume and any .pagebroker-partial on checkpoint storage can remain. The next Commit returns TRANSACTION_NOT_FOUND, and a stale partial can block publication indefinitely. Since this MR defines broker-owned staging and retryable terminal operations, please make startup reconcile persisted staging/partial state or persist enough transaction state to determine the outcome after restart.
There was a problem hiding this comment.
I think this can be a follow-up. What do you think?
| try { | ||
| fs::create_directories(published_directory.parent_path()); | ||
| Engine(transaction.engine_type()).CopyDirectory(staging_directory, partial); | ||
| fs::remove_all(published_directory); | ||
| fs::rename(partial, published_directory); | ||
| checkpoint_transactions_.erase(request.transaction_id()); | ||
| transaction_states_.at(request.transaction_id()) = TransactionState::COMMITTED; | ||
| std::error_code cleanup_error; | ||
| fs::remove_all(staging_directory, cleanup_error); | ||
| } | ||
| catch (...) { | ||
| fs::remove_all(partial); | ||
| throw; | ||
| } |
There was a problem hiding this comment.
Please define and test the outcome at each crash boundary here: after partial copy, after removing the previous destination, after rename, and after commit succeeds but before the reply reaches the client. In particular, a crash between remove_all(published_directory) and rename makes the previously valid checkpoint disappear.
There was a problem hiding this comment.
I think this can be a follow-up. What do you think?
bc96716 to
8ae556a
Compare
8ae556a to
8b32169
Compare
|
Moved to ai-dynamo/snapshot#84. |
What
A local PageBroker daemon for the v1 filesystem-storage / POSIX-copy plan.
The Snapshot Agent sends Commit after CRIU returns.
Scope
No S3, NIXL, GPU path, CRIU provider integration, or direct restore implementation.
Validation
Regenerated the C++ protobuf binding and compiled
broker.cppwith-std=c++20 -Wall -Werror. The stacked test PR runs the GoogleTest lifecycle suite.