Skip to content

Feature/buffer manager - #2

Merged
theweird-kid merged 22 commits into
mainfrom
feature/buffer_manager
Aug 30, 2026
Merged

theweird-kid merged 22 commits into
mainfrom
feature/buffer_manager

Conversation

@theweird-kid

Copy link
Copy Markdown
Owner

This pull request makes several updates to the build system, documentation, and project configuration to reflect progress on the buffer pool manager and improve development workflow. The most important changes are summarized below.

Build system improvements:

  • Updated CMakeLists.txt to add src/buffer/buffer_pool_manager.cpp and src/buffer/page_guard.cpp to the kernsql_lib static library, ensuring these new components are included in builds. Also added -Werror=format to the compiler flags for stricter format checking.
  • Increased the test timeout to 120 seconds for all tests in CMakeLists.txt to prevent concurrency tests from hanging indefinitely during CI runs.

Documentation updates:

  • Updated the README.md to reflect the move to C++23, expanded the architecture and scope sections with more detail, clarified non-goals, and added direct links to new design docs. The build instructions now specify Clang 17+ with libc++. Example shell usage was added for clarity. [1] [2] [3] [4]

Obsidian workspace and appearance configuration:

  • Changed the Obsidian theme from moonstone to obsidian in .obsidian/appearance.json.
  • Added a new .obsidian/graph.json for graph view configuration.
  • Updated .obsidian/workspace.json to open the buffer pool manager design doc by default, adjusted file explorer settings, and refreshed the list of recently opened files. [1] [2] [3] [4]

abort on duplicate page mapping, not just assert
guards hand out the page body, not the header
UnpinPage published SetEvictable(true) after releasing the frame's metadata
mutex, so DeletePage could vacate the frame in that gap and revoke a membership
that did not exist yet, leaving one frame on the free list and in the replacer's
candidate set at once. Now published under the mutex.

DeletePage erased the mapping, dropped both locks, then deallocated. A fetcher
missing in that window read a still-ALLOCATED header, passed validation, and
republished a mapping for a page about to join the disk freelist; the recycled
id later served the dead page's bytes as a cache hit. Now the shard lock is held
across DeallocatePage.

Both are named exceptions to DD-002's lock-ordering rules, documented there
along with the interleavings and the rejected alternatives.

Tests: ConcurrentDeleteAndFetchStayConsistent rebuilt on a reusable barrier
whose completion function seeds each round and runs that round's quiescence
checks, 500 rounds -- 8/20 failures before, 0/20 after, and no stale
observations over 10,000 rounds. The one-page fetch test now accepts
kBufferPoolFull as a legal refusal; that flake predates this branch.
Co-authored-by: theweird-kid <62593159+theweird-kid@users.noreply.github.com>
@theweird-kid
theweird-kid merged commit 2a86cc9 into main Aug 30, 2026
7 checks passed
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.

2 participants