diff --git a/seaweed-block/cmd/sw-block/chunk.go b/seaweed-block/cmd/sw-block/chunk.go index ba77c9d03f..fbfbea21ef 100644 --- a/seaweed-block/cmd/sw-block/chunk.go +++ b/seaweed-block/cmd/sw-block/chunk.go @@ -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) diff --git a/seaweed-block/cmd/sw-block/chunk_conflict_body_test.go b/seaweed-block/cmd/sw-block/chunk_conflict_body_test.go new file mode 100644 index 0000000000..b1c27f034e --- /dev/null +++ b/seaweed-block/cmd/sw-block/chunk_conflict_body_test.go @@ -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) + } + }) + } +} diff --git a/seaweed-block/cmd/sw-block/review_complete_answer_test.go b/seaweed-block/cmd/sw-block/review_complete_answer_test.go index d4b7c25a1f..19b9e46c3c 100644 --- a/seaweed-block/cmd/sw-block/review_complete_answer_test.go +++ b/seaweed-block/cmd/sw-block/review_complete_answer_test.go @@ -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"}, } { diff --git a/seaweed-block/core/host/volume/chunk_conflict_census_test.go b/seaweed-block/core/host/volume/chunk_conflict_census_test.go new file mode 100644 index 0000000000..9f62062963 --- /dev/null +++ b/seaweed-block/core/host/volume/chunk_conflict_census_test.go @@ -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) + } +} diff --git a/seaweed-block/docs/design/answer-classification.md b/seaweed-block/docs/design/answer-classification.md index 2226c4baca..f38d312a20 100644 --- a/seaweed-block/docs/design/answer-classification.md +++ b/seaweed-block/docs/design/answer-classification.md @@ -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. diff --git a/seaweed-block/docs/design/invariants.md b/seaweed-block/docs/design/invariants.md index 34b0a00a9a..965b66a748 100644 --- a/seaweed-block/docs/design/invariants.md +++ b/seaweed-block/docs/design/invariants.md @@ -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`. diff --git a/seaweed-block/docs/operations-manual.md b/seaweed-block/docs/operations-manual.md index 1cb9921123..bf4fba223c 100644 --- a/seaweed-block/docs/operations-manual.md +++ b/seaweed-block/docs/operations-manual.md @@ -935,6 +935,8 @@ Volume status (`/status?volume=`, 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