HarperFast / HarperFast/harper

Read transaction stays open indefinitely under high write load (renewingRefCount stuck)

Open
#684 0 comments 0 reactions 0 assignees View on GitHub
area:storage bug from-jira
Dominant language
JavaScript
Stars
89
Forks
10
Avg merge
2d 6h
Merged PRs (30d)
200

Description

Under high write throughput in a sharded cluster, read transactions are not closing and report errors every second until manual intervention:

```
[error]: Read transaction detected that has been open too long (over one minute)
Txn {
address: 140427120637888,
timerTracked: true,
refCount: 1,
renewingRefCount: 1, ← stuck
notCurrent: true,
openTimer: 58
}
```

The `renewingRefCount: 1, notCurrent: true` combination suggests the transaction renewal cycle is failing to complete — the transaction knows it's stale but can't close itself because of a pending renewer.

## Reproduction context

- 5-node sharded cluster, 50k req/s write throughput
- 1 KB record size with blobs
- Seen on 4.6.0-alpha.3

## Related

- [HarperFast/harper PR #304](https://github.com/HarperFast/harper/pull/304) — "make read txn timeout configurable and set default to 1min" (in review) adds a configurable timeout, but doesn't appear to address the stuck-renewer root cause.

## Acceptance criteria

- Read transactions close or are forcibly recycled even when `renewingRefCount` stays positive.
- Under high write load, the "open too long" error storm doesn't recur.

🤖 Filed by Claude on behalf of Kris.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.