mirror of
https://github.com/samba-team/samba.git
synced 2025-03-24 10:50:22 +03:00
ctdbd: Avoid unnecessary updateip event
The existing code makes one fatally bad assumption: vnn->iface->references can never be -1 (or max-unit32_t in this case). Right now the reference counting is broken so a reference count of -1 is possible and causes a spurious updateip when vnn->iface is the same as best_face. This can occur frequently because we get a lot of redundant takeovers, especially when each IP can only be hosted on one interface. This makes the code much more defensive by noting that when best_iface is the same as vnn->iface there is never a need for an updateip event. This effectively neuters the updateip code path when IPs can only be hosted by a single interface. This should obsolete 6a74515f0a1e24d97cee3ba05d89133aac7ad2b7. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7054e4ded59c6b8f254dcfefaef64da05f25aecd)
This commit is contained in:
parent
a68512c7d8
commit
9aa9abcc19
@ -645,13 +645,13 @@ int32_t ctdb_control_takeover_ip(struct ctdb_context *ctdb,
|
||||
}
|
||||
|
||||
if (vnn->iface) {
|
||||
if (vnn->iface->link_up) {
|
||||
/* only move when the rebalance gains something */
|
||||
if (vnn->iface->references > (best_iface->references + 1)) {
|
||||
if (vnn->iface != best_iface) {
|
||||
if (!vnn->iface->link_up) {
|
||||
do_updateip = true;
|
||||
} else if (vnn->iface->references > (best_iface->references + 1)) {
|
||||
/* only move when the rebalance gains something */
|
||||
do_updateip = true;
|
||||
}
|
||||
} else if (vnn->iface != best_iface) {
|
||||
do_updateip = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user