Skip to content

refactor(io): encapsulate storage backend dispatch - #28

Merged
thweetkomputer merged 3 commits into
eloqdata:mainfrom
thweetkomputer:refactor/storage-backend
Nov 3, 2026
Merged

thweetkomputer merged 3 commits into
eloqdata:mainfrom
thweetkomputer:refactor/storage-backend

Conversation

@thweetkomputer

@thweetkomputer thweetkomputer commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Storage operations currently pass through NetBackend, while Worker repeats the SPDK/io_uring selection for each operation. This change introduces StorageBackend and gives Worker ownership of the single shared kernel ring. The public Worker submission APIs remain unchanged.

  • Route storage registration and submissions through StorageBackend, backed by SpdkBackend or the shared io_uring backend; remove storage methods from NetBackend.
  • Use private CRTP network/storage facades to access the worker-owned ring through a fixed address adjustment, without per-call ring parameters or stored owner/ring pointers. Keep the ring as the first base so it outlives both facades; initialize it before the adapters and shut it down after both stop.
  • Use the embedded SPDK backend's worker binding as its initialized/dispatch state. Remove the duplicate initialized_ flag; callbacks access the embedded backend directly and keep that binding through shutdown draining.
  • Preserve DPDK startup-failure notification, completion polling, wakeups, and storage statistics. Update the I/O/runtime architecture documents.

Validation (from the Bycorf repository):

cmake --build build-testcases --parallel 4
ctest --test-dir build-testcases --output-on-failure
cmake --build build-testcases-bypass --parallel 4
ctest --test-dir build-testcases-bypass --output-on-failure
pre-commit run

The test builds use CMAKE_BUILD_TYPE=Debug and BYCORF_BUILD_EXAMPLES=OFF; the bypass build additionally uses BYCORF_KERNEL_BYPASS=ON.

Both builds and all tests passed: 95 normal tests and 121 bypass-capable tests, including SPDK device-stub shutdown/reentry cases and DPDK software tests. The new shared-ring regression mixes network sends and storage reads and checks that stopping the facades does not destroy the worker-owned ring. Formatting passed. Hardware NIC/NVMe performance was not benchmarked.

GCC 13/AArch64 -O2 and -O3 assembly probes for read, send, sendmsg, and cancel are instruction-identical to explicit ring-parameter forwarding in both normal and bypass configurations, after normalizing local labels. This is a refactor, not a throughput claim.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 727366a7-46cd-4a39-8230-09d75c73ddd9
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@thweetkomputer
thweetkomputer merged commit 4b10a34 into eloqdata:main Nov 3, 2026
10 checks passed
@thweetkomputer
thweetkomputer deleted the refactor/storage-backend branch November 3, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant