dragonflydb / dragonflydb/dragonfly
during rename, we delete old key and create a new one in parallel, which affects transaction atomicity
- Dominant language
- C++
- Stars
- 31.5k
- Forks
- 1.3k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 137
Description
we run next cb in parallel on 2 shards
```
void Renamer::FinalizeRename() {
auto cb = [this](Transaction* t, EngineShard* shard) {
const ShardId shard_id = shard->shard_id();
if (!do_copy_ && shard_id == src_sid_) {
return DelSrc(t, shard);
}
if (shard_id == dest_sid_) {
return DeserializeDest(t, shard);
}
return OpStatus::OK;
};
transaction_->Execute(std::move(cb), true);
}
```
Consider next flow
DelSrc() -> success
DeserializeDest(t, shard); -> ERROR
but the source is already deleted, so we lost the data
Contributor guide
Research direction
Start at Renamer::FinalizeRename and trace the transaction_->Execute callback through DelSrc and DeserializeDest on the source and destination shards. Reproduce or reason through a successful source deletion followed by destination failure, then verify that a failed rename does not leave the source data lost and that the operation remains atomic.
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