summaryrefslogtreecommitdiff
path: root/ctdb/server/ipalloc.c
AgeCommit message (Collapse)AuthorFilesLines
2022-05-14ctdb: Covscan: unchecked return value for trbt_traversearray32()Pavel Filipenský1-1/+6
Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-06-05ctdb-ipalloc: Avoid -1 as a PNN, use CTDB_UNKNOWN_PNN insteadMartin Schwenke1-3/+3
This fixes warnings about signed versus unsigned comparisons. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2019-06-05ctdb-ipalloc: Fix signed/unsigned comparisons by declaring as unsignedMartin Schwenke1-4/+4
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-07-11ctdb-daemon: Drop the noiphost "node flags" bitmapMartin Schwenke1-33/+0
This is no longer needed because inactive/disabled nodes no longer report any available public IP addresses. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-07-11ctdb-daemon: Drop plumbing for obsolete tunable NoIPHostOnAllDisabledMartin Schwenke1-31/+3
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-07-02ctdb: Fix build on AIXAmitay Isaacs1-2/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-09-19ctdb-build: Split protocol-util as a separate subsystemMartin Schwenke1-1/+1
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-02-24ctdb-ipalloc: Add per-IP known_on bitmapMartin Schwenke1-0/+22
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-02-24ctdb-ipalloc: Switch noiphost to struct bitmapMartin Schwenke1-6/+4
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-02-24ctdb-ipalloc: Switch available_on to struct bitmapMartin Schwenke1-3/+2
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-19ctdb-takeover: NoIPHostOnAllDisabled is global across clusterMartin Schwenke1-17/+11
Instead of gathering the value from all nodes, just use the value on the recovery master and have it affect all nodes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-19ctdb-takeover: NoIPTakeover is global across clusterMartin Schwenke1-15/+2
Instead of gathering the value from all nodes, just use the value on the recovery master and have it affect all nodes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-02ctdb-ipalloc: Optimise check to see if IP is available on a nodeMartin Schwenke1-0/+37
Use a "bitmap" of available IPs for each IP address instead of walking the list of available IP addresses. For ctdb/tests/takeover/lcp2.030.sh, this improves the time taken on my laptop from: real 0m11.997s user 0m11.960s sys 0m0.000s to real 0m8.571s user 0m8.544s sys 0m0.000s So, when assigning all 900 IP addresses the improvement is about 25%. For the no-op case (where all IPs are already assigned to nodes), the extra setup adds a small fraction of a second for 900 IPs. Intermediate cases result in intermediate improvements. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-09-14ctdb-ipalloc: ipalloc_set_public_ips() can't failMartin Schwenke1-3/+1
So make it a void function. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12254 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-09-14ctdb-ipalloc: Move merged IP list creation to ipalloc()Martin Schwenke1-3/+6
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12254 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-09-14ctdb-ipalloc: Drop known_ips argument from merged IP list creationMartin Schwenke1-6/+4
This is available in the IP allocation state. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12254 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-09-14ctdb-ipalloc: Optimise check to see if IPs can be hostedMartin Schwenke1-0/+10
Add an early return if there are no known IP addresses. Also add an extra comment for clarification. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12254 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-09-14ctdb-ipalloc: Whether IPs can be hosted need not depend on merged IP listMartin Schwenke1-7/+11
Merged IP list won't be available here... BUG: https://bugzilla.samba.org/show_bug.cgi?id=12254 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-09-14ctdb-ipalloc: Store known public IPs in IP allocation stateMartin Schwenke1-0/+1
This was dropped because it wasn't used, but it will be needed again. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12254 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-04ctdb-ipalloc: ipalloc() returns public IP listMartin Schwenke1-2/+2
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-04ctdb-ipalloc: Move set_ipflags_internal() to ipallocMartin Schwenke1-0/+64
Rename it ipalloc_set_node_flags(). Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-04ctdb-ipalloc: Move ipalloc state initialisation to ipalloc.cMartin Schwenke1-0/+44
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-04ctdb-ipalloc: Fix buggy short-circuit when no IPs are availableMartin Schwenke1-0/+14
At the moment IP is short-circuited when there are no available IP addresses. However, if some IP addresses are already allocated then "no available IP addresses" means that all the addresses should (probably) be released. The current short-circuit means that no already hosted IP addresses will be released. The short-circuit exists to avoid lots of messages saying that all IP addresses can not be assigned at startup time. So, add a check to ipalloc_can_host_ips() so that it succeeds if IP addresses are already allocated to nodes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-04ctdb-ipalloc: New function ipalloc_can_host_ips()Martin Schwenke1-0/+13
Abstracts out code involving internals of IP allocation state. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-04ctdb-ipalloc: Drop known public IPs from IP allocation stateMartin Schwenke1-5/+6
This is never used in the allocation algorithms. It is only used when building the merged IP list. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-04ctdb-ipalloc: Move create_merged_ip_list() into ipallocMartin Schwenke1-1/+91
How the existing IP layout is constructed and how the merged IP list is sorted are important aspects of the IP allocation algorithm. Construct the merged IP list when known and available IPs are assigned. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-04ctdb-ipalloc: New function ipalloc_set_public_ips()Martin Schwenke1-0/+10
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-01-14ctdb: Fix the O3 developer buildVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-01-13ctdb-ipalloc: Split IP allocation into its own build subsystemMartin Schwenke1-0/+53
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>