From dd6fd3c2bbbf7f020f0033375951874398c5ce48 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 21 Nov 2026 20:02:31 -0800 Subject: [PATCH] cli: clarify logical holder and sealed generation fields --- seaweed-block/cmd/sw-block/chunk.go | 2 +- seaweed-block/cmd/sw-block/workspace_show.go | 5 +++-- seaweed-block/docs/standalone-deployment.md | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/seaweed-block/cmd/sw-block/chunk.go b/seaweed-block/cmd/sw-block/chunk.go index d037546ad2..793f613a04 100644 --- a/seaweed-block/cmd/sw-block/chunk.go +++ b/seaweed-block/cmd/sw-block/chunk.go @@ -267,7 +267,7 @@ func chunkDetach(args []string, stdout, stderr io.Writer) int { fs.StringVar(&volumeID, "volume", "", "volume id") fs.StringVar(&statusAddr, "status-addr", "", "blockvolume status address or URL (with --chunk-control-endpoint)") fs.DurationVar(&timeout, "timeout", 120*time.Second, "operation bound (capped at the server's OpDeadline)") - fs.BoolVar(&plain, "plain", false, "seal an idle volume without pre-copy; prints sealed HEAD generation on stderr") + fs.BoolVar(&plain, "plain", false, "seal an idle volume without pre-copy; prints JSON headGen as sealed HEAD generation on stderr") fs.BoolVar(&frozen, "frozen", false, "not supported in this release: the server refuses a frozen detach (frozen_detach_unsupported)") fs.Int64Var(&freezeStartedAtNs, "freeze-started-at-ns", 0, "not supported in this release; only valid with --frozen") fs.BoolVar(&allowOverBudget, "allow-over-budget", false, "not supported in this release; only valid with --frozen") diff --git a/seaweed-block/cmd/sw-block/workspace_show.go b/seaweed-block/cmd/sw-block/workspace_show.go index 996785e6e8..add1bb9980 100644 --- a/seaweed-block/cmd/sw-block/workspace_show.go +++ b/seaweed-block/cmd/sw-block/workspace_show.go @@ -49,7 +49,7 @@ func printWorkspaceView(out io.Writer, volume string, view *control.WorkspaceSta fmt.Fprintf(out, "volume: %s (query snapshot, not authority to serve)\n", volume) lease := view.GetLease() if lease == nil { - fmt.Fprintln(out, "holder: none\nlease state: none") + fmt.Fprintln(out, "replica: none\nepoch: none\nlease state: none\nholder: none") } else { state := "granted" if lease.GetValidForNs() <= 0 { @@ -57,7 +57,7 @@ func printWorkspaceView(out io.Writer, volume string, view *control.WorkspaceSta } else if lease.GetRevoking() { state = "revoking" } - fmt.Fprintf(out, "holder: %s@%d (logical replica; server not provided by lease view)\nlease state: %s\nlease expiry_ns: %d; host validity_ns at query: %d\n", lease.GetReplicaId(), lease.GetEpoch(), state, lease.GetExpiresAtNs(), lease.GetValidForNs()) + fmt.Fprintf(out, "replica: %s\nepoch: %d\nlease state: %s\nholder: %s@%d (logical replica)\nlease expiry_ns: %d; host validity_ns at query: %d\n", lease.GetReplicaId(), lease.GetEpoch(), state, lease.GetReplicaId(), lease.GetEpoch(), lease.GetExpiresAtNs(), lease.GetValidForNs()) } ack := view.GetRevocationAck() if ack == nil { @@ -66,6 +66,7 @@ func printWorkspaceView(out io.Writer, volume string, view *control.WorkspaceSta id := ack.GetIdentity() fmt.Fprintf(out, "recorded ACK: %s@%d HEAD generation %d\n", id.GetReplicaId(), id.GetEpoch(), ack.GetHeadGen()) } + fmt.Fprintln(out, "host: unknown (not recorded by the master); issued moves and bindings below are separate facts") for _, g := range view.GetMoves() { fmt.Fprintf(out, "move: request=%s kind=%s issued=%t %s/%s@%d -> %s/%s@%d HEAD generation %d remote LSN %d\n", g.GetRequestId(), g.GetKind(), g.GetIssued(), g.GetOldHost(), g.GetOldReplicaId(), g.GetOldEpoch(), g.GetNewHost(), g.GetNewReplicaId(), g.GetNewEpoch(), g.GetHeadGen(), g.GetRemoteLsn()) } diff --git a/seaweed-block/docs/standalone-deployment.md b/seaweed-block/docs/standalone-deployment.md index 8301c917fc..055c79795b 100644 --- a/seaweed-block/docs/standalone-deployment.md +++ b/seaweed-block/docs/standalone-deployment.md @@ -317,7 +317,8 @@ Perform a clean hand-over in this order: Busy admission refuses the operation. Do not proceed on any failure or unknown outcome. JSON remains on stdout; a successful command also prints - `sealed HEAD generation: G` on its own stderr line. Copy the positive `G`. + `sealed HEAD generation: G` on its own stderr line, taken from the same + JSON `headGen` field on stdout. Copy the positive `G`. 3. Request revocation using that seal and the identity from `show`: ```bash