apache / apache/incubator-pegasus
BUG(duplication): When "duplicate_log_batch_bytes" is greater than 0 , there is a probability that some data will be lost.
- Dominant language
- C++
- Stars
- 2.1k
- Forks
- 328
- PR merge metrics
- No merged PRs in 30d
Description
## Bug Report
1. What did you do?
https://github.com/apache/incubator-pegasus/blob/e42f1a65f0b7352c531e2bc90a9ac434e52ffe98/src/server/pegasus_mutation_duplicator.cpp#L251-L270
- The "muts" contain multiple mutations.
- When the RPC code of the last mutation is "RPC_RRDB_RRDB_DUPLICATE" or "RPC_RRDB_RRDB_BULK_LOAD", will execute "continue", not push duplicate_rpc into "_inflights".
- But the last_decree has updated, the next time the logs are loaded, these mutations will not be read again.
Contributor guide
Research direction
Start in src/server/pegasus_mutation_duplicator.cpp at lines 251-270 and trace how a batch containing multiple mutations updates last_decree and populates _inflights. Verify the behavior when the final mutation uses RPC_RRDB_RRDB_DUPLICATE or RPC_RRDB_RRDB_BULK_LOAD. Done means those mutations are not skipped on subsequent log loading and the data-loss case is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- databases, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100