dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
25.96k stars 954 forks source link

Lock the snapshot::big_value_mu_ within serializer for big values #4152

Open kostasrim opened 2 days ago

kostasrim commented 2 days ago

Currently we lock the mutex within BucketSaveCb, OnDbChange and OnJournalEntry. A better alternative is to lock it when we actually use the serializer object (for example SaveEntry). This will guarantee that the mutex is always locked when we serialize a big value.