Bug 2001969

Summary: totem: Add cancel_hold_on_retransmit config option [RHEL 7]
Product: Red Hat Enterprise Linux 7 Reporter: Shane Bradley <sbradley>
Component: corosyncAssignee: Jan Friesse <jfriesse>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.9CC: ccaulfie, cfeist, cherrylegler, cluster-maint, jfriesse, jreznik, jwboyer, mjuricek, nwahl, phagara, sbradley
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: corosync-2.4.5-7.el7_9.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2002115 (view as bug list) Environment:
Last Closed: 2021-11-23 17:15:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shane Bradley 2021-09-07 15:02:18 UTC
Description of problem:
A customer has requested the following commit be included from corosync:
  - totem: Add cancel_hold_on_retransmit config option 
    https://github.com/corosync/corosync/pull/653


Version-Release number of selected component (if applicable):
corosync - latest

How reproducible:
N/A

Steps to Reproduce:
N/A

Actual results:
Customers wants to avoid so many 'FAILED TO RECEIVE' error during Corosync retransmits.

Expected results:
Significantly avoid the 'FAILED TO RECEIVE' error during Corosync retransmits.

Additional info:

This request is for RHEL 7.9.z from the customer: 03023616

Related comment:
  - Corosync retransmit messages · Issue #622 · corosync/corosync 
    https://github.com/corosync/corosync/issues/622#issuecomment-903513295

Comment 5 Reid Wahl 2021-09-08 00:44:32 UTC
Our partner Cherry at Google requested z-stream releases for RHEL 7.7 and 7.9.

If it's feasible to do so, it might make sense to ship z-streams for RHEL 7.4 and 7.6. AFAIK (this information may no longer be up-to-date), RHEL 7.4 and 7.6 are still covered under EUS for SAP HA.

Comment 6 Jan Friesse 2021-09-08 07:31:35 UTC
I don't recommend to include patch in RHEL 7.4 and 7.6. There were big changes in totemconfig.c so patch is not applicable there cleanly (without making big patch). Even 7.7 is a bit problematic, but doable.

Comment 7 Reid Wahl 2021-09-08 07:34:27 UTC
(In reply to Jan Friesse from comment #6)
> I don't recommend to include patch in RHEL 7.4 and 7.6. There were big
> changes in totemconfig.c so patch is not applicable there cleanly (without
> making big patch). Even 7.7 is a bit problematic, but doable.

In that case I agree that it's not worth the trouble.

Comment 8 Jan Friesse 2021-09-13 09:39:42 UTC
I had to correct my statement. 7.7 seems to be more or less equally problematic as 7.6, so we can either have big patch for both 7.6 and 7.7, or vanilla upstream patch, but only for 7.9 (this is preferred by me).

Comment 9 Jan Friesse 2021-09-13 09:46:12 UTC
Scratch build with patch (7.9.z) http://brew-task-repos.usersys.redhat.com/repos/scratch/jfriesse/corosync/2.4.5/7.el7_9.2/

Comment 10 Jan Friesse 2021-09-15 14:33:29 UTC
For QA:
What I've tested/checked:
- There is new option totem.cancel_token_hold_on_retransmit
  - Described in corosync.conf man page
  - Current value exported as runtime.config.totem.cancel_token_hold_on_retransmit
  - Default value is "no". When set to "yes" behavior of corosync is same as before patch
- One (or more) nodes are delaying larger packets (I was using following script):
```
#!/bin/bash

iptables -t mangle -A POSTROUTING \
  -p udp -s $SOURCE_IP \
  -m length --length 1000:2000 -j MARK --set-mark 10

iptables -t mangle -L

tc qdisc add dev $SOURCE_DEV root handle 1: prio priomap 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
tc qdisc add dev $SOURCE_DEV parent 1:1 handle 2: netem delay 1000ms
```
- Running two nodes
- Send one larger message using cpg-load (https://github.com/jfriesse/csts/blob/master/apps/cpg-load.c)
```
./cpg-load -m 1 -n 1 -L 1500 -l 1500
```
- Without patch (or cancel_token_hold_on_retransmit set to "yes") corosync ends with "FAILED TO RECEIVE" and reforming cluster
- With patch corosync slows resending packets after a while and packet is delivered after delay (for above example 1000 ms)
- When running continuous load (`/cpg-load -n 1 -L 1500 -l 1500`) corosync slows down, but messages are delivered (with delay) and membership keeps stable
- After removal of netem/iptables rules corosync returns back to full speed
- For more than two nodes cluster "FAILED TO RECEIVE" wasn't happening regularly, but network was overloaded by resended messages. This shouldn't be happening with patch.

More information can be found in upstream GH issue - https://github.com/corosync/corosync/issues/622

Comment 19 errata-xmlrpc 2021-11-23 17:15:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (corosync bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4787