Commit Graph
4 Commits
Author SHA1 Message Date
Ping QiuandClaude Opus 4.6 003b8c2f28 fix: require explicit build tags for io_uring backends, add implementation logging
All three io_uring backends (iceber, giouring, raw) now require explicit
build tags — no tag means standard-only. Each backend registers its name
via IOUringImpl so startup logs show compiled implementation alongside
requested/selected backend mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:19:31 -07:00
Ping QiuandClaude Opus 4.6 9d0ec8efa3 feat: tri-state IOBackend config with explicit logging and CLI flag
Replace UseIOUring bool with IOBackend IOBackendMode (tri-state):
- "standard" (default): sequential pread/pwrite/fdatasync
- "auto": try io_uring, fall back to standard with warning log
- "io_uring": require io_uring, fail startup if unavailable

NewIOUring now returns ErrIOUringUnavailable instead of silently
falling back — callers decide whether to fail or fall back based
on the requested mode. All mode transitions are logged:
  io backend: requested=auto selected=standard reason=...
  io backend: requested=io_uring selected=io_uring

CLI: --io-backend=standard|auto|io_uring added to iscsi-target.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 16:02:30 -07:00
Ping QiuandClaude Opus 4.6 66d5ba0a84 fix: BatchIO review fixes — linked SQE, ring overflow, resource leak, sync parity
1. HIGH: LinkedWriteFsync now uses SubmitLinkRequests (IOSQE_IO_LINK)
   instead of SubmitRequests, ensuring write+fdatasync execute as a
   linked chain in the kernel. Falls back to sequential on error.

2. HIGH: PreadBatch/PwriteBatch chunk ops by ring capacity to prevent
   "too many requests" rejection when dirty map exceeds ring size (256).

3. MED: CloseBatchIO() added to Flusher, called in BlockVol.Close()
   after final flush to release io_uring ring / kernel resources.

4. MED: Sync parity — both standard and io_uring paths now use
   fdatasync (via platform-specific fdatasync_linux.go / fdatasync_other.go).
   Standard path previously used fsync; now matches io_uring semantics.
   On non-Linux, fdatasync falls back to fsync (only option available).

10 batchio tests, all blockvol tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:47:03 -07:00
Ping QiuandClaude Opus 4.6 e55f369d66 feat: BatchIO interface for swappable flusher I/O backend
New package batchio/ with BatchIO interface (PreadBatch, PwriteBatch,
Fsync, LinkedWriteFsync) and standard sequential implementation.

Flusher refactored to use BatchIO: WAL header reads, WAL entry reads,
and extent writes are now batched through the interface. With the
default NewStandard() backend, behavior is identical to before.

UseIOUring config field added for future io_uring opt-in (Linux 5.6+).
9 interface tests, all existing blockvol tests pass unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:13:33 -07:00