dragonflydb / dragonflydb/dragonfly
Data loss during heartbeat
- Dominant language
- C++
- Stars
- 31.5k
- Forks
- 1.3k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 137
Description
When we do snapshots (replica/migration) we use global transactions to prevent simultaneous data changes during db_slice and journal_slice RegisterOnChange function calls to prevent data loss, but heartbeat ignores global transactions and can proceed to expire keys. We need to prevent heartbeat simultaneous execution with global transactions and one of the ways to make heartbeat transactional
Contributor guide
Research direction
Start by tracing heartbeat execution alongside the global-transaction paths used by db_slice and journal_slice, including RegisterOnChange calls. Determine how key expiration can overlap snapshots or migrations, then verify that heartbeat cannot cause data loss during a global transaction and add or run the relevant concurrency tests if the existing test coverage identifies the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100