Watch
0
0
Fork
You've already forked hyperhive
0

remove the old snapshot store; tombstone its options

This commit is contained in:
atlas 2026-11-09 23:13:18 +01:00 • committed by mara
commit 20d286f06a
2 changed files with 97 additions and 1308 deletions

View file

@ -341,10 +341,8 @@ pub enum SnapshotCmd {
/// Snapshot label passed to `subvol snapshot create --label`.
label: String,
},
/// Export a snapshot to a local file via `btrfs send` — the
/// local-file half of the inter-hive migration transport (`push`
/// is the network half). Also useful standalone as a point-in-time
/// backup: a full send with no `--parent` produces a
/// Export a snapshot to a local file via `btrfs send`: a point-in-time
/// backup. A full send with no `--parent` produces a
/// self-contained archive of the snapshot.
Send {
/// Snapshot label passed to `subvol snapshot create --label`.
@ -359,25 +357,4 @@ pub enum SnapshotCmd {
#[arg(long)]
dest: String,
},
/// Stream a snapshot to the swarm's snapshot store over the
/// WireGuard mesh — the network half of the migration transport.
///
/// Stages nothing locally: `btrfs send` writes straight into the
/// connection, so a multi-gigabyte agent needs no scratch space on
/// this host. The mesh is the authentication (cryptokey routing
/// binds the sender's address to its key), so there is no credential
/// to pass here.
///
/// No destination argument exists: a swarm has one store, read
/// from `services.hyperhive.swarm.snapshotStore`.
Push {
/// Snapshot label passed to `subvol snapshot create --label`.
label: String,
/// Optional parent snapshot label for an incremental send
/// (`btrfs send -p`) — must be an existing, older snapshot of the
/// same agent, and must already be present on the receiver.
/// Omit for a full send.
#[arg(long)]
parent: Option<String>,
},
}

View file

@ -41,9 +41,6 @@ pub(crate) async fn dispatch_subvol(socket: &Path, name: &str, cmd: SubvolCmd) -
parent,
dest,
} => subvol_snapshot_send(socket, name, &label, parent.as_deref(), &dest).await,
SnapshotCmd::Push { label, parent } => {
subvol_snapshot_push(socket, name, &label, parent.as_deref()).await
}
},
}
}
@ -217,37 +214,3 @@ async fn subvol_snapshot_send(
)
.await
}
/// `subvol snapshot push <agent> <label> [--parent <label>]` — stream a
/// snapshot to the swarm's snapshot store over the mesh.
///
/// The network sibling of `send`. Nothing is staged on this host, so
/// there is no path to print: success is silent apart from the
/// confirmation below. No destination argument — a swarm has one store,
/// and the daemon reads its address from the host config.
async fn subvol_snapshot_push(
socket: &Path,
name: &str,
label: &str,
parent: Option<&str>,
) -> Result<()> {
daemon_request(
socket,
hive_host_sock::HostRequest::PushSnapshot {
name: crate::util::parse_ident(name)?,
label: label.to_owned(),
parent: parent.map(str::to_owned),
},
"snapshot push",
)
.await?;
match parent {
Some(p) => {
println!(
"pushed {name} snapshot {label:?} (incremental from {p:?}) to the swarm store"
);
}
None => println!("pushed {name} snapshot {label:?} (full) to the swarm store"),
}
Ok(())
}