Scavenging and store size

I launched a scavenging on a preproduction event store, and once the operation is finished… chunck files are bigger than before !

Unscavenged chuncks are usually around 262145 kB, but after scavenging they’re more like 262315 kB

That doesn’t seems right…

jeremie / thinkbeforecoding

If you don’t have a lot of deletes in your DBs, the size of scavenged chunk could easily be larger, because internally we also store the mapping from original LogPosition to actual position inside chunk.
Of course, we should that chunk (either original or scavenged) that has smaller size, but for now I enforce leaving scavenged (for better battle testing). I will add this as option in next release.

How much have you deleted? When having a scavenged chunk a map is written to the end to allow pointer redirection. You can see this code in tfchunk.cs. This map can be a few mb.

we should LEAVE* that chunk that has smaller size

Yep, It was not much data actually. So it makes sense with the mappings


I can expect chuncks to get only smaller (or stay same size) after 1st scavenging though ?

Because the mapping table has already been appended, and the new chunck (data + mapping) can only be smaller…

right ?


Yes there is a check to make sure even with map it’s smaller was just disabled. It has been reenabled