FATAL: update before replace for cid 2

I’m getting this error quite often on latest official build 0.8.17 with some variations cid 2, 3 or 4. It also happened on versions 0.8.15 and 16. Usually it happens when adding new node to cluster and doing a lot of restarting/configuration editing. I’m testing it on multiple instances with some PCs running windows or linux and raspberry pis running raspbian and it occured on rasp pi’s and linux on amd64, I’m not sure if it happened on windows (don’t remember).

Once the error occurs it results in crash

What can I do to gather some logs and/or relevant debug information? Is there a way to generate memory dumps for later analysis?

I’ve posted some input in github thread https://github.com/calmh/syncthing/issues/344