praefect: Fix incorrect error tracking for secondaries
We use nodeErrors
to track secondary errors of transaction involving RPCs, but there is a bug that the ErrHandler
of each secondary is sharing the same variable secondary
from the for-range loop. Thus we would always mark (and only mark) the last secondary error once there are any secondary errors. And what we would get from getUpdatedAndOutdatedSecondaries
later is probably wrong.
We can fix this by creating a new variable with the same name in for-range loop.
The bug is straightforward but it's better to have some tests proving this. I tried to add some related tests but it's kind of complicated for me and I may not get enough time working on this. Any help is welcome to make some enhancement.