Page MenuHomeFreeBSD

carp: deal with negative net.inet.carp.demotion
ClosedPublic

Authored by kp on Oct 31 2021, 9:24 PM.
Tags
None
Referenced Files
F137150653: D32759.id97775.diff
Fri, Nov 21, 6:58 AM
F137083654: D32759.id97775.diff
Fri, Nov 21, 2:53 AM
F137076876: D32759.id97813.diff
Fri, Nov 21, 2:35 AM
F137076117: D32759.id.diff
Fri, Nov 21, 2:33 AM
F137075486: D32759.diff
Fri, Nov 21, 2:30 AM
Unknown Object (File)
Wed, Nov 5, 8:57 PM
Unknown Object (File)
Wed, Nov 5, 3:14 PM
Unknown Object (File)
Wed, Nov 5, 9:02 AM

Details

Summary

Given nodes 1 and 2, where node 1 has an advskew of 0 and node 2 has an
advskew of 100, making them master and backup respectively.

If net.inet.carp.demotion is set to a negative value on node 1, node 2
might become master while node 1 still retains it master status. Wether
or not node 2 becomes master seems to depend on the nodes advskew and
what the demotion sysctl was set to on node 1.

The reason for node 2 becoming master seems to be that the calculated
advskew taking demotion into account is truncated to a single unsigned
byte when copied into the carp header for sending, and node 1 stays
master since it takes uses the whole non-truncated calculated advskew
when deciding wether to stay master.

PR: 259528
Submitted by: marius.halden@modirum.com
MFC after: 3 weeks
Sponsored by: Modirum MDPay

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42477
Build 39365: arc lint + arc unit

Event Timeline

kp requested review of this revision.Oct 31 2021, 9:24 PM
kp added a child revision: D32760: carp tests: negative demotion.
donner added a subscriber: donner.

Because both types are "int", the calculation does work.
Good catch!

This revision is now accepted and ready to land.Nov 1 2021, 12:46 PM

Good catch!

All bla^W credit to Marius.

This revision was automatically updated to reflect the committed changes.