HomeClusterLabs Projects

totemsrp: Switch totempg buffers at the right time

Description

totemsrp: Switch totempg buffers at the right time

Commit 92e0f9c7bb9b4b6a0da8d64bdf3b2e47ae55b1cc added switching of
totempg buffers in sync phase. But because buffers got switch too early
there was a problem when delivering recovered messages (messages got
corrupted and/or lost). Solution is to switch buffers after recovered
messages got delivered.

I think it is worth to describe complete history with reproducers so it
doesn't get lost.

It all started with 402638929e5045ef520a7339696c687fbed0b31b (more info
about original problem is described in
https://bugzilla.redhat.com/show_bug.cgi?id=820821). This patch
solves problem which is way to be reproduced with following reproducer:

  • 2 nodes
  • Both nodes running corosync and testcpg
  • Pause node 1 (SIGSTOP of corosync)
  • On node 1, send some messages by testcpg (it's not answering but this doesn't matter). Simply hit ENTER key few times is enough)
  • Wait till node 2 detects that node 1 left
  • Unpause node 1 (SIGCONT of corosync)

and on node 1 newly mcasted cpg messages got sent before sync barrier,
so node 2 logs "Unknown node -> we will not deliver message".

Solution was to add switch of totemsrp new messages buffer.

This patch was not enough so new one
(92e0f9c7bb9b4b6a0da8d64bdf3b2e47ae55b1cc) was created. Reproducer of
problem was similar, just cpgverify was used instead of testcpg.
Occasionally when node 1 was unpaused it hang in sync phase because
there was a partial message in totempg buffers. New sync message had
different frag cont so it was thrown away and never delivered.

After many years problem was found which is solved by this patch
(original issue describe in
https://github.com/corosync/corosync/issues/660).
Reproducer is more complex:

  • 2 nodes
  • Node 1 is rate-limited (used script on the hypervisor side): ` iface=tapXXXX
    1. ~0.1MB/s in bit/s rate=838856
    2. 1mb/s burst=1048576 tc qdisc add dev $iface root handle 1: htb default 1 tc class add dev $iface parent 1: classid 1:1 htb rate ${rate}bps \ burst ${burst}b tc qdisc add dev $iface handle ffff: ingress tc filter add dev $iface parent ffff: prio 50 basic police rate \ ${rate}bps burst ${burst}b mtu 64kb "drop" `
  • Node 2 is running corosync and cpgverify
  • Node 1 keeps restarting of corosync and running cpgverify in cycle
    • Console 1: while true; do corosync; sleep 20; \ kill $(pidof corosync); sleep 20; done
    • Console 2: while true; do ./cpgverify;done

And from time to time (reproduced usually in less than 5 minutes)
cpgverify reports corrupted message.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>

Details

Provenance
jfriesseAuthored on Oct 26 2021, 12:17 PM
Parents
rCf6f6f41a87b4: cpghum: Allow to continue if corosync is restarted
Branches
Unknown
Tags
Unknown

Event Timeline