In which situation one record may have multi generations in storage

Hi team, Please help me explain in which situation one record may have multi generations in storage. For example in this link: Issues with cold-start resurrecting deleted records

1- Record updated several times

  • Record created (gen-1)
  • Record updated (gen-2)
  • Record updated (gen-3)

In the worst case, at the time of a cold restart all 3 versions of the record still exist on the disk (if the write transactions traffice didn’t lead to defragmentation and overwriting of the blocks the 3 values belonged to).

what this really mean: if the write transactions traffice didn’t lead to defragmentation and overwriting of the blocks the 3 values belonged to

Basically, once a record is written on disk and has subsequently been updated or replaced, the previous version of the record still exists on the disk (but is not linked from the primary index). The only way for the ‘old’ version of the record to not exist on the disk would be for the block it belongs to to be overwritten. For a block to be overwritten, it needs to first be ‘freed’, meaning for enough records on that block to have been deleted or updated so that the remaining ‘active’ records on the block represent less than defrag-lwm-pct percent of the block. Once the block has been defragmented, you would also need to have more write traffic to come in for the block to be overwritten with new data. Basically if you stop writing (inserting or updating records) the older versions of record would stay on the disk. Hope this helps.

1 Like