mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
feat: negotiate NVMe command retry delays for transient readiness
This commit is contained in:
1 parent
eed6b08bbc
commit
1b9dbbaea3
9 files changed
+318
-14
No files matched your search
@@ -0,0 +1,108 @@
|
||||
//go:build linux && subprocess && chunkstore_integration
|
||||
|
||||
package main_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
// This opt-in procedure uses the kernel's block I/O retry path, not passthrough
|
||||
// commands or the userspace test initiator. The lab's retained build overlay
|
||||
// holds the holder's first write Busy for 2 s before any storage I/O.
|
||||
func TestProcedureKernelReadinessRetryDelay(t *testing.T) {
|
||||
if os.Getenv("SWBLOCK_NVME_RETRY_KERNEL") != "1" {
|
||||
t.Skip("requires a disposable root Linux host and the retained 2s Busy overlay")
|
||||
}
|
||||
budget, err := os.ReadFile("/sys/module/nvme_core/parameters/max_retries")
|
||||
if err != nil || strings.TrimSpace(string(budget)) != "5" {
|
||||
t.Fatalf("kernel max_retries=%q err=%v; require default5", budget, err)
|
||||
}
|
||||
uuid, err := os.ReadFile("/proc/sys/kernel/random/uuid")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
token := strings.TrimSpace(string(uuid))
|
||||
nqn := "nqn.2026-12.io.seaweedfs:retry-" + strings.ReplaceAll(token, "-", "")
|
||||
root := t.TempDir()
|
||||
receipt := filepath.Join(root, "busy-started")
|
||||
t.Setenv("SWBLOCK_TEST_BUSY_RECEIPT", receipt)
|
||||
env := startHandoffEnvWith(t, 1, nil)
|
||||
env.volExtra = []string{"--nvme-subsysnqn", nqn, "--chunk-capture-interval", "0", "--chunk-snapshot-schedule", "off"}
|
||||
holder := env.start(t, "kernel-retry-holder", "s1")
|
||||
env.adopt(t, holder, "s1")
|
||||
host, port, err := net.SplitHostPort(env.hosts["s1"].nvme)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
cleanup := func() {
|
||||
controllers, _ := filepath.Glob("/sys/class/nvme/nvme*")
|
||||
for _, controller := range controllers {
|
||||
got, _ := os.ReadFile(filepath.Join(controller, "subsysnqn"))
|
||||
if strings.TrimSpace(string(got)) == nqn {
|
||||
if err := os.WriteFile(filepath.Join(controller, "delete_controller"), []byte("1"), 0200); err != nil {
|
||||
t.Errorf("disconnect own controller: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
t.Cleanup(cleanup)
|
||||
fabric, err := os.OpenFile("/dev/nvme-fabrics", os.O_RDWR, 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
_, err = fabric.WriteString(fmt.Sprintf("transport=tcp,traddr=%s,trsvcid=%s,nqn=%s,hostnqn=nqn.2026-12.io.seaweedfs:host-%s,hostid=%s,nr_io_queues=1", host, port, nqn, token, token))
|
||||
closeErr := fabric.Close()
|
||||
if err != nil || closeErr != nil {
|
||||
t.Fatalf("kernel connect: write=%v close=%v", err, closeErr)
|
||||
}
|
||||
var device string
|
||||
for end := time.Now().Add(20 * time.Second); time.Now().Before(end); time.Sleep(50 * time.Millisecond) {
|
||||
blocks, _ := filepath.Glob("/sys/block/nvme*n*")
|
||||
for _, block := range blocks {
|
||||
got, _ := os.ReadFile(filepath.Join(block, "device", "subsysnqn"))
|
||||
if strings.TrimSpace(string(got)) == nqn {
|
||||
device = "/dev/" + filepath.Base(block)
|
||||
break
|
||||
}
|
||||
}
|
||||
if device != "" {
|
||||
break
|
||||
}
|
||||
}
|
||||
if device == "" {
|
||||
t.Fatalf("no own namespace for %s", nqn)
|
||||
}
|
||||
payload := bytes.Repeat([]byte{0x6d}, 4096)
|
||||
source := filepath.Join(root, "payload")
|
||||
if err := os.WriteFile(source, payload, 0600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||
defer cancel()
|
||||
started := time.Now()
|
||||
out, err := exec.CommandContext(ctx, "dd", "if="+source, "of="+device, "bs=4096", "count=1", "oflag=direct", "conv=fdatasync", "status=none").CombinedOutput()
|
||||
elapsed := time.Since(started)
|
||||
t.Logf("kernel default retries=5 device=%s write_elapsed=%s err=%v output=%s", device, elapsed, err, out)
|
||||
if err != nil {
|
||||
t.Fatalf("kernel write failed inside 2s Busy window: %v %s", err, out)
|
||||
}
|
||||
if elapsed < 1900*time.Millisecond {
|
||||
t.Fatalf("2s hold was not exercised: elapsed=%s", elapsed)
|
||||
}
|
||||
if _, err := os.Stat(receipt); err != nil {
|
||||
t.Fatalf("missing controlled Busy witness: %v", err)
|
||||
}
|
||||
got, err := exec.CommandContext(ctx, "dd", "if="+device, "bs=4096", "count=1", "iflag=direct", "status=none").Output()
|
||||
if err != nil || !bytes.Equal(got, payload) {
|
||||
t.Fatalf("kernel readback err=%v bytes=%d equal=%t", err, len(got), bytes.Equal(got, payload))
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import "time"
|
||||
// - Set Features (opcode 0x09)
|
||||
// FID 0x07 Number of Queues — grants NSQR/NCQR
|
||||
// FID 0x0F Keep Alive Timer — store only (no timer)
|
||||
// FID 0x16 Host Behavior Support -- negotiated ACRE only
|
||||
// - Get Features (opcode 0x0A)
|
||||
// FID 0x07 / 0x0F — round-trip what was set
|
||||
// - Keep Alive (opcode 0x18) — unconditional Success
|
||||
@@ -29,6 +30,7 @@ import "time"
|
||||
const (
|
||||
featNumberOfQueues uint8 = 0x07
|
||||
featKeepAliveTimer uint8 = 0x0F
|
||||
featHostBehavior uint8 = 0x16
|
||||
)
|
||||
|
||||
// handleSetFeatures services admin opcode 0x09.
|
||||
@@ -45,6 +47,24 @@ func (s *Session) handleSetFeatures(req *Request) error {
|
||||
}
|
||||
fid := uint8(cmd.D10 & 0xFF)
|
||||
switch fid {
|
||||
case featHostBehavior:
|
||||
valid := len(req.payload) == 512 && cmd.D10&(1<<31) == 0 && cmd.D11 == 0
|
||||
if valid {
|
||||
valid = req.payload[0] <= 1
|
||||
for _, b := range req.payload[1:] {
|
||||
if b != 0 {
|
||||
valid = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if !valid {
|
||||
req.resp.Status = MakeStatusField(SCTGeneric, SCInvalidField, true)
|
||||
} else {
|
||||
s.ctrl.setACRE(req.payload[0] == 1)
|
||||
}
|
||||
s.enqueueResponse(&response{resp: req.resp})
|
||||
return nil
|
||||
case featNumberOfQueues:
|
||||
// CDW11 low 16 = NSQR, high 16 = NCQR, both zero-based.
|
||||
// Cap each at 7 (T2 defensive cap).
|
||||
@@ -90,6 +110,13 @@ func (s *Session) handleGetFeatures(req *Request) error {
|
||||
return nil
|
||||
}
|
||||
switch fid {
|
||||
case featHostBehavior:
|
||||
data := make([]byte, 512)
|
||||
if sel == 0 && s.ctrl.getACRE() {
|
||||
data[0] = 1
|
||||
}
|
||||
s.enqueueResponse(&response{resp: req.resp, c2hData: data})
|
||||
return nil
|
||||
case featNumberOfQueues:
|
||||
req.resp.DW0 = s.ctrl.getNumQueues()
|
||||
s.enqueueResponse(&response{resp: req.resp})
|
||||
|
||||
@@ -67,6 +67,7 @@ type adminController struct {
|
||||
// Set Features state (11b A11/A12). Values the host asked
|
||||
// for; Get Features returns the same values back.
|
||||
numQueues uint32 // DW0 response for Feature 0x07; low 16 = NSQR, high 16 = NCQR
|
||||
acre bool // negotiated Advanced Command Retry Enable (volatile)
|
||||
kato uint32 // Keep Alive Timeout, milliseconds
|
||||
|
||||
// Single-slot pending AER (QA finding testing-#2, AERL=0
|
||||
@@ -186,6 +187,7 @@ func (c *adminController) setCC(newCC uint32) uint32 {
|
||||
c.csts |= 0x01 // set RDY
|
||||
} else {
|
||||
c.csts &^= 0x01 // clear RDY
|
||||
c.acre = false
|
||||
}
|
||||
_ = prevEN // kept for future state-transition logging
|
||||
return c.csts
|
||||
@@ -265,3 +267,15 @@ func (c *adminController) clearPendingAER() {
|
||||
c.pendingAERHasCID = false
|
||||
c.mu.Unlock()
|
||||
}
|
||||
|
||||
func (c *adminController) setACRE(enabled bool) {
|
||||
c.mu.Lock()
|
||||
c.acre = enabled
|
||||
c.mu.Unlock()
|
||||
}
|
||||
|
||||
func (c *adminController) getACRE() bool {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
return c.acre
|
||||
}
|
||||
@@ -77,6 +77,8 @@ func (s *Session) handleAdminIdentify(req *Request) error {
|
||||
// §6 stop rule #4 ("advertised ≡ implemented").
|
||||
func (s *Session) buildIdentifyController() []byte {
|
||||
buf := make([]byte, identifySize)
|
||||
binary.LittleEndian.PutUint16(buf[128:130], 1) // CRDT1, 100 ms units
|
||||
binary.LittleEndian.PutUint16(buf[130:132], 10) // CRDT2, readiness retry delay: 1 s
|
||||
|
||||
subNQN := s.ctrlSubNQN()
|
||||
volumeID := s.ctrlVolumeID()
|
||||
|
||||
@@ -2,6 +2,7 @@ package nvme
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"testing"
|
||||
@@ -46,20 +47,147 @@ func TestSessionReadNotReadyIsRetryable(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadinessRetryDelayIsNotAdvertised(t *testing.T) {
|
||||
func TestReadinessRetryDelayNegotiation(t *testing.T) {
|
||||
s := &Session{target: &Target{cfg: TargetConfig{VolumeID: "v1"}}, handler: &IOHandler{}, ctrl: &adminController{}, respCh: make(chan *response, 1), done: make(chan struct{})}
|
||||
controller := s.buildIdentifyController()
|
||||
for offset := 128; offset < 134; offset++ {
|
||||
if controller[offset] != 0 {
|
||||
t.Fatalf("CRDT byte%d=%d; host-policy control assumes no retry delay", offset, controller[offset])
|
||||
id := s.buildIdentifyController()
|
||||
if binary.LittleEndian.Uint16(id[128:130]) != 1 || binary.LittleEndian.Uint16(id[130:132]) != 10 || binary.LittleEndian.Uint16(id[132:134]) != 0 {
|
||||
t.Fatalf("CRDT bytes=%v", id[128:134])
|
||||
}
|
||||
for _, enable := range []byte{1, 0} {
|
||||
req := &Request{payload: make([]byte, 512)}
|
||||
req.capsule.D10 = 0x16
|
||||
req.payload[0] = enable
|
||||
if err := s.handleSetFeatures(req); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got := (<-s.respCh).resp.Status; got != 0 {
|
||||
t.Fatalf("ACRE=%d status=%#x", enable, got)
|
||||
}
|
||||
get := &Request{}
|
||||
get.capsule.D10 = 0x16
|
||||
if err := s.handleGetFeatures(get); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
answer := <-s.respCh
|
||||
if answer.resp.Status != 0 || len(answer.c2hData) != 512 || answer.c2hData[0] != enable {
|
||||
t.Fatalf("ACRE Get=%+v", answer)
|
||||
}
|
||||
}
|
||||
req := &Request{}
|
||||
req.capsule.D10 = 0x16 // Host Behavior Support, including ACRE.
|
||||
if err := s.handleSetFeatures(req); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
type retryDelayBackend struct {
|
||||
frontend.Backend
|
||||
err error
|
||||
}
|
||||
|
||||
func (b *retryDelayBackend) Read(context.Context, int64, []byte) (int, error) { return 0, b.err }
|
||||
func (b *retryDelayBackend) Write(context.Context, int64, []byte) (int, error) { return 0, b.err }
|
||||
func (b *retryDelayBackend) Sync(context.Context) error { return b.err }
|
||||
|
||||
func TestSessionRetryDelayOnEveryRetryableIO(t *testing.T) {
|
||||
for _, opcode := range []uint8{ioRead, ioWrite, ioFlush} {
|
||||
for _, enable := range []bool{false, true} {
|
||||
for _, cause := range []error{frontend.ErrNotReady, frontend.ErrBackendBusy, frontend.ErrStalePrimary, frontend.ErrBackendClosed, errors.New("disk fault")} {
|
||||
t.Run(fmt.Sprintf("opcode=%d/acre=%t/%v", opcode, enable, cause), func(t *testing.T) {
|
||||
b := &retryDelayBackend{Backend: testback.NewRecordingBackend(frontend.Identity{VolumeID: "v1"}), err: cause}
|
||||
s := &Session{handler: NewIOHandler(HandlerConfig{Backend: b}), ctrl: &adminController{}, respCh: make(chan *response, 1), done: make(chan struct{})}
|
||||
if enable {
|
||||
req := &Request{payload: make([]byte, 512)}
|
||||
req.payload[0] = 1
|
||||
req.capsule.D10 = 0x16
|
||||
s.handleSetFeatures(req)
|
||||
if got := (<-s.respCh).resp.Status; got != 0 {
|
||||
t.Fatalf("ACRE enable=%#x", got)
|
||||
}
|
||||
}
|
||||
req := &Request{payload: make([]byte, 4096)}
|
||||
req.capsule.OpCode = opcode
|
||||
req.capsule.NSID = 1
|
||||
s.dispatchIO(context.Background(), req)
|
||||
status := (<-s.respCh).resp.Status
|
||||
crd := (status >> 12) & 3
|
||||
transient := cause == frontend.ErrNotReady || cause == frontend.ErrBackendBusy
|
||||
want := uint16(0)
|
||||
if enable && transient {
|
||||
want = 2
|
||||
}
|
||||
if crd != want {
|
||||
t.Fatalf("status=%#x CRD=%d want%d", status, crd, want)
|
||||
}
|
||||
if transient && (status&0x8000 != 0 || status&0xffe != 0x0104) {
|
||||
t.Fatalf("retryable status changed=%#x", status)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
if got := (<-s.respCh).resp.Status; got != MakeStatusField(SCTGeneric, SCInvalidField, true) {
|
||||
t.Fatalf("unsupported Host Behavior status=%#x", got)
|
||||
}
|
||||
|
||||
func TestHostBehaviorRejectsUnsupportedPayloadWithoutChangingACRE(t *testing.T) {
|
||||
s := &Session{ctrl: &adminController{}, respCh: make(chan *response, 1), done: make(chan struct{})}
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
size int
|
||||
offset int
|
||||
value byte
|
||||
d10, d11 uint32
|
||||
}{
|
||||
{"empty", 0, 0, 0, 0, 0}, {"short", 511, 0, 0, 0, 0}, {"long", 513, 0, 0, 0, 0},
|
||||
{"bad-acre", 512, 0, 2, 0, 0}, {"etdas", 512, 1, 1, 0, 0}, {"lbafee", 512, 2, 1, 0, 0}, {"reserved", 512, 511, 1, 0, 0},
|
||||
{"save", 512, 0, 1, 1 << 31, 0}, {"cdw11", 512, 0, 1, 0, 1},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
enable := &Request{payload: make([]byte, 512)}
|
||||
enable.payload[0] = 1
|
||||
enable.capsule.D10 = 0x16
|
||||
s.handleSetFeatures(enable)
|
||||
if (<-s.respCh).resp.Status != 0 {
|
||||
t.Fatal("enable failed")
|
||||
}
|
||||
req := &Request{payload: make([]byte, tc.size)}
|
||||
req.capsule.D10 = 0x16 | tc.d10
|
||||
req.capsule.D11 = tc.d11
|
||||
if tc.size > tc.offset {
|
||||
req.payload[tc.offset] = tc.value
|
||||
}
|
||||
s.handleSetFeatures(req)
|
||||
if got := (<-s.respCh).resp.Status; got != MakeStatusField(SCTGeneric, SCInvalidField, true) {
|
||||
t.Fatalf("invalid payload accepted: %#x", got)
|
||||
}
|
||||
get := &Request{}
|
||||
get.capsule.D10 = 0x16
|
||||
s.handleGetFeatures(get)
|
||||
if got := (<-s.respCh).c2hData; len(got) != 512 || got[0] != 1 {
|
||||
t.Fatalf("refusal changed ACRE=%v", got)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestRetryDelayControllerIsolationAndReset(t *testing.T) {
|
||||
admin := &Session{ctrl: newAdminController(1, "test", "host-a", "v1"), respCh: make(chan *response, 1), done: make(chan struct{})}
|
||||
io := &Session{ctrl: admin.ctrl}
|
||||
other := &Session{ctrl: newAdminController(2, "test", "host-b", "v1")}
|
||||
res := IOResult{SCT: SCTGeneric, SC: SCNamespaceNotReady, retryable: true}
|
||||
req := &Request{payload: make([]byte, 512)}
|
||||
req.payload[0] = 1
|
||||
req.capsule.D10 = 0x16
|
||||
admin.handleSetFeatures(req)
|
||||
if (<-admin.respCh).resp.Status != 0 {
|
||||
t.Fatal("enable failed")
|
||||
}
|
||||
if io.completionStatus(res) != (res.completionStatus()|2<<12) || other.completionStatus(res) != res.completionStatus() {
|
||||
t.Fatal("negotiation not controller-scoped")
|
||||
}
|
||||
get := &Request{}
|
||||
get.capsule.D10 = 0x16 | 1<<8
|
||||
admin.handleGetFeatures(get)
|
||||
if got := (<-admin.respCh).c2hData; len(got) != 512 || got[0] != 0 {
|
||||
t.Fatal("default ACRE not zero")
|
||||
}
|
||||
admin.ctrl.setCC(1)
|
||||
admin.ctrl.setCC(0)
|
||||
if io.completionStatus(res) != res.completionStatus() {
|
||||
t.Fatal("controller reset retained ACRE")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package nvme
|
||||
|
||||
// completionStatus adds negotiated retry delay without changing the error class
|
||||
// or DNR. Every transient namespace-not-ready result uses the readiness delay;
|
||||
// selecting the shorter class would require a proved sub-500 ms bound.
|
||||
func (s *Session) completionStatus(r IOResult) uint16 {
|
||||
status := r.completionStatus()
|
||||
if r.retryable && r.SCT == SCTGeneric && r.SC == SCNamespaceNotReady && s.ctrl != nil && s.ctrl.getACRE() {
|
||||
status |= 2 << 12
|
||||
}
|
||||
return status
|
||||
}
|
||||
@@ -482,7 +482,7 @@ func (s *Session) dispatchIO(ctx context.Context, req *Request) {
|
||||
if s.logger != nil {
|
||||
s.logger.Printf("nvme: Flush failed qid=%d nsid=%d sct=%#x sc=%#x reason=%s", s.qid, req.capsule.NSID, res.SCT, res.SC, res.Reason)
|
||||
}
|
||||
req.resp.Status = res.completionStatus()
|
||||
req.resp.Status = s.completionStatus(res)
|
||||
}
|
||||
s.enqueueResponse(&response{resp: req.resp})
|
||||
default:
|
||||
@@ -593,7 +593,7 @@ func (s *Session) handleRead(ctx context.Context, req *Request) {
|
||||
NLB: req.capsule.LbaLength(),
|
||||
})
|
||||
if res.AsError() != nil {
|
||||
req.resp.Status = res.completionStatus()
|
||||
req.resp.Status = s.completionStatus(res)
|
||||
s.enqueueResponse(&response{resp: req.resp})
|
||||
return
|
||||
}
|
||||
@@ -620,7 +620,7 @@ func (s *Session) handleWrite(ctx context.Context, req *Request) {
|
||||
})
|
||||
s.recordWriteHandler(time.Since(handlerStart))
|
||||
if res.AsError() != nil {
|
||||
req.resp.Status = res.completionStatus()
|
||||
req.resp.Status = s.completionStatus(res)
|
||||
}
|
||||
s.enqueueResponse(&response{resp: req.resp, writeCompletion: true, queuedAt: time.Now()})
|
||||
}
|
||||
|
||||
@@ -617,6 +617,8 @@ The "Machine / transition" column refers to Part A. Notes under a table record w
|
||||
| `INV-FE-NVME-READY-001` | A read or write on a successfully recovered chunk volume awaiting attachment waits for attachment readiness, before storage admission, for at most 3 s or until an earlier caller deadline, on the local monotonic clock. | M1 Opened / Recovering → Serving | `core/frontend/durable/storage_adapter.go` `admitAfterAttachUnqueued`, `awaitAttachAdmission`, `readyCheck` | `TestWALStoreChunk_PendingReadWaitIsBounded`; `TestWALStoreChunk_PendingReadHonoursEarlierDeadline`; `TestWALStoreChunk_TakeoverWriteWaitsForAttach`; `TestReadReadinessWaitDoesNotHoldAdmissionAndCloseWakesIt` (`core/frontend/durable/read_ready_wait_test.go`); also in `core/frontend/durable/takeover_read_ready_test.go` | — | ACTIVE |
|
||||
| `INV-FE-NVME-READY-STATUS-001` | An NVMe read or write whose attachment-readiness wait times out or is refused completes with Namespace Not Ready (SC 0x82), DNR=0, without reading or mutating storage. | M1 Opened / Recovering → Serving | `core/frontend/durable/storage_adapter.go` `attachReadyTimeout`; `core/frontend/nvme/io.go` `mapBackendError` | `TestWALStoreChunk_TakeoverReadBeforeAttachIsRetryable`; `TestSessionReadNotReadyIsRetryable` (`core/frontend/nvme/read_ready_retry_test.go`); `TestWALStoreChunk_PendingAttachBeyondHostRetryBudget` (`core/frontend/durable/takeover_read_ready_test.go`) | — | ACTIVE |
|
||||
| `INV-FE-NVME-READY-ANA-001` | An I/O that ends during the attachment-readiness wait because the backend closed or its lineage went stale keeps its ANA error, and a physical I/O fault keeps Internal Error. | M1 Opened / Recovering → Serving | `core/frontend/durable/storage_adapter.go` `attachReadyTimeout`; `core/frontend/nvme/io.go` `mapBackendError` | `TestSessionReadNotReadyIsRetryable` (`core/frontend/nvme/read_ready_retry_test.go`); `TestReadReadinessWaitDoesNotHoldAdmissionAndCloseWakesIt` (`core/frontend/durable/read_ready_wait_test.go`) | — | ACTIVE |
|
||||
| `INV-NVME-RETRY-DELAY-001` | A negotiated ACRE controller returns retryable Namespace Not Ready with CRD=2 (CRDT2=1 s), DNR clear; permanent and successful completions do not gain retry delay. | M1 I/O completion encoding | `Session.completionStatus`; read/write/flush session handlers; `buildIdentifyController` | `TestReadinessRetryDelayNegotiation`, `TestSessionRetryDelayOnEveryRetryableIO` | NONE (wire encoding; no authority transition) | ACTIVE |
|
||||
| `INV-NVME-HOST-BEHAVIOR-001` | ACRE accepts only a supported 512-byte Host Behavior payload, is scoped to its controller and clears on controller reset; an invalid update preserves its prior value. | M1 controller capability negotiation | `handleSetFeatures`, `handleGetFeatures`, `adminController.setCC` | `TestHostBehaviorRejectsUnsupportedPayloadWithoutChangingACRE`, `TestRetryDelayControllerIsolationAndReset` | NONE (volatile capability; no authority transition) | ACTIVE |
|
||||
| `INV-FE-PRIMARY-READY-OPERATIONAL-001` | FrontendPrimaryReady is reported only while the local durable backend admits I/O, and the frontend target listens only after it first does; attach-pending, fenced or no durable status reports not ready with the reason. | M1 Opened / Recovering → Serving; M2 process exit | `core/host/volume/status_server.go` `statusProjection`; `core/frontend/durable/storage_adapter.go` `FirstServing`; `cmd/blockvolume/frontend_gate.go` `awaitFrontendStart` (the iSCSI, NVMe and ublk targets in `cmd/blockvolume/main.go` `runVolume` start after it); `cmd/blockvolume/process_exit.go` `waitWorkspaceStop` | `TestStatusServer_ReadyOnlyWhileBackendOperational`, `TestStatusServer_NotReadyAlwaysHasAReason` (`core/host/volume/status_server_test.go`); `TestFrontendGateWaitsForTheStorageClaim`, `TestFrontendGateStopsWithoutStartingTheFrontends` (`cmd/blockvolume/frontend_gate_test.go`); `TestDurableProvider_NonChunkVolumeServesRightAfterOpen` (`core/frontend/durable/first_serving_test.go`) | — | ACTIVE |
|
||||
| `INV-FE-FENCE-EXIT-001` | A workspace chunk primary whose backend fences after its target listens ends the process within detection plus the 5 s cleanup bound: a lease expiry at the guard's own deadline, a HEAD fence within 50 ms. | M1 Serving → Closed; M2 process exit | `core/frontend/durable/provider_startup.go` `watchChunkFence` (HEAD fence: not operational with the evidence within 50 ms; I/O refused from the fence); `cmd/blockvolume/process_exit.go` `watchChunkRuntimeFence` (78 `head_fenced`) and `waitWorkspaceStop` (lease fence: 75 `lease_expired`); `superviseProcess` (the 5 s cleanup bound from the decision) | `TestWALStoreChunk_RuntimeHeadFenceLatchesNotOperational` (`core/frontend/durable/runtime_fence_test.go`); `TestRuntimeHeadFenceChoosesHeadFencedExit` (`cmd/blockvolume/runtime_fence_exit_test.go`); real-binary case C (lease expiry after listening: exit 75) | — | ACTIVE |
|
||||
| `INV-WS-SERVE-LEASE-HELD-001` | A workspace primary claims HEAD, listens, reports ready and admits I/O only while its lease guard permits now; without a granted lease it holds at the gate and exits 75 when the startup wait runs out (`INV-WS-MASTER-WAIT-001`). | M1 Recovering → Serving; M2 process exit | `core/host/volume/workspace_lease.go` `WorkspaceLeaseGuard.Held` / `permits` (the one deciding function: the guarded projection gates the chunk claim, the per-I/O admit and); `core/frontend/durable/storage_adapter.go` `AdmitsIO` (the one "may serve" function, the I/O gate: backend admits AND guarded projection names this lineage; shared readiness rule); `core/host/volume/status_server.go` `statusProjection` (`FrontendPrimaryReady` from `AdmitsIO`; `NotReadyReason=lease_not_held` first); `cmd/blockvolume/frontend_gate.go` `frontendStartSignal` / `awaitFrontendStart` (a workspace primary's frontends start once `AdmitsIO` passes; non-chunk and supporting replicas start after open as before); `cmd/blockvolume/process_exit.go` (exit 75 `assignment_timeout`); `cmd/sw-block/shell_check.go` `FrontendPrimaryReady` | `TestStatusServer_WorkspacePrimaryNotReadyWithoutHeldLease`, `TestWorkspaceLeaseGrantIsLoggedOnceAfterRefusedRenewals`, `TestWorkspaceLeaseFirstRevokingReplyIsNotLoggedAsAGrant` (`core/host/volume/workspace_lease_held_test.go`); `TestStorageBackend_AdmitsIOIsTheIOGate` (`core/frontend/durable/admits_io_test.go`); `TestFrontendStartSignal_WorkspacePrimaryWaitsForAdmitsIO`, `TestFrontendStartSignal_OtherVolumesStartAfterOpenAsBefore`, `TestFirstAdmittedStopEndsTheWorker` (`cmd/blockvolume/frontend_start_signal_test.go`); real-binary cases B-late (restart before the forced-move barrier, re-granted inside the wait: no claim, listen or ready before the re-grant), B75 (no grant inside the wait: no claim, listen or ready, exit 75; a restart after the barrier serves) and B0 (restart inside the lease serves at once) | — | ACTIVE |
|
||||
|
||||
@@ -556,6 +556,17 @@ follow from that order:
|
||||
answer is `snapshot_deleting ... is being deleted; wait for the delete to finish, then
|
||||
reuse the name`, not the earlier success.
|
||||
|
||||
## NVMe transient retry delay
|
||||
|
||||
Linux hosts that enable Advanced Command Retry Enable (ACRE) receive a one-second
|
||||
retry delay on retryable Namespace Not Ready completions. The target advertises
|
||||
CRDT1=100 ms and CRDT2=1 s, and selects CRD=2 for all retryable SC 0x82 responses.
|
||||
The default Linux budget remains five retries; this is bounded backoff, not an
|
||||
unlimited wait. A host that does not negotiate ACRE keeps its existing behavior.
|
||||
A Busy condition that persists beyond the host's retry budget can still become
|
||||
an I/O error and needs diagnosis; readiness observation does not reserve future
|
||||
admission. Permanent and lineage errors are not converted to retryable errors.
|
||||
|
||||
## Symptoms
|
||||
|
||||
| You see | It means | Do |
|
||||
|
||||
Reference in new issue
Block a user