mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
fix cluster: migration crash fix (#4508)
* fix cluster: migration crash fix Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
parent
3fdd9877f4
commit
b4ef0a06e2
6 changed files with 112 additions and 8 deletions
|
@ -717,6 +717,7 @@ void DbSlice::FlushSlotsFb(const cluster::SlotSet& slot_ids) {
|
|||
PrimeTable* table = GetTables(db_index).first;
|
||||
|
||||
auto iterate_bucket = [&](DbIndex db_index, PrimeTable::bucket_iterator it) {
|
||||
it.AdvanceIfNotOccupied();
|
||||
while (!it.is_done()) {
|
||||
del_entry_cb(it);
|
||||
++it;
|
||||
|
@ -724,7 +725,7 @@ void DbSlice::FlushSlotsFb(const cluster::SlotSet& slot_ids) {
|
|||
};
|
||||
|
||||
if (const PrimeTable::bucket_iterator* bit = req.update()) {
|
||||
if (bit->GetVersion() < next_version) {
|
||||
if (!bit->is_done() && bit->GetVersion() < next_version) {
|
||||
iterate_bucket(db_index, *bit);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -297,7 +297,7 @@ bool RestoreStreamer::ShouldWrite(SlotId slot_id) const {
|
|||
bool RestoreStreamer::WriteBucket(PrimeTable::bucket_iterator it) {
|
||||
bool written = false;
|
||||
|
||||
if (it.GetVersion() < snapshot_version_) {
|
||||
if (!it.is_done() && it.GetVersion() < snapshot_version_) {
|
||||
stats_.buckets_written++;
|
||||
|
||||
it.SetVersion(snapshot_version_);
|
||||
|
|
|
@ -390,7 +390,7 @@ void SliceSnapshot::OnDbChange(DbIndex db_index, const DbSlice::ChangeReq& req)
|
|||
const PrimeTable::bucket_iterator* bit = req.update();
|
||||
|
||||
if (bit) {
|
||||
if (bit->GetVersion() < snapshot_version_) {
|
||||
if (!bit->is_done() && bit->GetVersion() < snapshot_version_) {
|
||||
stats_.side_saved += SerializeBucket(db_index, *bit);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue