Page MenuHomeFreeBSD

carp tests: test manually switch between backup and master
ClosedPublic

Authored by kp on Mar 16 2023, 11:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 17 2024, 5:50 AM
Unknown Object (File)
Mar 14 2024, 3:36 AM
Unknown Object (File)
Dec 13 2023, 12:09 AM
Unknown Object (File)
Nov 18 2023, 8:03 PM
Unknown Object (File)
Nov 11 2023, 11:55 AM
Unknown Object (File)
Nov 9 2023, 1:21 AM
Unknown Object (File)
Nov 1 2023, 2:57 PM
Unknown Object (File)
Oct 30 2023, 8:17 PM

Details

Summary

There's been at least one issue where we failed to correctly enter
NET_EPOCH that was triggered in this scenario.
Add a test case for it to make it easier to detect issues like this in
the future.

Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kp requested review of this revision.Mar 16 2023, 11:02 AM
tests/sys/netinet/carp.sh
284

What is the purpose of the sleep?

tests/sys/netinet/carp.sh
284

Carp sends packets on a timeout, and this gives it a bit of time for that timer to actually fire and send packets.
We probably don't need it, I mostly have it because Zhenlei's example in https://reviews.freebsd.org/D39113 had it.

tests/sys/netinet/carp.sh
284

I don't think you should include it, unless there's something that you verify after the sleep. Like, poll until you can tell that the timer expired and sent packets.

tests/sys/netinet/carp.sh
279

Well it is a little interesting here.
Without this ifconfig ${epair}a up the virtual host state keep stuck with INIT .

Is it a known bug or feature ?

284

The test script in https://reviews.freebsd.org/D39113 is focusing on testing forced state change, due to the design (and current implementation) of CARP protocol, on ifconfig state master packets (carp / arp / nd) are sent out immediately, so actually no sleep required.

due to the design (and current implementation) of CARP protocol, on ifconfig state master packets (carp / arp / nd) are sent out immediately, so actually no sleep required.

Before I checked carefully the design of CARP protocol, I thought there's a little gap between carp packets and arp / nd packets. I thought the competitor should not send arp / nd packets until it actually become MASTER.

That is by intuition, but is not true (for CARP protocol).

The switch_body() part looks good to me.

This revision is now accepted and ready to land.Mar 17 2023, 4:35 PM
This revision was landed with ongoing or failed builds.Mar 20 2023, 10:18 AM
This revision was automatically updated to reflect the committed changes.