dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Handle PreUpdate() and PostUpdate() in PerformDeletion()

Open chakaz opened this issue 1 year ago • 2 comments

          I think we are missing a preupdate call on the scan items. If we expire the entry while scanning than how do we make sure we call PreUpdate before we delete it?

Originally posted by @adiholden in https://github.com/dragonflydb/dragonfly/pull/2308#discussion_r1431295495

chakaz avatar Dec 19 '23 15:12 chakaz

Eviction and Expiring items on background process

adiholden avatar Dec 19 '23 19:12 adiholden

@adiholden and I discussed this a few days ago. There is no correctness issue (we can think of?) when not calling PreUpdate() (and specifically the callbacks) before deleting an item. Usually before updating some value we want replication to send the original bucket, as the update can be incremental. But not sending the bucket before deletion would just mean that the replica will get the bucket without the deleted key. No harm done, unless the bucket is somehow changed by that, which shouldn't(?) be the case. Anyway, it does sound like a good idea to call PreUpdate() for consistency and possibly some edge cases we couldn't think of.

chakaz avatar Dec 25 '23 07:12 chakaz