Skip to content

Preserve reader count metadata during concurrent writes - #74

Merged
MaxAkbar merged 1 commit into
mainfrom
version.4.6.6
Oct 12, 2026
Merged

MaxAkbar merged 1 commit into
mainfrom
version.4.6.6

Conversation

@MaxAkbar

Copy link
Copy Markdown
Owner

Summary

Readers created while a legacy writer holds its gate could lose exact committed row counts and repeatedly scan the table for COUNT(*), including after publication finished. Capture committed catalog metadata before legacy write admission and retry a safe capture after publication, retaining immutable state for readers already open. Keep the WAL concurrency fix, publication barriers, and conservative fallback after failed synchronization intact.

Update v4.6.6 release notes and the Unreleased changelog summary to include this fix.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactor / maintenance
  • Tests only

Related Issues

Follow-up to #73 and failed release qualification run https://github.com/MaxAkbar/CSharpDB/actions/runs/38185104713. No issue closure.

Testing

  • dotnet build CSharpDB.slnx (Release, clean overlay: zero warnings/errors)
  • Relevant tests executed (55 focused tests passed, zero failures/skips)
  • Failure-path tests executed (write admission/load cancellation, lock release, commit/rollback, and failure after durable native publication before shared catalog synchronization)
  • Manual verification performed (controlled local performance diagnostics)

All nine new regression tests pass with the fix; six fail against unchanged merged source 99ad896. Full Windows suite: 8,519 passed, zero failed, four existing optional SQL Server/MySQL/Access live-fixture skips across 27 modules. Documentation validation passed.

The unchanged tuned direct-client release workload improved in all three local before/after pairs: 14,577–18,143 to 310,953–329,003 reads/sec; P95 4.659–5.950 ms to 0.054–0.056 ms. Binary manifests confirmed only the engine assembly differed. A separate instrumented diagnostic recorded both reader and writer work and improved both in all six final continuous/paced writer pairs. These local results do not replace hosted release qualification or establish identical hosted interleavings.

Checklist

  • I followed the project style and conventions.
  • I added or updated tests for behavior changes.
  • I covered both success and failure paths for changed behavior.
  • I updated docs for user-facing changes.
  • I verified no sensitive data was added.

Notes for Reviewers

Reader creation never waits for the engine writer/shared-state gates. Writer capture takes the reader catalog monitor and tries the shared-state gate without waiting; acquired gates and temporary snapshot leases are released in finally. Failed native/legacy synchronization still forces snapshot-backed reads. Databases with prior readers pay catalog capture work at legacy write admission; large-catalog/page-map overhead has not been separately benchmarked.

No workload thresholds, benchmark settings, database formats, or public APIs changed. Linux/macOS validation, hosted performance qualification, and release packaging remain required before publishing v4.6.6.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T03:51:05.339357Z d1c23f8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@MaxAkbar
MaxAkbar merged commit 7ab9ec7 into main Oct 12, 2026
15 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