A durable commit is reported as failed when aftercommit hits a database closed after the commit

Open
#1,117 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript, node.js
Domain
database

Research direction

Start with Transaction.commit() and commitSync() in src/transaction.ts, then trace how notify failures reach db.transaction() after a successful commit. The issue leaves the desired handling open, so first determine how the project represents durable commits and reports notification failures. Done means a notification error after a durable commit cannot make the caller treat that commit as failed or retry its writes.

Written by the indexing model from the issue text.

Description

Problem

Transaction.commit() and commitSync() (src/transaction.ts) emit aftercommit after a successful commit. If the database is closed by another env between the durable commit and that notification, notify throws "Database not open" and the commit rejects. db.transaction() then abandons a transaction that is already durable, and a caller that retries non-idempotent writes after that error duplicates them.

Found while fixing #1100 (a failing notification no longer replaces a failed commit's own error); the success path was deliberately left unchanged there.

Possible direction

Decide whether a notify failure after a successful commit should be reported at all (for example, drop it or surface it through a log warning), and make db.transaction() aware that the commit was durable.

Review-Deferral: a9ad197ae1fd2aa0 severity=minor category=data-integrity

🤖 Generated by Anthropic Claude (Sonnet 5.5); posted via @cb1kenobi.

Dominant language
C++
Stars
24
Forks
3
Avg merge
1d 17h
Merged PRs (30d)
94

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HarperFast/rocksdb-js

All issues in HarperFast/rocksdb-js

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.