vsm: Drastically refine status checks
From the main patch of the series:
Roughly:
- index hash change means restarted
- index new plus or minus means changed
- reopening the index means restarted
This aligns with my POLA expectations, except for one we can do nothing about after the removal of SIGNULL liveness checks.
Refs b845c2789cae4f165e30a3d0f3af1bfbbeca98ee
I wasted a fair amount of time trying to get transaction logs from a VTC involving a restart of the cache process. Ever since we stopped sending SIGNULL the cache process became virtually always running once started for the first time. Especially since vtc_varnish would only check the VSM_WRK_RUNNING flag.
Between a probable copy-pasta mistake and alleged logic errors, the VSM_WRK_CHANGED flag was effectively dead.
It turned out to be really hard to test, so I started a minimal vtc_vsm facility, and it became obscenely easy.
I picked a test case to test the result, and it wasn't even restarting the child process correctly...
This is very much incomplete, except for the overall structure of the patch series (I cut some corners) and this code has not seen anything remotely close to production.
And for now, I can go back to my troubleshooting in peace.
The test failure is unrelated and fixed by https://github.com/varnishcache/varnish-cache/pull/3955.
Other than a question about what constitutes a restart, this looks fine so far.
I rebased against master and brought back "SIGNULL" handling. Everything is ready for a formal review, except the bits in varnishtest. I remembered this patch series while revisiting the VSM code.
ping @drodden
A couple of very minor things, but otherwise looks fine to me.
This is ready for prime time.
bugwash: merge