diff --git a/seaweed-block/cmd/blockvolume/chunk_maintenance.go b/seaweed-block/cmd/blockvolume/chunk_maintenance.go index 9d36fa6c25..0f99b9d994 100644 --- a/seaweed-block/cmd/blockvolume/chunk_maintenance.go +++ b/seaweed-block/cmd/blockvolume/chunk_maintenance.go @@ -57,7 +57,7 @@ func newChunkMaintenance(cat *chunkstore.BCatalog, ref chunkstore.VolumeRef, cle diagnostic = "HEAD generation not read: HEAD absent" } defer func() { - durable.ReportMaintenance(ctx, durable.MaintenancePassStatus{Planned: int64(res.Planned), Removed: int64(res.Removed), PlannedChunks: int64(res.PlannedChunks), PlannedRoots: int64(res.PlannedRoots), PlannedSegments: int64(res.PlannedSegments), RemovedChunks: int64(res.Removed - res.Roots - res.Segments), RemovedRoots: int64(res.Roots), RemovedSegments: int64(res.Segments), HeadGen: head.Gen, Error: diagnostic}) + durable.ReportMaintenance(ctx, durable.MaintenancePassStatus{Planned: int64(res.Planned), Removed: int64(res.Removed), PlannedChunks: int64(res.PlannedChunks), PlannedRoots: int64(res.PlannedRoots), PlannedSegments: int64(res.PlannedSegments), RemovedChunks: int64(res.Removed - res.Roots - res.Segments), RemovedRoots: int64(res.Roots), RemovedSegments: int64(res.Segments), HeadGen: head.Gen, HeadGenError: diagnostic}) }() var rerr error res, rerr = cat.RemoveUnreachableAll(ctx, ref, me, s) diff --git a/seaweed-block/cmd/blockvolume/maintenance_status_test.go b/seaweed-block/cmd/blockvolume/maintenance_status_test.go index ddc5a9b6ff..c5bef75d5c 100644 --- a/seaweed-block/cmd/blockvolume/maintenance_status_test.go +++ b/seaweed-block/cmd/blockvolume/maintenance_status_test.go @@ -244,10 +244,10 @@ func TestMaintenanceStatusRealPassAndTimeout(t *testing.T) { expectedGen := before.Gen + 1 if kind == "head-unread" { expectedGen = 0 - if !strings.Contains(last["error"].(string), "HEAD generation not read") { + if last["error"] != "" || !strings.Contains(last["headGenError"].(string), "HEAD generation not read") { t.Fatalf("missing diagnostic: %v", last) } - } else if last["error"] != "" { + } else if last["error"] != "" || last["headGenError"] != "" { t.Fatalf("unexpected error: %v", last) } if after.Gen != before.Gen+2 || m["passesOk"] != float64(1) || last["headGen"].(float64) != float64(expectedGen) { diff --git a/seaweed-block/cmd/blockvolume/testdata/maintenance-retention-only.json b/seaweed-block/cmd/blockvolume/testdata/maintenance-retention-only.json index 68f680b767..471b88ad5f 100644 --- a/seaweed-block/cmd/blockvolume/testdata/maintenance-retention-only.json +++ b/seaweed-block/cmd/blockvolume/testdata/maintenance-retention-only.json @@ -13,6 +13,7 @@ "removedRoots": 0, "removedSegments": 0, "error": "", + "headGenError": "", "headGen": 0 } } diff --git a/seaweed-block/core/frontend/durable/maintenance_status.go b/seaweed-block/core/frontend/durable/maintenance_status.go index 327b37d26d..8a33cec78b 100644 --- a/seaweed-block/core/frontend/durable/maintenance_status.go +++ b/seaweed-block/core/frontend/durable/maintenance_status.go @@ -26,7 +26,8 @@ type MaintenancePassStatus struct { RemovedChunks int64 `json:"removedChunks"` // chunk objects removed RemovedRoots int64 `json:"removedRoots"` // root objects removed RemovedSegments int64 `json:"removedSegments"` // segment objects removed - Error string `json:"error"` // one-line pass/observation error; empty when both succeeded + Error string `json:"error"` // one-line callback error; empty when the callback completed + HeadGenError string `json:"headGenError"` // diagnostic HEAD read error; empty when read HeadGen uint64 `json:"headGen"` // observed cleaning HEAD generation; diagnostic only } @@ -59,12 +60,12 @@ func (m *maintenanceSlot) end(err error) { defer m.mu.Unlock() m.result.AtNs = time.Now().UnixNano() if err != nil { - m.result.Error = strings.TrimSpace(m.result.Error + "; " + err.Error()) - m.result.Error = strings.TrimPrefix(m.result.Error, "; ") + m.result.Error = err.Error() } else { m.s.PassesOK++ } m.result.Error = strings.Join(strings.Fields(m.result.Error), " ") + m.result.HeadGenError = strings.Join(strings.Fields(m.result.HeadGenError), " ") last := m.result m.s.LastPass, m.s.InProgress, m.s.CurrentStartNs = &last, false, 0 } diff --git a/seaweed-block/docs/releases/cleaning-convergence.md b/seaweed-block/docs/releases/cleaning-convergence.md index 0adf07bea2..d70a5a4085 100644 --- a/seaweed-block/docs/releases/cleaning-convergence.md +++ b/seaweed-block/docs/releases/cleaning-convergence.md @@ -37,7 +37,7 @@ breakdown. `removedChunks`, `removedRoots`, and `removedSegments` give the delet breakdown; metadata is included in the total. A metadata-only pass therefore never reports `removed: 0` when it reclaimed roots or segments. A pass that fails before entering cleaning has zero counts and generation; these zeros do not prove a clean store. -An unreadable HEAD generation is named as "not read" in `error`; its zero +An unreadable HEAD generation is named as "not read" in `headGenError`; its zero generation is unavailable, not a storage fact. This diagnostic does not fail the cleaning callback or suppress its success count. A timed-out pass is recorded as an error and does not increment `passesOk`. These are process-local observations, not authority or a safety decision. diff --git a/seaweed-block/docs/status-schema.md b/seaweed-block/docs/status-schema.md index aa17607a47..5b89b85d8a 100644 --- a/seaweed-block/docs/status-schema.md +++ b/seaweed-block/docs/status-schema.md @@ -232,7 +232,8 @@ Durable store state of the served volume. Go type `volume.durableStatusBody`. | `Volumes[].Chunk.Maintenance.lastPass.removedChunks` | int64 | chunk objects removed | | `Volumes[].Chunk.Maintenance.lastPass.removedRoots` | int64 | root objects removed | | `Volumes[].Chunk.Maintenance.lastPass.removedSegments` | int64 | segment objects removed | -| `Volumes[].Chunk.Maintenance.lastPass.error` | string | one-line pass/observation error; empty when both succeeded | +| `Volumes[].Chunk.Maintenance.lastPass.error` | string | one-line callback error; empty when the callback completed | +| `Volumes[].Chunk.Maintenance.lastPass.headGenError` | string | diagnostic HEAD read error; empty when read | | `Volumes[].Chunk.Maintenance.lastPass.headGen` | uint64 | observed cleaning HEAD generation; diagnostic only | | `Volumes[].Chunk.Attached` | bool | the chunk layer is attached to the remote | | `Volumes[].Chunk.AwaitingAuthority` | bool | recovered; the layer waits for master authority to attach |