Preserve unknown outcomes for unusable chunk conflict replies (#13502)

* Keep unusable chunk conflict replies recoverable

* Target conflict reply recovery notes to v1.1.3

* Classify unreadable chunk conflicts as retryable refusals

* Name the unusable chunk conflict response body

* docs(block): list the unusable chunk conflict refusal in the typed-error table

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep unusable chunk conflict outcomes unknown

* Correct unusable conflict answer guidance for v1.1.2

* Reject computed statuses in the conflict census

* Scope conflict recovery to each command identity

* Distinguish observer errors in the release exit table

* Remove unsafe plain detach retry advice from release table

* docs(block): keep the plain detach repeat cure in the release exit table

A repeated plain detach is the designed way to settle a malformed seal
result: after a seal it publishes nothing and answers the original sealed
HEAD from a fresh read, and the CLI prints that cure for this answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* State the preconditions for repeating an intended plain detach

* docs: clarify detach evidence timing and unsupported responses

* docs: disambiguate response rows and abort evidence

---------

Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-12-06 03:33:58 -08:00
1 parent 32d1b6eaf7
commit cb46aee067
10 files changed
+388 -21

No files matched your search

+10 -1
View File
@@ -193,7 +193,16 @@ func chunkPostUntil(name, statusAddr, route string, timeout time.Duration, waitU
}
defer resp.Body.Close()
responseFailure := func(cause error) int {
if resp.StatusCode >= http.StatusBadRequest {
// A 409 body can describe work after admission; status alone cannot
// settle the original operation or authorize a new request identity.
if resp.StatusCode == http.StatusConflict {
if id, ok := body["requestID"].(string); ok && id != "" {
cause = fmt.Errorf("HTTP 409 body is unusable; recover original request %s: %w", id, cause)
} else {
cause = fmt.Errorf("HTTP 409 body is unusable: %w", cause)
}
}
if resp.StatusCode >= http.StatusBadRequest && resp.StatusCode != http.StatusConflict {
cause = answer.HTTPStatusFailure(resp.StatusCode, cause)
} else {
cause = answer.Rekind(answer.Record(answer.PossiblyAdmitted, cause), answer.Connection)
@@ -0,0 +1,116 @@
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"strings"
"sync"
"testing"
"time"
)
// A 409 can follow admission. Without its typed body, keep the original
// operation unknown and preserve its request identity for recovery.
func TestChunkUnusableConflictAnswerIsUnknown(t *testing.T) {
for _, mode := range []string{"truncated", "malformed"} {
t.Run(mode, func(t *testing.T) {
receivedIDs := make(chan string, 1)
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
var request struct {
ID string `json:"requestID"`
}
if err := json.NewDecoder(r.Body).Decode(&request); err != nil {
t.Error(err)
return
}
receivedIDs <- request.ID
if mode == "truncated" {
w.Header().Set("Content-Length", "1000")
}
w.WriteHeader(http.StatusConflict)
fmt.Fprint(w, `{`)
}))
defer srv.Close()
var out, diag bytes.Buffer
var admission snapshotCLIAdmission
exit := chunkPost("snapshot", srv.URL, "/chunk/snapshot", time.Second, map[string]any{"volumeID": "v1", "name": "s1", "requestID": "original"}, &out, &diag, &admission)
got := chunkErrorOut(t, out.String())
var receivedID string
select {
case receivedID = <-receivedIDs:
default:
t.Fatal("server did not receive the request")
}
if exit != 3 || got.Code != "outcome_unknown" || !got.Retryable || admission.Accepted || receivedID != "original" || !strings.Contains(got.Message, "original") || !strings.Contains(got.Message, "recover") || strings.Contains(got.Message, "nothing applied") {
t.Fatalf("exit=%d answer=%+v accepted=%v stderr=%s", exit, got, admission.Accepted, &diag)
}
})
}
}
func TestChunkConflictLoopKeepsOriginalRequest(t *testing.T) {
for _, row := range []struct {
name, body string
truncated bool
posts, exit int
}{
{"unreadable", `{`, true, 2, 0},
{"malformed", `{`, false, 2, 0},
{"typed-retryable", `{"code":"head_conflict","retryable":true,"message":"HEAD changed"}`, false, 2, 0},
{"typed-terminal", `{"code":"snapshot_limit","retryable":false,"message":"limit reached"}`, false, 1, 1},
} {
t.Run(row.name, func(t *testing.T) {
shortLoop(t, 200*time.Millisecond, time.Millisecond, 2*time.Millisecond)
var mu sync.Mutex
var received []map[string]any
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
fmt.Fprint(w, `{}`)
return
}
var body map[string]any
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
t.Error(err)
return
}
mu.Lock()
received = append(received, body)
n := len(received)
mu.Unlock()
if n == 1 {
if row.truncated {
w.Header().Set("Content-Length", "1000")
}
w.WriteHeader(http.StatusConflict)
fmt.Fprint(w, row.body)
return
}
fmt.Fprint(w, `{"volumeID":"v1","name":"s1","headGen":7}`)
}))
defer srv.Close()
var out, diag bytes.Buffer
exit := chunkPostLoop("snapshot", srv.URL, "/chunk/snapshot", time.Second, map[string]any{"volumeID": "v1", "name": "s1", "requestID": "original"}, &out, &diag)
mu.Lock()
defer mu.Unlock()
if exit != row.exit || len(received) != row.posts {
t.Fatalf("exit=%d posts=%d wantExit=%d wantPosts=%d out=%s stderr=%s", exit, len(received), row.exit, row.posts, &out, &diag)
}
for _, q := range received {
if q["volumeID"] != "v1" || q["name"] != "s1" || q["requestID"] != "original" {
t.Fatalf("recovery changed request: %+v", q)
}
}
if row.name == "typed-terminal" {
got := chunkErrorOut(t, out.String())
if got.Code != "snapshot_limit" || got.Retryable {
t.Fatalf("terminal answer changed: %+v", got)
}
} else if row.name != "typed-retryable" && !strings.Contains(diag.String(), "request 1 ended: outcome_unknown") {
t.Fatalf("lost conflict must remain unknown: %s", &diag)
}
})
}
}
@@ -23,7 +23,7 @@ func TestReviewCompleteBodyKeepsStatusAndAdmission(t *testing.T) {
{"malformed-forbidden", 403, "{", 5, "not_authorized"},
{"malformed-arguments", 400, "{", 2, "bad_request"},
{"malformed-missing", 404, "{", 1, "not_found"},
{"malformed-precondition", 409, "{", 1, "not_admitted"},
{"malformed-conflict", 409, "{", 3, "outcome_unknown"},
{"malformed-rate-limit", 429, "{", 3, "outcome_unknown"},
{"malformed-server", 500, "{", 3, "outcome_unknown"},
{"malformed-gateway", 502, "{", 3, "outcome_unknown"},
@@ -32,6 +32,7 @@ func TestReviewCompleteBodyKeepsStatusAndAdmission(t *testing.T) {
{"empty-success", 204, "", 3, "outcome_unknown"},
{"malformed-redirect", 302, "{", 3, "outcome_unknown"},
{"oversized-forbidden", 403, "oversized", 5, "not_authorized"},
{"oversized-conflict", 409, "oversized", 3, "outcome_unknown"},
{"oversized-success", 200, "oversized", 3, "outcome_unknown"},
{"oversized-admission", 202, "oversized", 3, "outcome_unknown"},
} {
@@ -0,0 +1,160 @@
package volume
import (
"bytes"
"fmt"
"go/ast"
"go/format"
"go/parser"
"go/token"
"os"
"strings"
"testing"
)
// These are outcome classes of the typed body, not permission to infer
// non-admission from HTTP 409 alone. Even an attempt refusal can refer to
// an operation whose durable admission or earlier work already exists.
var chunkConflictClasses = map[string]string{
`"cut_busy"`: "attempt_refused",
`"operation_conflict"`: "existing_operation",
"codeHeadConflict": "attempt_refused",
"codeFenced": "attempt_refused",
"codeInProgress": "upgrade_pass_running",
`"plain_detach_busy"`: "attempt_refused",
`"precopy_unknown"`: "work_may_have_run",
`"precopy_not_converged"`: "work_may_have_run",
"codeDetachAborted": "abort_confirmed",
`"snapshot_delete_requires_operation"`: "attempt_refused",
"chunkstore.CodeGeometryMismatch": "attempt_refused",
"chunkstore.CodeSnapshotLimit": "attempt_refused",
"chunkstore.CodeSnapshotExists": "existing_operation",
`"layout_refused"`: "attempt_refused",
`"format_level_below_head_version"`: "attempt_refused",
"codeLSNBehind": "attempt_refused",
"codeAwaitingAssignment": "attempt_refused",
"codeNotPrimary": "attempt_refused",
"codeEpochStale": "attempt_refused",
"codeBaseInstalling": "attempt_refused",
"codeReconciling": "attempt_refused",
"codeClosing": "attempt_refused",
`"frozen_detach_unsupported"`: "attempt_refused",
`"frozen_tail_too_large"`: "attempt_refused",
"chunkstore.CodeQueueFull": "attempt_refused",
`"layout_busy"`: "attempt_refused",
"chunkstore.CodeNotChunkVolume": "attempt_refused",
// Dynamic bodies must remain authoritative. catalogStatus has an open
// default-to-409 code space; remembered refusals retain their own status.
"catalogStatus(ce.Code):ce.Code": "typed_body_required",
"remembered.status:remembered.code": "typed_body_required",
}
func unclassifiedChunkConflicts(source []byte) ([]string, error) {
fs := token.NewFileSet()
file, err := parser.ParseFile(fs, "chunk_control.go", source, 0)
if err != nil {
return nil, err
}
render := func(n ast.Node) string {
var out bytes.Buffer
_ = format.Node(&out, fs, n)
return out.String()
}
var missing []string
found := false
for _, decl := range file.Decls {
fn, ok := decl.(*ast.FuncDecl)
if !ok || fn.Name.Name != "chunkErrorCode" {
continue
}
found = true
ast.Inspect(fn.Body, func(n ast.Node) bool {
ret, ok := n.(*ast.ReturnStmt)
if !ok {
return true
}
if len(ret.Results) != 3 {
missing = append(missing, "unreviewed delegated mapper return")
return true
}
status, code := render(ret.Results[0]), render(ret.Results[1])
key := code
switch status {
case "http.StatusConflict":
case "catalogStatus(ce.Code)", "remembered.status":
key = status + ":" + code
default:
// Only these exact selector ASTs prove a reviewed non-409
// status. A computed expression with the same textual prefix
// (including StatusConflict + 0) needs classification.
allowed := false
if sel, ok := ret.Results[0].(*ast.SelectorExpr); ok {
if pkg, ok := sel.X.(*ast.Ident); ok && pkg.Name == "http" {
switch sel.Sel.Name {
case "StatusGone", "StatusServiceUnavailable", "StatusNotFound", "StatusBadRequest", "StatusInternalServerError":
allowed = true
}
}
}
if !allowed {
missing = append(missing, "unreviewed status: "+status)
}
return true
}
class := chunkConflictClasses[key]
switch class {
case "attempt_refused", "existing_operation", "upgrade_pass_running", "work_may_have_run", "abort_confirmed", "typed_body_required":
default:
missing = append(missing, fmt.Sprintf("%s has no outcome class", key))
}
return true
})
}
if !found {
return nil, fmt.Errorf("chunkErrorCode not found")
}
return missing, nil
}
func TestChunkConflictStatusRowsHaveOutcomeClasses(t *testing.T) {
source, err := os.ReadFile("chunk_control.go")
if err != nil {
t.Fatal(err)
}
missing, err := unclassifiedChunkConflicts(source)
if err != nil || len(missing) != 0 {
t.Fatalf("unclassified 409 rows: %v (%v)", missing, err)
}
}
func TestChunkConflictCensusRejectsANewUnclassifiedCode(t *testing.T) {
source, err := os.ReadFile("chunk_control.go")
if err != nil {
t.Fatal(err)
}
// Negative control: a new mapper row cannot silently inherit an admission
// claim from its HTTP status. No production source is modified.
mutated := bytes.Replace(source, []byte(`return http.StatusConflict, "cut_busy", true`), []byte(`return http.StatusConflict, "new_conflict", true`), 1)
if bytes.Equal(source, mutated) {
t.Fatal("negative control did not mutate the mapper")
}
missing, err := unclassifiedChunkConflicts(mutated)
if err != nil || len(missing) != 1 || !strings.Contains(missing[0], "new_conflict") {
t.Fatalf("new code escaped census: %v (%v)", missing, err)
}
}
func TestChunkConflictCensusRejectsComputedStatus(t *testing.T) {
source, err := os.ReadFile("chunk_control.go")
if err != nil {
t.Fatal(err)
}
mutated := bytes.Replace(source, []byte(`return http.StatusConflict, "cut_busy", true`), []byte(`return http.StatusConflict + 0, "cut_busy", true`), 1)
if bytes.Equal(source, mutated) {
t.Fatal("computed-status control did not mutate the mapper")
}
missing, err := unclassifiedChunkConflicts(mutated)
if err != nil || len(missing) != 1 || !strings.Contains(missing[0], "unreviewed status") {
t.Fatalf("computed 409 escaped census: %v (%v)", missing, err)
}
}
@@ -239,3 +239,25 @@ loading checks the identity leaf's dates; unused supplied chain alternatives
do not block it. TLS still validates the chain it selects. A CA bundle with
no currently valid certificate, or an expired local identity leaf, is a local
configuration refusal (exit 78).
## Unusable chunk conflict answers
At the snapshot-admission and non-plain-detach `chunkPostUntil` boundary,
an initial HTTP 409 does not establish non-admission. Its typed
body can describe an existing operation, work already performed, or a refusal.
If the body cannot be read or validated, the boundary records
`PossiblyAdmitted` with the existing connection-failure policy:
`outcome_unknown`, exit 3. A snapshot is recovered with its original request
ID and unchanged parameters, including its original absolute expiry, or an
already obtained handle. Non-plain detach supplies no ID or handle: keep the
writer stopped and inspect the holder's HEAD/logs for a confirmed seal or
abort; insufficient evidence requires investigation. The separate cut and
plain-detach observer does not use this classification path. A supplied request ID is
retained in the diagnostic and in any bounded same-request retry.
Complete typed answers retain their code and retry flag.
`TestChunkConflictStatusRowsHaveOutcomeClasses` inventories the direct and
delegated 409 returns in `chunkErrorCode`. Each direct code expression needs
an explicit outcome class; dynamic stored and catalog answers require their
typed body. The negative control rejects an unclassified new 409 code. These
classes never authorize a non-admission inference from status alone.
+3 -1
View File
@@ -1325,7 +1325,7 @@ Notes:
| `INV-SNAPSHOT-REPLAY-FLAG-001` | A successful same-ID snapshot admission reports replayed true without changing HEAD or its retained outcome. First creation reports false; the flag decorates only the response. | M9 snapshot outcome projection | `core/host/volume/snapshot_operation.go`, `chunk_control.go`; `cmd/sw-block/snapshot_operation.go` | `TestSnapshotReplayFlagDoesNotRewriteOutcome`, `TestSnapshotCLIUsesReplayedAdmissionAnswer` | SnapOps.Poll; SnapOps.Start (no transition change) | STUB |
| `INV-CLI-UNSENT-REQUEST-001` | An observed operation's initial typed dial failure sends no admission and is remote_unavailable (75) through the shared classifier. A lost answer after send, or a dial failure while polling an admitted handle, retains outcome_unknown. | CLI pre-admission error projection; no server transition | `cmd/sw-block/cut_progress_poll.go` `chunkObserveHandle`; `chunkTransportFailure`, `chunkFail` | `TestPlainDetachRefusedDialIsRemoteUnavailable`, `TestPlainDetachLostAnswerAfterSendStaysUnknown`, `TestPlainDetachPollDialFailureKeepsAdmittedOutcomeUnknown`, `TestOpsChunk_ErrorsAreJSONOnStdout` | CutTime Poll/CliGiveUp boundary; pre-admission transport proof | ACTIVE |
| `INV-CLI-MINI-EXECUTABLE-001` | Mini records and launches the executable selected by --weed without changing symlink/.. resolution; fresh and legacy runs use an absolute path. | TrialLauncher path wiring, no protocol transition | `cmd/sw-block/mini.go` `miniExecutablePath`, `mini`, `reuseMiniRecord` | `TestMiniWeedSymlinkParentKeepsSelectedExecutable`, `TestMiniRelativeWeedIsRecordedAndPrintedAbsolutely` (`cmd/sw-block`); `TestMiniCleanupFailStopAndSettlement` (`cmd/blockvolume`: failed-start proof rejects watchdog intervention; settled capture completes and live residue refuses cleanup) | NONE (path selection and test ownership only; fresh Linux qualification pending) | STUB |
| `INV-CLI-CATALOG-ERROR-001` | The chunk CLI preserves admission evidence and definite domain/certificate answers. Possibly-sent requests require replay/poll. Incomplete verify never exits 3; non-retryable server answers never exit 75. Absent snapshot delete is snapshot_not_found. | M9 client error projection; M4 census refusal, no transition change | `core/rpc/answer` `Lookup`; `cmd/sw-block/chunk_answer.go` `chunkAnswer`; `cmd/sw-block/chunk.go` `chunkResult`; `cmd/sw-block/catalog_snapshot_operation.go` `catalogSnapshotDeleteRefusal`; `core/frontend/chunkstore/single_filer.go` `CheckSingleFiler`; `core/frontend/chunkstore/layout/delete.go` `RunMarkDeleting` | `TestOpsChunkTransportFailureMatrix`, `TestOpsChunkVerifyUnreachableCensusPreservesTransport`, `TestCheckSingleFilerKeepsTransportCause`, `TestSingleFilerConfigurationErrorDeadlineBetweenReads`, `TestCheckSingleFilerSlowDialOrdering`, `TestDialBCatalogKeepsCustomCallerDeadline`, `TestMasterCensusKeepsCustomCallerDeadline`, `TestCheckSingleFilerValidatesAllMasterAddressesBeforeCensus`; `TestOpsChunkCatalogUnavailableIsTyped`, `TestCatalogTransportClassificationKeepsDefiniteAnswers`, `TestSnapshotDeleteAbsentCLIUsesContractCodeAndKeepsReceipt`; `TestLinkNeverTurnsASentRequestIntoSafeResend`; `TestChunkHTTPPostLostAnswerIsUnknown`; `TestCommandFamilyTransportGrid`; `TestLocalCredentialsFailBeforeDialWithTypedPolicy`; `TestHTTPCancellationBeforeDispatchKeepsOperationPhase`; `TestDeclaredDomainCodesHaveRegistryRows`; `TestOwnedClientTransportsKeepAdmissionEvidence`; `TestPresentationFailsClosedForUnknownContract`; `TestUnsentRPCWithMixedPeerFailuresIsRetryable`; `TestRPCPeerCertificateFailureDoesNotHideHandshakeTimeout`; `TestRPCSucceedsOnGoodPeerAfterBadCertificate`; `TestPeerCertificateProofRequiresEveryFreshCompletedAttempt`; `TestPeerDiagnosticTruncationNeverAuthorizesTerminalClassification`; `TestTypedRemoteUnavailableRespectsRetryable`; `TestNonRetryableServerAnswerNeverInvitesTemporaryRetry`; `TestVerifyStartCheckLostAnswerNeverLooksLikeFindings`; `TestVerifyIncompleteTransportPreservesPartialProgress`; `TestOpsFailoverUsesSharedDefiniteExitProjection`; `TestBlobHTTPAnswerSurvivesLayoutFetch`; `TestPlaintextPrefaceFailureKeepsUnsentRetryAndTLSHint`; `TestHTTPPartialCustomTraceCannotProveUnsentAfterReceivedPOST`; `TestHTTPRegisteredProtocolCannotProveUnsentAfterReceivedPOST`; `TestHTTPOwnedTransportDoesNotInheritRegisteredDefault`; `TestDelayedPeerNotificationCannotRefreshAnOldTLSFailure`; `TestObservedTLSForwardsPerCallAuthorityValidation`; `TestChunkCensusPreflightPreservesOpaqueContextCause`; `TestSingleFilerReviewPreservesDefiniteAndCallerWinner`; `TestReviewContextAndDefiniteAnswerPrecedence`; `TestReviewOldPickerCannotBorrowNewPeerGeneration`; `TestReviewContractProjectionAndReadOnlyRecovery`; `TestReviewAdmittedPollTLSFailureKeepsOperationRecoverable`; `TestReviewPickerCannotReplaceCustomCallerDeadline`; `TestReviewSelectedTLSCannotReplaceCallerCompletion`; `TestReviewHTTPStatusOverridesNestedTransport`; `TestReviewVerifyPreservesServerRetryRefusal`; `TestReviewInitialPostBodyFailurePreservesStatus`; `TestReviewForceMovePreservesServerPolicyExit`; `TestReviewFailoverDomainAnswerRequiresRecovery`; `TestSnapshotOperationCLIInterruptThenResumeUsesPrintedID`; `TestSnapshotOperationCLIInterruptedTLSKeepsUnknownAndHandle`; `TestReviewCompleteBodyKeepsStatusAndAdmission`; `TestReviewInvalidAdmissionKeepsOriginalRequest`; `TestReviewUnsafeSnapshotLocationKeepsOriginalUnknown`; `TestReviewAdmittedMissingResultKeepsUnknown`; `TestCutBusyHasItsOwnLegacyExitClass`; `TestCutCLIBusyIsDistinctAndDoesNotStartAnotherCut` | SnapOps.Poll; CutTime.Poll; CutTime.CliGiveUp (result projection; no new transition) | STUB |
| `INV-CLI-CATALOG-ERROR-001` | The chunk CLI preserves admission evidence and definite domain/certificate answers. Possibly-sent requests require replay/poll. Incomplete verify never exits 3; non-retryable server answers never exit 75. Absent snapshot delete is snapshot_not_found. | M9 client error projection; M4 census refusal, no transition change | `core/rpc/answer` `Lookup`; `cmd/sw-block/chunk_answer.go` `chunkAnswer`; `cmd/sw-block/chunk.go` `chunkResult`; `cmd/sw-block/catalog_snapshot_operation.go` `catalogSnapshotDeleteRefusal`; `core/frontend/chunkstore/single_filer.go` `CheckSingleFiler`; `core/frontend/chunkstore/layout/delete.go` `RunMarkDeleting` | `TestOpsChunkTransportFailureMatrix`, `TestOpsChunkVerifyUnreachableCensusPreservesTransport`, `TestCheckSingleFilerKeepsTransportCause`, `TestSingleFilerConfigurationErrorDeadlineBetweenReads`, `TestCheckSingleFilerSlowDialOrdering`, `TestDialBCatalogKeepsCustomCallerDeadline`, `TestMasterCensusKeepsCustomCallerDeadline`, `TestCheckSingleFilerValidatesAllMasterAddressesBeforeCensus`; `TestOpsChunkCatalogUnavailableIsTyped`, `TestCatalogTransportClassificationKeepsDefiniteAnswers`, `TestSnapshotDeleteAbsentCLIUsesContractCodeAndKeepsReceipt`; `TestLinkNeverTurnsASentRequestIntoSafeResend`; `TestChunkHTTPPostLostAnswerIsUnknown`; `TestCommandFamilyTransportGrid`; `TestLocalCredentialsFailBeforeDialWithTypedPolicy`; `TestHTTPCancellationBeforeDispatchKeepsOperationPhase`; `TestDeclaredDomainCodesHaveRegistryRows`; `TestOwnedClientTransportsKeepAdmissionEvidence`; `TestPresentationFailsClosedForUnknownContract`; `TestUnsentRPCWithMixedPeerFailuresIsRetryable`; `TestRPCPeerCertificateFailureDoesNotHideHandshakeTimeout`; `TestRPCSucceedsOnGoodPeerAfterBadCertificate`; `TestPeerCertificateProofRequiresEveryFreshCompletedAttempt`; `TestPeerDiagnosticTruncationNeverAuthorizesTerminalClassification`; `TestTypedRemoteUnavailableRespectsRetryable`; `TestNonRetryableServerAnswerNeverInvitesTemporaryRetry`; `TestVerifyStartCheckLostAnswerNeverLooksLikeFindings`; `TestVerifyIncompleteTransportPreservesPartialProgress`; `TestOpsFailoverUsesSharedDefiniteExitProjection`; `TestBlobHTTPAnswerSurvivesLayoutFetch`; `TestPlaintextPrefaceFailureKeepsUnsentRetryAndTLSHint`; `TestHTTPPartialCustomTraceCannotProveUnsentAfterReceivedPOST`; `TestHTTPRegisteredProtocolCannotProveUnsentAfterReceivedPOST`; `TestHTTPOwnedTransportDoesNotInheritRegisteredDefault`; `TestDelayedPeerNotificationCannotRefreshAnOldTLSFailure`; `TestObservedTLSForwardsPerCallAuthorityValidation`; `TestChunkCensusPreflightPreservesOpaqueContextCause`; `TestSingleFilerReviewPreservesDefiniteAndCallerWinner`; `TestReviewContextAndDefiniteAnswerPrecedence`; `TestReviewOldPickerCannotBorrowNewPeerGeneration`; `TestReviewContractProjectionAndReadOnlyRecovery`; `TestReviewAdmittedPollTLSFailureKeepsOperationRecoverable`; `TestReviewPickerCannotReplaceCustomCallerDeadline`; `TestReviewSelectedTLSCannotReplaceCallerCompletion`; `TestReviewHTTPStatusOverridesNestedTransport`; `TestReviewVerifyPreservesServerRetryRefusal`; `TestReviewInitialPostBodyFailurePreservesStatus`; `TestReviewForceMovePreservesServerPolicyExit`; `TestReviewFailoverDomainAnswerRequiresRecovery`; `TestSnapshotOperationCLIInterruptThenResumeUsesPrintedID`; `TestSnapshotOperationCLIInterruptedTLSKeepsUnknownAndHandle`; `TestReviewCompleteBodyKeepsStatusAndAdmission`; `TestChunkUnusableConflictAnswerIsUnknown`; `TestChunkConflictLoopKeepsOriginalRequest`; `TestReviewInvalidAdmissionKeepsOriginalRequest`; `TestReviewUnsafeSnapshotLocationKeepsOriginalUnknown`; `TestReviewAdmittedMissingResultKeepsUnknown`; `TestCutBusyHasItsOwnLegacyExitClass`; `TestCutCLIBusyIsDistinctAndDoesNotStartAnotherCut` | SnapOps.Poll; CutTime.Poll; CutTime.CliGiveUp (result projection; no new transition) | STUB |
| `INV-CLI-CHUNK-LOOP-001` | Above the per-request bound, sw-block ops chunk snapshot\|detach repeats the SAME request (same name and request id) only after a retryable or outcome_unknown answer. Manual cut and plain detach use the separate one-POST/read-only-poll contract. | client (no state machine): the CLI side of M5 requests | `cmd/sw-block/chunk_loop.go` `chunkPostLoop`; `cmd/sw-block/chunk.go` `chunkPostUntil` | `TestChunkSnapshotRepeatsTimedOutRequestsWithTheSameBody`, `TestChunkSnapshotLoopReusesTheGeneratedRequestID`, `TestChunkLoopRepeatsAnOutcomeUnknownNotMarkedRetryable` (`cmd/sw-block`) | — | ACTIVE |
| `INV-CLI-CHUNK-LOOP-002` | Above the per-request bound, sw-block ops chunk snapshot\|detach stops at the first definite answer (success or non-retryable refusal). | client (no state machine): the CLI side of M5 cut requests | `cmd/sw-block/chunk_loop.go` `chunkPostLoop` | `TestChunkLoopStopsOnANonRetryableRefusal`, `TestChunkDetachOutcomeUnknownSettles` (`cmd/sw-block`) | — | ACTIVE |
| `INV-CLI-CHUNK-LOOP-003` | Non-plain detach and snapshot admission obey a positive total --timeout. Snapshot observation keeps the same ID with bounded calls and no total deadline. Manual cut and plain detach use the separate inactivity-window contract. | client (no state machine): the CLI side of M5 cut requests | `cmd/sw-block/chunk_loop.go` `chunkPostLoop`; `cmd/sw-block/chunk.go` `chunkPostUntil` | `TestChunkLoopEndsAtTheTimeout`, `TestChunkLoopHeldProgressReadSendsNoRequestAfterTheTimeout`, `TestChunkLoopSlowAnswersAreBoundedByTheTimeout`, `TestChunkNonPositiveTimeoutIsRefused` (`cmd/sw-block`) | — | ACTIVE |
@@ -1339,6 +1339,8 @@ Notes:
- Answer-entry controls: `TestAnswerEntryBackupFailureTable`, `TestAnswerEntryRestoreFailureTable`, `TestAnswerEntryPlacementFailureTable` and `TestAnswerEntryShellInspectionFailureTable` exercise production command workflows with received HTTP/RPC answers, independent expected exits, call counts and recovery checks. `TestAnswerLegacyStopKeepsAcquiredCutHandle` and `TestAnswerLegacyPublicationUnknownNamesExistingTarget` pin the retained operation identity when a documented outer business refusal wraps an unknown outcome. These controls do not activate `INV-CLI-CATALOG-ERROR-001` without the remaining census review and Linux qualification.
- At `chunkPostUntil` (snapshot admission and non-plain detach), an unusable HTTP 409 body maps to outcome_unknown/3; status cannot establish non-admission. Snapshot recovery uses the original request ID with unchanged parameters, or an already obtained handle. Non-plain detach has neither identifier: keep the writer stopped and inspect the original holder's HEAD and logs for a confirmed seal or abort; if unproven, preserve diagnostics for investigation rather than guessing via a new operation. The separate cut/plain-detach observer is unchanged; a readable malformed initial reply can report unsupported_api_version/3 without proving an outcome. The existing bounded loop preserves its original request body; complete typed 409 answers keep their own code and retry flag (`INV-CLI-CATALOG-ERROR-001`, `INV-CLI-CHUNK-LOOP-001`). `TestChunkConflictStatusRowsHaveOutcomeClasses` and `TestChunkConflictCensusRejectsANewUnclassifiedCode` require an explicit class for every 409 mapper row, including typed-body-required delegates; status alone never substitutes for that body.
- `INV-CLI-CATALOG-ERROR-001`: Linux qualification remains pending; native CLI and receipt controls alone do not activate this row. A failed NoLiveLease observation keeps its transport cause under ErrHolderActive: the wrapper refuses progress but does not prove a live holder. Only proven-unsent failures whose policy permits resend may be resent; caller cancellation forbids automatic retry, and certificate rejection remains terminal until corrected. Possibly-admitted failures require replay or polling; actual authority refusals stay definite. The existing volume-delete retry window now presents its exhausted remote failure as remote_unavailable rather than unavailable.
- `INV-CUT-TIMER-RESTART-001`, `INV-CUT-TIMER-SKIP-001`: cuts are identified and ordered by the layer's in-process `CutSeq`, never by the `LastCutNs` wall stamp: a `CutSeq` not seen before is a success at the moment it is observed, and a periodic decision is skipped once `CutSeq` has moved; at start the existing value is not new, so a restart keeps the startup phase. The scheduled-snapshot worker (`INV-SNAP-SCHEDULED-KEEP-001`) runs on the same monotonic time: a new attachment seeds its due time at the next stable per-volume grid slot after HEAD's newest scheduled snapshot, or is due immediately without scheduled history. Future creation times are clamped to now. A re-armed loop on the same handle keeps its schedule (failures, retry time); a restart restores the last success and overdue age from HEAD. Tests: `TestScheduledSnapshotLoop_TakesEachSlotOnMonotonicTime`, `_RearmKeepsTheSchedule`, `_OverdueWithNoSuccess`, `TestSnapshotSchedule_SlotsAreOffsetPerVolume`.
- Not reachable in this release: `INV-WS-FREEZE-ACCOUNTING-001` (except its estimate and quiesce-slack report, which every successful cut returns) and `INV-CUT-PRECOPY-001`. `/chunk/detach` refuses `frozen` (`INV-CUT-FROZEN-DETACH-REFUSED-001`) and blockvolume refuses `--chunk-detach-precopy` (`INV-CUT-PRECOPY-FLAG-REFUSED-001`), so neither the frozen admission nor the pre-copy admission runs in a released process. Their code is kept and their tests below the HTTP handler still assert them, so their status stays ACTIVE. For the same reason the pre-copy policy that `INV-CUT-PLAIN-DETACH-001` keeps for an absent or false `plain` field is always off. `INV-WS-FREEZE-REFUSAL-001` stays reachable: its HTTP400 validation runs before the refusal. So do `INV-WS-FREEZE-REFUSAL-INPUTS-001` and `INV-WS-FREEZE-REFUSAL-PRECEDENCE-001`.
+16 -1
View File
@@ -935,6 +935,8 @@ Volume status (`/status?volume=<id>`, heartbeats, cluster status):
| `internal` | `ops chunk` commands with `--chunk-filer` | v1.1.0 only: also what an unreachable filer gives, and `ops chunk verify` and `ops chunk snapshot-delete` instead answer `bad_request: ... needs exactly one filer ... connection refused` (exit 2) after 30-60 s. From v1.1.1 these are `remote_unavailable`. | Check the filer address and that the filer runs, then retry. |
| `not_admitted` | restore | The target is not in the cluster spec. The printed cure (`--lifecycle-product-loop-interval`) does not apply to this setup. | Add the target without `size_bytes` and restart blockmaster (section 5). |
| `not_admitted ... live until <time>` | volume-delete | The volume's lease horizon has not passed. In v1.1.1 the answer's `retryable` field says which case applies: `true` (exit 75) means the delete is admitted and waits for its final lease barrier; `false` (exit 1, "stop the volume first") means a serving holder still holds the lease, so the delete was not admitted. | `true`: repeat with the same request id after that time. `false`: stop the holder (section 6, steps 1 and 2), then repeat (section 6). |
| `outcome_unknown` (retryable, exit 3; v1.1.2) | snapshot admission; non-plain detach | `HTTP 409 body is unusable`: the answer was cut off, unreadable, malformed or too large to relay. HTTP 409 alone cannot establish non-admission or that nothing was applied. | Snapshot: keep the same request id and original parameters, including absolute expiry; see below. Non-plain detach has no request id or handle: keep the writer stopped and inspect the original holder's HEAD/logs for a confirmed seal or abort; unresolved evidence requires investigation. |
| `unsupported_api_version` (non-retryable, exit 3) | initial cut or plain-detach observer reply | A readable malformed or unsupported-version answer does not establish the operation's outcome. | If a handle was already printed, query that handle. Without one, cut can be repeated for a later durable point (not proof of the original cut); for detach, keep the writer stopped and establish the original seal or abort from HEAD/logs before proceeding. |
| `remote_full` | cuts, snapshots | The chunk store has no space. | Add capacity, then retry. |
| `queue_full` | cuts, snapshots | Reclamation work must drain before another producer publishes. | Retry later. |
| `format_level_below_head_version` | cuts, in the holder log | The holder still runs at the format level it attached at, from before the finalize. | A v1.1.1 holder adopts the finalized level at its next lease renewal; restart a v1.1.0 holder (section 7). |
@@ -956,9 +958,22 @@ Volume status (`/status?volume=<id>`, heartbeats, cluster status):
- **Commands with `--request-id`** (`ops chunk snapshot`, `snapshot-delete`, `restore`, `volume-delete`,
`ops workspace move` with or without `--clean`, and `ops workspace force-move`): repeat the command with the same
request id until it answers. The answer settles what happened. This can take several minutes. Do not repeat an
request id and unchanged original parameters until it answers (for snapshot expiry, see below). The answer settles what happened. This can take several minutes. Do not repeat an
interrupted `snapshot-delete` by hand: a resume can stop the volume's snapshot deletes and cleaning (see the snapshot
delete known issue in the [v1.1.1 notes](releases/v1.1.1.md)).
- **Snapshots with `--expires`:** re-running that relative duration computes a new absolute
`expiresAtNs`, so even the same request id can be refused as a changed fingerprint. For a replay, replace
`--expires` with `--expires-at-ns N`, using the original absolute value and all the other original parameters.
If it was not recorded, use `ops chunk show --master MASTER --volume VOLUME --chunk-filer FILER --chunk-path CHUNK_PATH`
to read the named entry under `head.Snapshots`. Only when its `Meta.Operation.id` matches the original request id
may you take its `Meta.ExpiresNs` as that request's expiry. A successful original receipt/result, if already available,
also contains `expiresAtNs`. The `ops chunk snapshots` name list does not expose the expiry. If the matching published
entry/result is absent and the absolute value was not saved, do not invent one or repeat `--expires`: preserve the
request id and diagnostics for investigation. A missing list entry does not prove non-admission. For future commands
that may need replay, choose and record `--expires-at-ns` before the first attempt.
- **Non-plain detach** has no request id or handle. Keep the writer stopped and the original holder running while
inspecting its HEAD and logs for a confirmed seal or abort. Do not interpret a new detach's answer as the original
outcome; if neither outcome can be established, preserve diagnostics for investigation.
- **`ops chunk cut`** has no request id. Repeat the cut: a later cut gives a later durable point. It does not tell you
whether the earlier cut committed; for that, check the volume's snapshots and its last cut in status.
- **`volume stop`**: run the same `sudo /usr/local/bin/sw-block volume stop <volume>` again. Before its cut succeeds
+1 -1
View File
@@ -27,7 +27,7 @@ v1.1.1 is a fix release of the v1.1 line. None of its changes alters a stored fo
HTTP 200 with `apiVersion: 1`, the same `cutID` and a valid detach result means the detach completed. Keep the writer stopped, verify the detached HEAD against the holder, epoch and claim recorded before detach, and record its generation and position as in [step 3](../volume-lifecycle.md#planned-hand-over) before continuing. HTTP 202 with `apiVersion: 1`, the same `cutID` and `code: "in_progress"` means it is still running: keep guest I/O stopped and repeat only this read-only GET, not the detach POST.
HTTP 409 with `apiVersion: 1`, the same `cutID`, `code: "detach_aborted"` and `retryable: true` confirms this abort. The retained handle still occupies the detach slot until about `--timeout` plus 5 s after the abort. After either status or log confirmation, [repeat steps 1 and 2](../volume-lifecycle.md#planned-hand-over) immediately before a retry: require a granted lease for the same holder/epoch and save its current HEAD claim. Wait for that retention to expire before retrying the plain detach; if the retry answers `cut_busy` with reason `detach_in_progress`, wait and retry after expiry. This GET does not start another operation. Handles are transient: HTTP 404 `unknown_cut_id` (including after expiry or a holder restart), a failed query, or an unsettled answer does not confirm an abort. In that case keep guest I/O stopped, preserve the CLI output and holder logs, and follow [Recover an unknown plain detach](../volume-lifecycle.md#recover-an-unknown-plain-detach) before resuming I/O or moving the volume. Do not repeat the detach to discover its original outcome: `cut_busy` only means the slot is occupied, and a retry after expiry can start a new detach. A definite retryable CLI answer for this case is planned for v1.1.3.
HTTP 409 with `apiVersion: 1`, the same `cutID`, `code: "detach_aborted"` and `retryable: true` confirms this abort. The retained handle still occupies the detach slot until about `--timeout` plus 5 s after the abort. After either status or log confirmation, [repeat steps 1 and 2](../volume-lifecycle.md#planned-hand-over) immediately before a retry: require a granted lease for the same holder/epoch and save its current HEAD claim. Wait for that retention to expire before retrying the plain detach; if the retry answers `cut_busy` with reason `detach_in_progress`, wait and retry after expiry. This GET does not start another operation. Handles are transient: HTTP 404 `unknown_cut_id` (including after expiry or a holder restart), a failed query, or an unsettled answer does not confirm an abort. In that case keep guest I/O stopped, preserve the CLI output and holder logs, and follow [Recover an unknown plain detach](../volume-lifecycle.md#recover-an-unknown-plain-detach) before resuming I/O or moving the volume. A repeat may complete the intended final detach only with the guest writer stopped and kept stopped by the operator and authority unchanged; `plain_detach_busy` is not proof of a stopped writer. See the [repeat preconditions](../volume-lifecycle.md#recover-an-unknown-plain-detach). This repeat does not establish what the first attempt did; inspect `ops chunk show` for the resulting seal. A definite retryable CLI answer for this case is planned for v1.1.3.
## Known issue: `sw-block mini` as a non-root user (fixed in v1.1.2)
+20 -3
View File
@@ -25,7 +25,7 @@ v1.1.2 is not yet released.
HTTP 200 with `apiVersion: 1`, the same `cutID` and a valid detach result means the detach completed. Keep the writer stopped, verify the detached HEAD against the holder, epoch and claim recorded before detach, and record its generation and position as in [step 3](../volume-lifecycle.md#planned-hand-over) before continuing. HTTP 202 with `apiVersion: 1`, the same `cutID` and `code: "in_progress"` means it is still running: keep guest I/O stopped and repeat only this read-only GET, not the detach POST.
HTTP 409 with `apiVersion: 1`, the same `cutID`, `code: "detach_aborted"` and `retryable: true` confirms this abort. The retained handle still occupies the detach slot until about `--timeout` plus 5 s after the abort. After either status or log confirmation, [repeat steps 1 and 2](../volume-lifecycle.md#planned-hand-over) immediately before a retry: require a granted lease for the same holder/epoch and save its current HEAD claim. Wait for that retention to expire before retrying the plain detach; if the retry answers `cut_busy` with reason `detach_in_progress`, wait and retry after expiry. This GET does not start another operation. Handles are transient: HTTP 404 `unknown_cut_id` (including after expiry or a holder restart), a failed query, or an unsettled answer does not confirm an abort. In that case keep guest I/O stopped, preserve the CLI output and holder logs, and follow [Recover an unknown plain detach](../volume-lifecycle.md#recover-an-unknown-plain-detach) before resuming I/O or moving the volume. Do not repeat the detach to discover its original outcome: `cut_busy` only means the slot is occupied, and a retry after expiry can start a new detach. A definite retryable CLI answer for this case is planned for v1.1.3.
HTTP 409 with `apiVersion: 1`, the same `cutID`, `code: "detach_aborted"` and `retryable: true` confirms this abort. The retained handle still occupies the detach slot until about `--timeout` plus 5 s after the abort. After either status or log confirmation, [repeat steps 1 and 2](../volume-lifecycle.md#planned-hand-over) immediately before a retry: require a granted lease for the same holder/epoch and save its current HEAD claim. Wait for that retention to expire before retrying the plain detach; if the retry answers `cut_busy` with reason `detach_in_progress`, wait and retry after expiry. This GET does not start another operation. Handles are transient: HTTP 404 `unknown_cut_id` (including after expiry or a holder restart), a failed query, or an unsettled answer does not confirm an abort. In that case keep guest I/O stopped, preserve the CLI output and holder logs, and follow [Recover an unknown plain detach](../volume-lifecycle.md#recover-an-unknown-plain-detach) before resuming I/O or moving the volume. A repeat may complete the intended final detach only with the guest writer stopped and kept stopped by the operator and authority unchanged; `plain_detach_busy` is not proof of a stopped writer. See the [repeat preconditions](../volume-lifecycle.md#recover-an-unknown-plain-detach). This repeat does not establish what the first attempt did; inspect `ops chunk show` for the resulting seal. A definite retryable CLI answer for this case is planned for v1.1.3.
## Fixed
@@ -40,6 +40,20 @@ v1.1.2 is not yet released.
- **Effect:** blockmaster's start syncs its state directories, which can wait for the filesystem journal. When the import has changed records, it also runs a `syncfs` for each store with changed records on ext4, XFS, btrfs or tmpfs (Linux 5.8 or later), which waits for every pending write on that filesystem, including the holders' data. Starts took from about 20 seconds to over 150 seconds in our tests (one start was not ready after 2 minutes); this is not an upper bound. A volume whose lease expires stops serving until blockmaster is back; it is then granted again on the same holder, with its data. A forced move during that time can lose writes after the last published HEAD (see [forced move](../volume-lifecycle.md#after-a-crash)).
- **What to do:** In v1.1.2, with the state directory on its own filesystem, blockmaster's start no longer syncs any directory on the shared filesystem. Under one buffered-write load, three starts per case measured shared warm/cold medians of 31.3/122.9 seconds and dedicated medians of 1.6/2.5 seconds, with a dedicated warm maximum of 13.2 seconds. Warm directory fsyncs fell from 30 to 15; shared root-filesystem directory fsyncs fell from 30 to 0. These are measurements under that load, not a start-time promise. Run `sync` after creating and mounting the state filesystem. For a new install, install the units, then mount it and configure its persistent mount and the unit's mount dependency before the first start. Migrating existing state stops service; volumes fence once the downtime outlasts their leases. Stop and disable blockmaster (with v1.1.0 volume units, stop and disable the host's volumes first), copy all state preserving ownership and permissions, verify and sync the copy, then move the unmounted original directory aside (if it is a mount point itself, unmount it, keep that filesystem as the backup, and move the directory it uncovers aside too) and create an empty mount point. Configure the persistent mount and the unit's `RequiresMountsFor` plus `AssertPathIsMountPoint` drop-in, mount the copy, verify its stores and run `sync`. Enable and start blockmaster and confirm that it opens the copied stores and reloads existing records; only then remove the moved original. Never leave stale stores beneath the mount or start against an empty replacement. Follow the [state migration steps](../operations-manual.md#1-install-the-binaries-and-units). Keep holders' data off the state filesystem; a different directory on it is not enough. Restart blockmaster at low write load on the state filesystem, including when the cluster spec has not changed. If device lookup fails, a logged fallback retains the full ancestor walk.
## Recovery after an unusable chunk conflict answer
For snapshot admission and non-plain detach, an unusable HTTP 409 body
reports `outcome_unknown` (exit 3); status alone cannot prove non-admission.
A snapshot replay must keep the original request ID and parameters, including
its absolute expiry; re-running a relative `--expires` changes that value.
Non-plain detach provides no request ID or handle: keep the writer stopped
and inspect the original holder's HEAD/logs for a confirmed seal or abort;
if unproven, preserve diagnostics for investigation. See the
[recovery guidance](../operations-manual.md#10-typed-errors-and-what-to-do) for obtaining a
published snapshot's expiry. Within the existing command window, retries
retain the original request body and ID. Complete typed replies keep their
own code and retry flag. The separate cut/plain-detach observer is unchanged.
## CLI answer classification
A remote connectivity failure for a request the CLI can prove was never
@@ -105,9 +119,12 @@ second non-idempotent operation after an uncertain answer.
| Chunk: caller cancellation/deadline before send | 75 on gRPC/HTTP paths | 1 | Caller ended the attempt. Possible admission instead means UNKNOWN/3. |
| Snapshot observation: changed operation ID | 1 | 3 with `outcome_unknown` | Recover the original request id/handle; the mismatched answer does not settle it. |
| Snapshot observation: succeeded without a result, at admission or poll | 1 | 3 with `outcome_unknown` | Recover the original request id/handle; the incomplete observation does not settle it. |
| Plain detach: malformed seal result | 1 | 3 with `outcome_unknown` | Retry the same plain detach to settle it; the reply does not prove the sealed HEAD. |
| Plain detach: malformed seal result | 1 | 3 with `outcome_unknown` | The operator must stop and keep the guest writer stopped, with authority unchanged, a granted lease for the same holder and epoch, and the same HEAD claim recorded before the first attempt. Recheck all prerequisites in the [repeat procedure](../volume-lifecycle.md#recover-an-unknown-plain-detach). Under those conditions, repeat the same plain detach to complete the intended final detach: if already sealed it publishes nothing and answers the sealed HEAD from a fresh read; otherwise it can complete the seal. `plain_detach_busy` is not proof that the writer is stopped. The repeat does not establish what the first attempt did; inspect `ops chunk show` for the resulting seal. |
| Snapshot observation: JSON decoder failure | 75 | 3 with `outcome_unknown` | Recover the original operation; malformed data does not settle it. |
| Initial HTTP answer: complete malformed or oversized failure body | 1 | 1 / 2 / 3 / 5 | Received 4xx other than 429 retains its auth/argument/refusal class; 429, 5xx, other non-200 answers and an oversized successful/admission answer are UNKNOWN/3. An unreadable body never erases the response status or proves the sent operation failed. |
| Snapshot/non-plain-detach initial HTTP answer: unusable 4xx body, except 409/429 | 1 | 1 / 2 / 5 | Preserve the received auth/argument/refusal class; do not infer it from a nested transport error. |
| Snapshot/non-plain-detach initial HTTP answer: unusable 409/429, 5xx except 501, other non-200 answer excluding 4xx and 501, or oversized success/admission | 1 | 3 with `outcome_unknown` | Snapshot: recover with the original request id and unchanged parameters or an already obtained handle. Non-plain detach has no such identifier: keep the writer stopped and inspect the original holder HEAD/logs for a confirmed seal or abort; unproven outcomes require investigation. An unusable 409 never proves non-admission. |
| Snapshot/non-plain-detach initial HTTP answer: unusable 501 body | 1 | 1 with `unsupported` | The server does not implement the operation; use a server that supports it. This status is excluded from the unknown-response row above. |
| Cut/plain-detach observer: readable malformed initial 409 or unsupported version | 3 | 3 with `unsupported_api_version`, non-retryable | The observer cannot establish the original outcome. Query a previously printed handle if available; without one, cut may establish a later durable point, while detach requires confirming the original seal or abort from holder HEAD/logs before proceeding. |
| Snapshot admission: invalid identity/body or unsafe operation URL | 1 | 3 with `outcome_unknown` | Refuse the unsafe URL and retain the original request id; retry that id against the original status address. |
| Snapshot observation: interrupted after admission | 1 | 3 with `outcome_unknown` | Preserve the original request id and handle; resume that operation instead of starting another one. A valid terminal answer still takes precedence. |
| Chunk verify: incomplete lost answer | 75 for transport; 1 for other incomplete failure | 1 with JSON `outcome_unknown` | Read-only retry is safe; **3 is reserved for a completed scan with findings**. Proven unsent/retryable remote failure remains 75. |
+38 -13
View File
@@ -271,11 +271,13 @@ Exit 0: stdout is JSON with `volumeID`, `cutLSN`, `headGen`, `headEpoch` and
`lastWrittenLSN`; stderr has `sealed HEAD generation: G`. Copy `G`. From now on
the volume refuses I/O on this host. Do not go on after any other answer (see
the table below). After a confirmed successful seal, repeating the command
answers from the sealed HEAD. After `outcome_unknown`, do not repeat it to
discover what happened; follow [Recover an unknown plain detach](#recover-an-unknown-plain-detach).
For a malformed seal result, the CLI may say `retry the same plain detach to
settle it`. Do not follow that diagnostic: a new POST can start another
detach after the old handle expires. Use the recovery procedure instead.
answers from the sealed HEAD. For a malformed seal result, the CLI may say
`retry the same plain detach to settle it`: this is allowed to complete the
intended final detach only if the operator has stopped and keeps the guest
writer stopped and authority is unchanged. It does not establish what the
first attempt did; inspect `ops chunk show` for the resulting seal. See
[Recover an unknown plain detach](#recover-an-unknown-plain-detach) for the
preconditions and the separate read-only investigation of the first outcome.
To check: `sw-block ops chunk show --master MASTER --volume v1 --chunk-filer FILER --chunk-path CHUNK_PATH` shows
`head.State` `detached`, `head.Holder` `s1/R`, `head.Epoch` E, a nonempty
@@ -627,10 +629,26 @@ admission. Permanent and lineage errors are not converted to retryable errors.
## Recover an unknown plain detach
Keep the guest or writer stopped and leave the original holder running so it
can settle its outstanding HEAD write. Do not revoke, move, restart the holder,
or issue another detach to discover the original outcome. A retry can return
`cut_busy` while the old handle is retained; after expiry it can start a new
detach. Neither answer identifies the original outcome.
can settle its outstanding HEAD write. Do not revoke, move or restart the
holder during this recovery.
To complete the intended final detach after a malformed seal result, the
operator may repeat the same plain detach only while keeping the guest writer
stopped throughout and authority unchanged. Before repeating, require the
same holder and epoch with a granted lease (step 1) and the same HEAD claim
`C` recorded before the first attempt (step 2). `plain_detach_busy` is not
proof that the writer is stopped; the operator must stop it independently.
If the volume already sealed, the repeat publishes nothing and answers that
sealed HEAD from a fresh read; otherwise it can complete the intended seal.
A retained handle may first return `cut_busy`; wait for its retention to
expire and recheck the preconditions. Check the resulting seal with
`ops chunk show` before proceeding to revoke.
The repeat completes the intended operation but does not establish what the
first attempt did. To investigate that original outcome, use the read-only
checks below. To prove the first outcome from HEAD, observe it before any
repeat; a HEAD read after repeating proves only the resulting final seal.
A new detach answer is not evidence of the earlier attempt.
If the CLI printed a cut id, query that original handle promptly using the
[read-only status query](releases/v1.1.1.md#known-issue-plain-detach-can-abort-during-a-periodic-checkpoint).
@@ -646,8 +664,11 @@ the CLI output and the original holder's logs for this attempt and use these
read-only checks:
- Run `sw-block ops chunk show --master MASTER --volume v1 --chunk-filer FILER --chunk-path CHUNK_PATH`.
A detached HEAD matching the holder, epoch and claim `C` saved in step 2 is the seal proof;
record its generation and position as in step 3 before continuing to revoke.
A detached HEAD matching the holder, epoch and claim `C` saved in step 2
proves the first attempt sealed only if observed before any repeat. A matching
HEAD observed after a repeat proves the intended final seal, not which attempt
produced it. Record its generation and position as in step 3 before continuing
to revoke.
- To confirm an abort, find the original holder's log for this volume and
attempt: `durable: detach of volume=v1 aborted, nothing published; serving resumed:`.
The provider writes this only after its settlement proved non-publication
@@ -662,8 +683,12 @@ and save its current HEAD claim. Matching holder/epoch with an expired lease
is not enough; do not detach while the lease is expired or the assignment
has changed. A `cut_busy` answer still means wait, not confirmation.
If neither the sealed HEAD nor an unambiguously correlated abort is available,
keep guest I/O stopped and preserve the diagnostics for operator investigation.
If you need to establish the first outcome and neither a matching detached
HEAD observed before any repeat, a valid `detach_aborted` status on the original
handle, nor an abort log unambiguously correlated with the original attempt
is available, keep guest I/O stopped and
preserve the diagnostics for operator investigation; this is separate from
the conditional intended-final-detach repeat above.
If the original claim was not recorded before this attempt, a current HEAD
alone cannot establish that it matches the original claim; do not substitute
a claim read after the unknown answer.