Closed p2004a closed 2 years ago
There have been previous instances of file corruption, though as far as I can tell, it also happened to some maps too. But knowing that, im very open to merging this, just to see if it does ok in the real world. I merged quite a few other changes to prd recently.
Can the validation maybe be enabled via cmd arg?
There is already a separate --rapid-validate
flag that validates consistency of the whole pool, so it can be triggered this way.
ok thanks!
Three changes:
About 2:
The current code will catch situation where both, at the same time:
SafeCloseFile
andfileSystem->removeFile
It's highly unlikely scenario.
The current code also catches when there is a silent on disc corruption, or there is power outage and somehow files are inconsistent. (Note that when downloading file using CFile, it's first being saved as tmp, and only then moved to destination so there is quite fine protection).
Given that e.g. maps/engine downloaded via HTTP don't have similar protection at all, it makes sense to drop this second consistency validation.
Overall savings: 1: 2-3s, 2: ~9s (from ramdisk), 3: ~100ms.
With it: