mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #342] test(ublk): reproduce stale placeholder pages on pooled device image switch #365
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#365
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/342
Author: @NickNYU
Created: 10/5/2026
Status: 🔄 Open
Base:
main← Head:test/issue-302-ublk-pool-stale-pages📝 Commits (6)
9394c58test(ublk): reproduce stale placeholder pages on pooled device image switchff0cb77test(ublk): address review on pool stale-page reproducer5a9a675Apply batched suggestions from code review1efdad1test(ublk): drop unused alloc import after alloc_zeroed switch3ddf935test(ublk): address second OpenCodeReview round on stale-page reproducer724d9a1test(ublk): keep cleanup workdir alive until detached cleanup finishes📊 Changes
1 file changed (+525 additions, -0 deletions)
View changed files
➕
storage/ublk-daemon/tests/pool_page_cache_handover.rs(+525 -0)📄 Description
What
Adds an
#[ignore]d integration teststorage/ublk-daemon/tests/pool_page_cache_handover.rsthat deterministicallyreproduces the stale-placeholder-page defect from #302: a pooled ublk device
rebound from the all-zero idle placeholder to a nonzero business image keeps
serving zero pages through the buffered path, while
O_DIRECTreads of thesame offset return the correct content.
Test-only change; no production code is modified.
Why
Issue #302 documents the mechanism with a manual daemon-level experiment.
Encoding it as an executable test gives a shared, deterministic reference for
the fix discussion, and becomes permanent regression protection once the fix
lands: the key assertion (post-switch buffered read must return the business
image) is written against the correct behavior and currently fails, so the
test is ignored until it is un-ignored together with the fix.
Related issue
Refs #302 — this PR adds the reproducer only; it does not fix the defect.
Scope and non-goals
(
UblkDaemonServerin-process, daemon RPC protocol, overlaybd LSMT helpers).on the issue), and the
EnvdInstance::wait_for_readydiagnosticsimprovement mentioned in the issue, which would be a separate PR.
Design and behavior changes
No production behavior changes. The test:
repoBlobUrl,sparse on disk) with one known nonzero page at
0x7ffce000, using thecrate's own
create_file_rw/close_seal— no external overlaybd tools.UblkDaemonServerwith the issue's pool shape(
low=0, high=1, prewarm=false) and drives it through the publiclength-prefixed JSON RPC protocol.
O_DIRECTread, release tothe placeholder, retained buffered FD + deliberate placeholder cache fill,
reacquire (asserts the same
dev_idis reused), buffered vsO_DIRECTcomparison, and a
BLKFLSBUFrecovery control.runner used by
make test-ublk.Compatibility and operations
Linux with
ublk_drvandCAP_SYS_ADMIN(supplied byscripts/run-with-capabilities.shundermake test-ublk); it is#[ignore]d by default and self-skips when ublk is unavailable, so defaultand CI suites are unaffected.
Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetCommands and results:
Skipped checks and reasons:
make test-unit: no production code changed; the affected crate's fullsuite (
cargo test -p uvm-ublk-daemon) was run instead and is green.make -C services test: noservices/changes.Risks and reviewer notes
ublk. Running it with
--ignoredon a ublk-capable host fails by designuntil #302 is fixed; that failure is the reproduction.
doc comment at the top of
storage/ublk-daemon/tests/pool_page_cache_handover.rsand the finalbuffered assertion.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.