mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 18:47:20 +01:00
fix: retain FIFO WAL admission tickets through append
This commit is contained in:
1 parent
56289b4fdb
commit
ebc0f5d3cd
5 files changed
+266
-8
No files matched your search
@@ -382,3 +382,19 @@ These are tracked for fixes. Most were raised by an independent review of this r
|
||||
- **No authentication** on the control plane, the replication channel or the filer client. Frontends bind to loopback by default. **Planned:** mTLS and role checks for destructive operations.
|
||||
- **blockmaster is a single instance.** There is no master high availability. A master outage longer than the lease stops I/O on every workspace, and recovery is then a forced move; Kubernetes volumes cannot fail over while it is down.
|
||||
- **Formats are exact-version.** The superblock, HEAD and segment formats are checked exactly and fail closed; the walstore superblock has no CRC. A format change needs a dual-reader release.
|
||||
|
||||
### WAL admission order
|
||||
|
||||
Each store Write/WriteBatch invocation keeps its oldest ticket through the append-capacity decision. Handing out multiple FIFO tokens before append would let a younger write consume the older write's space. Waiting and physical I/O run without the queue mutex. Command-wide multi-batch hold integration is separate from this store invocation queue.
|
||||
|
||||
```mermaid
|
||||
stateDiagram-v2
|
||||
[*] --> Queued
|
||||
Queued --> Oldest: prior invocation releases
|
||||
Queued --> Removed: cancellation or refusal
|
||||
Oldest --> Append: capacity available
|
||||
Oldest --> Removed: cancellation or refusal
|
||||
Append --> Released: append decision returns
|
||||
Released --> [*]
|
||||
Removed --> [*]
|
||||
```
|
||||
@@ -476,6 +476,12 @@ snapshot lifetime; local persistence does not bypass it.
|
||||
`AllWritten`/`NoStuckWaiter` in `REC_safe`/`REC_safe_big`; the no-internal-sync
|
||||
mutant violates liveness. Prior authored LIGHT receipts are referenced in
|
||||
`docs/spec/README.md`; this change does not claim a new TLC execution.
|
||||
- Store Write/WriteBatch admission queues invocations in FIFO order. The oldest
|
||||
ticket remains held through the append-capacity decision and is released by
|
||||
the existing post-write Release. A cancelled or refused invocation removes
|
||||
its ticket and wakes the next. No queue mutex is held while sampling pressure,
|
||||
waiting, or appending. The command-wide multi-batch hold is a separate caller
|
||||
integration; this queue does not claim that completed layer yet.
|
||||
- A v3 write carries one four-second command deadline through dispatch,
|
||||
adapter batches, store admission locks and occupancy snapshots. Admission
|
||||
reserves append headroom and expiry before append refuses without mutation.
|
||||
@@ -674,6 +680,7 @@ The "Machine / transition" column refers to Part A. Notes under a table record w
|
||||
| `INV-WAL-V3-RECORD-REFUSE-001` | The impl-3 codec refuses unknown types or flags, a zero nonce, invalid per-type geometry, overflowing spans and truncation before allocating a payload; the scanner reads a record only after those checks bound its size, and refuses nonzero padding, a bad CRC or a bad footer before using its bytes. | M1 v3 record framing | `core/storage/wal_entry_v3.go` `payloadSizeV3`, `decodeWALEntryV3`; `core/storage/wal_io_v3.go` `scanWALV3Accepted` | `TestWALEntryV3_RefusesInvalidEncode`, `TestWALEntryV3_RefusesMalformedWire`, `FuzzWALEntryV3_DecodeNeverPanics` | — | STUB |
|
||||
| `INV-WAL-V3-LSN-ORDER-001` | A v3 writer accepts only a first LSN above its highest consumed LSN; a batch consumes its whole validated range. Equal/lower requests return ErrWALLSNOrder before any pwrite or cursor change. Constructor coverage and a recovered kept frontier count as consumed; a fenced-away suffix does not. | M1 v3 append | `core/storage/wal_io_v3.go` `append`, `newWALWriterV3`, `restoreScanV3` | `TestWALLSNOrderV3_RefusesDuplicateAndLower`, `TestWALLSNOrderV3_BatchConsumesFullRange`, `TestWALLSNOrderV3_RestoreUsesKeptNotDroppedFrontier`, `TestWALLSNOrderV3_DescriptorFloorIsAlreadyConsumed`, `TestWALIOV3_ValidatedFrontierIntervals`, `TestWALIOV3_ConcurrentAppendsHaveUniqueCursors` | Physical LSN-strict prefix is a contract constraint; r16 model correspondence is pending | ACTIVE |
|
||||
| `INV-WAL-V3-ADMISSION-001` | v3 write admission measures WAL pressure from the active v3 writer's physical head minus the both-slot reuse floor, as a fraction of WALSize. | M1 Serving (write admission) | `core/storage/walstore.go` `openInitializedV3`, `WALStore.walUsedFraction`; `core/storage/write_command_budget.go` `WALStore.writePressureSample` | `TestWALStoreV3AdmissionUsesNativeOccupancy` (`core/storage/walstore_admission_v3_test.go`); `TestWALStoreV3WritePressureSampleMatchesOccupancy` (`core/storage/write_command_budget_test.go`); liveness under pressure: `TestWALStoreChunkV3_SequentialBurstFlush` (public provider and NVMe handler, default 64 MiB WAL, 320 MiB literal readback), `TestWALStoreChunkV3_BurstPatternBindsFullLBA` (32/64/256 MiB alias controls) (`core/frontend/durable/provider_chunk_burst_test.go`) | Existing reuse/durability rules unchanged; pressure/liveness is not a new model claim | ACTIVE |
|
||||
| `INV-WAL-V3-ADMISSION-FIFO-001` | Store write admission retains the oldest waiting ticket through its append-capacity decision; a cancelled waiter relinquishes its ticket without blocking later writes. | M1 Serving (write admission) | `core/storage/wal_admission.go` `acquireContext`, `Release`; `core/storage/wal_admission_fifo.go` | `TestWALAdmissionFIFOOwnsCapacityThroughAppend`, `TestWALAdmissionFIFOCancelledWaiterDoesNotBlockNext`, `TestWALStoreAdmissionFIFOOrdersRealAppends` | WALHold r2 rows 325-338, `AdmitInOrder`; command-wide multi-batch hold integration remains separate | ACTIVE |
|
||||
| `INV-WAL-V3-ADMISSION-FAULT-001` | A terminal I/O fault latched while a v3 write waits on WAL pressure or for an admission slot ends that wait with the fault's original typed cause, also when the deadline has expired at the same check. | M1 Serving (write admission) | `core/storage/wal_admission.go` `walAdmission.acquireContext`, `walAdmission.terminalFault`; `core/storage/write_command_budget.go` `WALStore.writeBudgetError` | `TestWALStoreV3AdmissionReturnsFaultLatchedDuringPressureWait` (Write and WriteBatch); `TestWALStoreV3WriteBudgetKeepsTerminalFault` (`core/storage/write_command_budget_test.go`); also in `core/storage/wal_admission_fault_v3_test.go` | — | ACTIVE |
|
||||
| `INV-WAL-V3-ADMISSION-DEADLINE-001` | One command deadline, the earlier of the caller's deadline and the command's arrival plus `WriteCommandBudget`, bounds every adapter batch of a write and its store waits for the capture and lifecycle locks, on the local clock. | M1 Serving (write admission) | `core/frontend/write_budget.go` `WithWriteBudget`; `core/frontend/durable/storage_adapter.go` `StorageBackend.Write`, `writeBytes`; `core/storage/write_command_budget.go` `WALStore.writeAdmissionDeadline`, `WALStore.acquireWriteLock`; `core/storage/walstore.go` `WALStore.WriteContext`, `WALStore.WriteBatchContext` | `TestStorageBackendWriteKeepsOneDeadlineAcrossBatches`, `TestWALStoreV3WriteContextDeadlineIncludesCaptureWait`, `TestWALStoreV3WriteBudgetIncludesPostAdmissionWait`, `TestSessionWriteBudgetIncludesDispatchQueue` | — | ACTIVE |
|
||||
| `INV-WAL-V3-ADMISSION-SHORTLOCK-001` | A v3 write takes the store, descriptor and WAL writer locks blocking, never by polling, so RWMutex writer preference holds, and its command deadline is checked once they are held. | M1 Serving (write admission) | `core/storage/walstore.go` `WALStore.WriteContext`, `WALStore.WriteBatchContext`; `core/storage/write_command_budget.go` `WALStore.writePressureSample`; `core/storage/wal_io_v3.go` `walWriterV3.append` | `TestWALStoreV3ExpiredWriterRefusesAfterShortLockWait`, `TestWALStoreV3WriteKeepsWriterPreferenceUnderReaders`, `TestWALStoreV3WriteBudgetRefusesAfterDescriptorWaitBehindSync` | — | ACTIVE |
|
||||
|
||||
Reference in new issue
Block a user