FreeBSD Bugzilla – Attachment 229121 Details for
Bug 259528
[carp] Backup node becomes second active master when master have some negative demotion values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
reproduction.sh
file_259528.txt (text/plain), 1.75 KB, created by
Marius Halden
on 2021-10-29 12:58:37 UTC
(
hide
)
Description:
reproduction.sh
Filename:
MIME Type:
Creator:
Marius Halden
Created:
2021-10-29 12:58:37 UTC
Size:
1.75 KB
patch
obsolete
>#!/bin/sh > >set -eu > >carp_demote_magic=1 > >create_jail() { > local jname=$1 > local if=$2 > local ip=$3 > local advskew=$4 > > local cmd="sysctl net.inet.carp.preempt=1 >/dev/null ; ifconfig ${if} inet 10.10.10.${ip}/24 up ; ifconfig ${if} inet 10.10.10.1/24 alias vhid 1 advskew ${advskew} pass foobar" > > printf "Staring jail %s" "${jname}" > jail -c name=${jname} path=/ host.hostname=${jname} vnet vnet.interface=${if} persist exec.start="/bin/sh -c '${cmd}'" > echo "." >} > >print_status() { > printf "carp1 status: " > jexec carp1 ifconfig $e1b | grep carp: | awk '{print $2}' > printf "carp2 status: " > jexec carp2 ifconfig $e2b | grep carp: | awk '{print $2}' >} > >cleanup() { > printf "Cleaning up" > > jail -R carp1 || : > jail -R carp2 || : > ifconfig $br destroy || : > ifconfig $e1a destroy || : > ifconfig $e2a destroy || : > > echo "." >} > >wait() { > local time=$1 > shift > local msg="$@" > > printf "%s" "$msg" > > while [ $time -gt 0 ] ; do > printf "." > > time=$((time - 1)) > sleep 1 > done > > echo >} > >trap cleanup EXIT INT TERM > >br=$(ifconfig bridge create) >e1a=$(ifconfig epair create) >e2a=$(ifconfig epair create) >e1b=${e1a%%a}b >e2b=${e2a%%a}b > >ifconfig $br addm $e1a addm $e2a up >ifconfig $e1a up >ifconfig $e2a up > >create_jail carp1 $e1b 253 0 >create_jail carp2 $e2b 254 100 > >echo >wait 3 "Waiting for things to settle" >echo >print_status > >echo >echo "decreasing carp demotion in carp1 jail" >jexec carp1 sysctl net.inet.carp.demotion=-${carp_demote_magic} > >echo >wait 3 "Waiting for things to settle" >echo >print_status > >echo >echo "increasing carp demotion in carp1 jail" >jexec carp1 sysctl net.inet.carp.demotion=${carp_demote_magic} > >echo >wait 3 "Waiting for things to settle" >echo >print_status >echo
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 259528
: 229121 |
229122