Repository navigation
refactor(runtime): adopt Bycorf storage backend facade - #417
Conversation
|
No actionable comments were generated in the recent review. WalkthroughThe Bycorf subproject reference now points to a different commit. The architecture overview describes one worker io_uring shared by network and storage I/O, timers, and wakeups, along with adapter initialization and shutdown order. Changesio_uring ownership and adapter lifecycle
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Possibly related PRs
Suggested labels: Suggested reviewers: Merge Risk:
|
The backend refactor stopped transitively exposing spdk_storage.h through Worker when kernel bypass is disabled. Include the declaring header directly for IsSpdkStoragePath in replacement-RDB validation. This fixes the Clang CI failure without changing runtime behavior.
Mark the insertion position used only by assertions as maybe_unused and explicitly default the Lua error-count collection to empty. This preserves behavior while resolving unused-parameter and missing-field-initializers diagnostics under Werror.
Context
Adopt the Bycorf refactor that encapsulates SPDK/io_uring storage dispatch in
StorageBackendrather than exposing storage throughNetBackendand repeating selection inWorker.Bycorf dependency eloqdata/bycorf#28 is merged. This PR pins its upstream merge commit
4b10a34e8eff7d991018454a682019773e3a112e, whose tree matches the tested refactor revision.Behavior before and after
Lavik continues to use the same public
Workerand storage-awaitable APIs. Each worker still uses one kernel ring for networking, kernel storage, timers and wakeups. Network and storage backend selection is now encapsulated in their respective Bycorf facades.Implementation
Advance Bycorf from
a430b323b65c61467a552d0f908aca0790e1cb99to4b10a34e8eff7d991018454a682019773e3a112eand update the system overview. Includebycorf/io/spdk_storage.hdirectly inserver.cpp: replacement-RDB validation callsIsSpdkStoragePath, and the refactored Worker no longer transitively exposes its declaration when bypass is disabled. Also keep Release builds warning-clean by marking the assert-only insertion parametermaybe_unusedand explicitly defaulting Lua error counts to empty. These changes preserve runtime behavior.Design decisions and alternatives
The worker owns the shared ring and its private CRTP network/storage facades. The ring is the first base subobject so it outlives the facades; facade access uses a fixed address adjustment without a stored ring pointer. SPDK dispatch reuses its worker binding as initialized state, without an additional optional wrapper or initialized flag. Details and the shared-ring regression are in the dependent Bycorf PR.
Documentation and comments
Updated
docs/architecture/01-overview.md; the Bycorf change updates its I/O/runtime architecture and ownership/drain comments.Test plan
Commands run from the Lavik repository root:
The test builds use
CMAKE_BUILD_TYPE=DebugandBYCORF_BUILD_EXAMPLES=OFF; the bypass build additionally usesBYCORF_KERNEL_BYPASS=ON.Both Bycorf builds passed: 95 normal tests and 121 bypass-capable tests passed. Bycorf formatting and parent formatting checks passed, including the application build fixes.
Clang 18 syntax checks passed for
server.cpp,list_command.cppandlua_eval.cppafter the build fixes. A complete GCC Release build and LTO link passed withcmake --build build --target lavik --parallel 6, with warnings treated as errors. That local integration check used the same application fixes on the follow-up fixed-buffer branch (Bycorf3389936); CI validates this PR with the merged refactor pin.Risk assessment
The runtime ownership/lifecycle refactor is exercised by shared-ring, SPDK stub shutdown/reentry, and DPDK software tests. Physical NIC/NVMe workloads were not benchmarked. The previous missing-declaration and Release warning failures are fixed; the latest CI run validates the exact PR revision.
Rollback plan
Revert this commit to restore the prior Bycorf pin and architecture description.
Reviewer guide
Review the runtime implementation and validation in Bycorf PR #28, then verify this pin and the overview's ownership/lifecycle model.
Follow-up work
The Bycorf dependency is merged and its upstream commit is pinned. Check the latest CI result before merging.
Summary by CodeRabbit
bycorfproject revision.