garnet
garnet copied to clipboard
Make sure pre-serialized values are deleted after flush
- When we PostCopyUpdate an object, we replace the old image in the log with its serialized representation so that we have a consistent old version of the object.
- The disk flush thread (either snapshot or head page flush) can pick up this serialized data to write to disk. We currently leave the serialized data intact in memory. In this PR, we replace it with a null to save on extra memory use
- A subsequent snapshot can write Null to storage for this object, as we know the object is subsumed by a newer version thanks to the PCU.
- Recovering from a checkpoint will reconstitute a null object, which is fine because a newer version of the object is known to exist.
- This means we may now have null objects on the log - this is fine because Scan will always check for new version.
Open issue to be addressed - handle race between head flush and snapshot flush that will both try to set serialized data to null.