Summary
KVCacheManager.alloc() can partially consume reserved blocks or blocks from existing pages before it needs to request another physical page. If PageAllocator.alloc_page() then raises RuntimeError because the shared physical pool is exhausted, the partial allocation is not rolled back.
Problem
This is a race/failure-mode issue under multi-instance pressure. available_size() can report enough logical capacity, but another instance may consume physical pages before the current instance reaches alloc_page(). In that case, the current allocation attempt can fail after it has already removed block ids from reserved blocks or page free lists.
Expected behavior
If a physical page allocation fails after partial block allocation, KVCacheManager.alloc() should roll back the partial block ids and return None as an allocation miss. The scheduler or caller can then apply its existing allocation-miss handling instead of leaking blocks or crashing.
Impact
This complements the existing EngineCore allocation-miss handling. It protects the lower-level allocator path where the failure originates, especially when multiple kvcached instances share the same physical KV pool.
Summary
KVCacheManager.alloc()can partially consume reserved blocks or blocks from existing pages before it needs to request another physical page. IfPageAllocator.alloc_page()then raisesRuntimeErrorbecause the shared physical pool is exhausted, the partial allocation is not rolled back.Problem
This is a race/failure-mode issue under multi-instance pressure.
available_size()can report enough logical capacity, but another instance may consume physical pages before the current instance reachesalloc_page(). In that case, the current allocation attempt can fail after it has already removed block ids from reserved blocks or page free lists.Expected behavior
If a physical page allocation fails after partial block allocation,
KVCacheManager.alloc()should roll back the partial block ids and returnNoneas an allocation miss. The scheduler or caller can then apply its existing allocation-miss handling instead of leaking blocks or crashing.Impact
This complements the existing EngineCore allocation-miss handling. It protects the lower-level allocator path where the failure originates, especially when multiple kvcached instances share the same physical KV pool.