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)
Oct 4 2024, 1:43 AM
Unknown Object (File)
Sep 29 2024, 7:27 PM
Unknown Object (File)
Sep 29 2024, 3:38 PM
Unknown Object (File)
Sep 22 2024, 2:30 AM
Unknown Object (File)
Sep 16 2024, 5:42 PM
Unknown Object (File)
Sep 15 2024, 5:52 PM
Unknown Object (File)
Sep 14 2024, 9:19 PM
Unknown Object (File)
Sep 10 2024, 1:04 AM

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 Warnings
SeverityLocationCodeMessage
Warningtests/sys/netinet/carp.sh:CHMOD1Invalid Executable
Unit
No Test Coverage
Build Status
Buildable 50444
Build 47335: arc lint + arc unit

Event Timeline

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

What is the purpose of the sleep?

tests/sys/netinet/carp.sh
403

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
403

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
398

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 ?

403

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.