Hi, I reviewed the patch, and it looks good to me. The change is small and effective. I ran the tests locally: the new TAP test fails without the fix and passes with it.
The possible extra write after a worker restart is one more write of a small file, so I don't think it is a problem. I also tried to keep the last saved change count in shared memory to prevent that write. It works, but it adds shared state only to save one write, so I agree with the approach in your patch. Regards, Dongpo Liu
