Skip to content

docs: clarify RocksDB no-fsync durability and LMDB-only writeAsync - #733

Open
kriszyp wants to merge 5 commits into
mainfrom
docs/no-fsync-durability
Open

kriszyp wants to merge 5 commits into
mainfrom
docs/no-fsync-durability

Conversation

@kriszyp

@kriszyp kriszyp commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

⊙ Problem

Several v5 reference pages state or imply that Harper calls fsync on every commit on RocksDB (the default storage engine), that RocksDB's WAL persists committed writes, and that storage.writeAsync disables fsync on RocksDB. In reality, Harper disables RocksDB's WAL for table stores. It writes commits to its own transaction log in the OS page cache, without calling fsync. storage.writeAsync applies only to LMDB.

🤔 Should the docs state plainly that RocksDB commits are not fsynced by default and rely on replication confirmation for host-failure durability?

Yes, as specified in HarperFast/harper#3243 (durability-via-replication-position). Documenting the actual commit path stops operators from assuming single-node disk-sync durability or setting storage.writeAsync on RocksDB. It directs multi-node Harper Pro deployments to peer replication confirmation (replicatedConfirmation / X-Replicate-To: *;confirm=<k>).

💡 Solution

  • Add durability intro paragraphs under ## Durability vs. Throughput in storage-tuning.md covering what an acknowledged RocksDB write survives (process crashes via transaction-log replay) and does not (host/OS/power failure before OS flush), and how peer replication confirmation provides cross-host durability.
  • Remove the RocksDB WAL claim in storage-algorithm.md and mark storage.writeAsync as LMDB-only (<EngineBadge engines="LMDB" />) in storage-tuning.md and options.md.
  • Align logging.auditLog default (true) and replication.databases[].replicateTo in options.md and sharding.md, and update the Storage Algorithm card summary in overview.md.

🔧 Changes

🤔 Should we name the on-disk database/<db>/transaction_logs/ path and X-Replicate-To: *;confirm=<k> syntax (expose-txnlog-path, document-star-header)?

Yes. Naming database/<db>/transaction_logs/ shows the concrete directory operators see under the root path rather than an abstract reference to the transaction log. Documenting X-Replicate-To: *;confirm=<k> (server/REST.ts:278) lets REST callers request confirmation without pinning residency to a numeric replicateTo count.

🤔 Should replicateTo configuration examples use replication.databases[].replicateTo (docs-follow-code-for-replicateto)?

Yes. Harper core reads replicateTo from each replication.databases entry (resources/Table.ts:1496-1503). The example includes system because overriding the default '*' allowlist would otherwise silently turn off system database replication.

✅ Verification

  • Not testable end-to-end at runtime (documentation-only changes across five Markdown reference pages).
  • Executed npm run format:write and npm run format:check (clean across the repository).
  • Executed npm run build (clean production Docusaurus build across all 410 docs and versioned v4 docs with zero broken links or anchors).

Refs HarperFast/harper#3243

🤖 Generated by Google Gemini; posted via @kriszyp.

Related PRs: #723 overlaps (both edit reference/replication/sharding.md REST header section), 2 others independent
Complexity: medium

Origin — the dispatch brief this PR was written from

Correct Harper's v5 documentation so that it states plainly that Harper does NOT fsync commits on the RocksDB storage engine (the default), does not plan to by default, and that durability against machine/OS/power failure comes from replication confirmation, not disk sync. Today several pages say or imply that commits are fsynced by default and that storage.writeAsync: true is what turns fsync off. That is wrong for RocksDB.

Acceptance

  • No v5 doc page states or implies that Harper fsyncs commits by default on RocksDB, or that writeAsync disables fsync on RocksDB.
  • storage-tuning.md has a clear durability section: what an acknowledged write survives (process crash) and does not (OS/power/host failure before OS flush), and that replication confirmation (X-Replicate-To confirm / replicatedConfirmation) is the mechanism for durability across failures, linking reference/replication/sharding.md.
  • writeAsync is documented as LMDB-only in options.md and storage-tuning.md.
  • storage-algorithm.md no longer claims RocksDB WAL persistence.
  • Do not document any opt-in fsync setting (none exists). Do not edit v4 versioned docs or release notes.
  • Docs build/lint passes. PR body references harper#3243 (Refs, not Fixes).

Dispatch: task docs-no-fsync-durability · queued by kriszyp-session · ran by gemini/gemini-4-argon-high/low · worker kzyp-xps-1

Review-Coverage: authored=gemini; ran=claude; adjudicated=domain; declined=cursor-grok,cursor-composer,cursor-kimi,cursor-muse,muse; rounds=5; full=1 @ 8996b50

Review-Attention: skim ~2m (decisions: durability-via-replication-position, expose-txnlog-path, document-star-header, docs-follow-code-for-replicateto) @ 8996b50

kriszyp and others added 5 commits October 16, 2026 14:54
Explain that RocksDB commits write to Harper's transaction log in the OS
page cache without calling fsync (with RocksDB's own WAL disabled) and
rely on replication confirmation for durability across OS, power, or
host failures. Mark storage.writeAsync as LMDB-only and update the
storage algorithm and tuning pages accordingly.

Refs HarperFast/harper#3243

Dispatch-Task: docs-no-fsync-durability
Co-Authored-By: Gemini <noreply@google.com>
Qualify that process-crash recovery on RocksDB requires the transaction log
to be enabled (the default via logging.auditLog: true and @table(audit: true)),
distinguish replication confirmation from replicateTo residency, note failure
domain and single-node constraints, correct logging.auditLog default to true in
options.md, and update the Storage Algorithm summary in database/overview.md.

Refs HarperFast/harper#3243

Dispatch-Task: docs-no-fsync-durability
Co-Authored-By: Gemini <noreply@google.com>
…onfirmation

Document X-Replicate-To: *;confirm=<k> in storage-tuning.md and sharding.md so
REST clients can require peer confirmation without pinning residency to a fixed
node list, note the interaction with replication.replicateTo when omitting
replicateTo, and explicitly note that replication requires Harper Pro.

Refs HarperFast/harper#3243

Dispatch-Task: docs-no-fsync-durability
Co-Authored-By: Gemini <noreply@google.com>
…bases[].replicateTo

Note in storage-tuning.md that replication confirmation counts any <k>
responding peers (so <k> must exceed the number of peers in the writer's
failure domain to survive a site-wide failure), and reference per-database
replication.databases[].replicateTo in storage-tuning.md and sharding.md.

Refs HarperFast/harper#3243

Dispatch-Task: docs-no-fsync-durability
Co-Authored-By: Gemini <noreply@google.com>
…ist behavior

Include system in the replication.databases example in sharding.md, note that
setting replication.databases to a list replaces the '*' default, and list
replicateTo in the replication.databases sub-options in options.md.

Refs HarperFast/harper#3243

Dispatch-Task: docs-no-fsync-durability
Co-Authored-By: Gemini <noreply@google.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation to reflect the transition to RocksDB as the default storage engine, detailing its durability model, transaction log recovery mechanism, and replication confirmation features. It also clarifies that the storage.writeAsync option is legacy and only applies to LMDB, and updates configuration examples for sharding and replication counts. There are no review comments, so I have no feedback to provide.

@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-733

This preview will update automatically when you push new commits.

@kriszyp
kriszyp marked this pull request as ready for review October 17, 2026 01:45
@kriszyp
kriszyp requested a review from a team as a code owner October 17, 2026 01:45

This branch was successfully deployed

1 active deployment
pr-733 — 8996b507 Deployed Oct 16, 2026 by github-actions[bot]
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.

1 participant