ctdb.git
13 years agonew version 1.0.112-42 1.0.112
Ronnie Sahlberg [Mon, 7 Mar 2011 04:09:16 +0000 (15:09 +1100)]
new version 1.0.112-42

13 years agoCTDB_FATAL() try to drop all ip addresses when shutting down through ctdb_fatal()
Ronnie Sahlberg [Mon, 7 Mar 2011 04:05:09 +0000 (15:05 +1100)]
CTDB_FATAL() try to drop all ip addresses when shutting down through ctdb_fatal()

If we shutdown through a ctdb_fatal(), unless there is an external mechanism to trap this and restart ctdb, we will get a duplicate address problem since addresses held on the node remain which collides with the addresses when failed over to other nodes.

During ctdb_fatal(), spawn a child process to try to drop all held public addresses.

13 years agoVACUUMING lmaster check is wrong when nodes are disconnected from the cluster
Ronnie Sahlberg [Mon, 7 Mar 2011 01:50:14 +0000 (12:50 +1100)]
VACUUMING lmaster check is wrong when nodes are disconnected from the cluster

During vacuuming we incorrectly used the size of the VNN map as the range of possible/allowed lmaster values.
This is incorrect if for example one or more of the nodes in the cluster are permanently disconnected and taken out of service.
When this happens, there will be a slow and steady buildup of un-vacuumable records which belong to the last n nodes in the cluster.
Un vacuumnable since the vnn map is smaller than the niumber of nodes and any records belonging to a node with pnn id higher than the size of the vnn map size would always be ignored.

Eventually the cluster would be full of un-vacuumable dead records which would lead to ctdb outages.

Fix the vacuuming logic to use ctdb->num_nodes as the possible range for lmaster values. Fix the other references in the vacuuming to keep ctdb->num_nodes lists of records and not vnnmap->size.

To reproduce, start a 3 node cluster and shutdown node #1 so only node #0 and node #2 are running.
To not have to create unrealistically large number of records, we need to tweak the tunables for vacuuming so vacuuming also triggers for small number of rectords :
onnode all ctdb setvar VacuumLimit 10; onnode all ctdb setvar RepackLimit 10

Use smbtorture to create a large number of dead records in sessionid.tdb :
smbtorture //127.0.0.1/data -U<user>%<password> --num-ops=3000 BASE-BENCH-HOLDCON

Without the patch, many/most records would eventually be vacuumed, but the database would never become completely empty, there would always be a number of records that would hash to node#2 which would never be removed.

With this patch, all records will eventually become vacuumed and the database would become empty.

alternatively, by starting node#1,  the database would also become empty.

The command 'tdbdump /var/ctdb/sessionid.tdb.* | grep data\(24\) | wc -l'
can be used to count how many dead records exist in the database.

CQ S1022203

13 years agoNew version 1.0.112-41
Ronnie Sahlberg [Thu, 3 Mar 2011 19:56:28 +0000 (06:56 +1100)]
New version 1.0.112-41

13 years agoRestart recovery dameon if it looks like it hung.
Ronnie Sahlberg [Thu, 3 Mar 2011 19:55:24 +0000 (06:55 +1100)]
Restart recovery dameon if it looks like it hung.
Dont shutdown ctdbd completely, that only makes the problem worse.

13 years agoSuppress a log message properly
Ronnie Sahlberg [Tue, 1 Mar 2011 17:24:15 +0000 (04:24 +1100)]
Suppress a log message properly

13 years agonew version 1.0.112-40
Ronnie Sahlberg [Tue, 1 Mar 2011 08:42:35 +0000 (19:42 +1100)]
new version 1.0.112-40

13 years agodont log an error if we waitpid but there is no child process to wait for
Ronnie Sahlberg [Tue, 1 Mar 2011 08:41:43 +0000 (19:41 +1100)]
dont log an error if we waitpid but there is no child process to wait for

13 years agoIf/when the recovery daemon terminates unexpectedly, try to restart it again from...
Ronnie Sahlberg [Tue, 1 Mar 2011 01:09:42 +0000 (12:09 +1100)]
If/when the recovery daemon terminates unexpectedly, try to restart it again from the main daemon instead of just shutting down the main deamon too.

While it does not address the reason for recovery daemon shutting down, it reduces the impact of such issues and makes the system more robust.

13 years agore-sync to 1.0.112-39 srpm
Ronnie Sahlberg [Tue, 1 Mar 2011 08:09:52 +0000 (19:09 +1100)]
re-sync to 1.0.112-39 srpm

13 years agoWhen we are no longer the natgw master, dont put the natgw ip on loopback.
Ronnie Sahlberg [Mon, 29 Nov 2010 01:39:14 +0000 (12:39 +1100)]
When we are no longer the natgw master, dont put the natgw ip on loopback.
We put the ip on loopback just to make sure we would still interoperate with
non-standard configurations on unix-KDC, that are configured to verify the optional
HostAddresses field.
This is not required for AD, since AD does not use this field, and is replaced in
unix land with other/better mechanisms than this "dodgy" check.

This makes it "easier" for applications that have bound to the natgw address
to detect a socket problem and try to reconnect/recover if the ip address
is completely missing from the system.

At the same time, use the winbind specific hook that exists to explicitely tell winbindd : this address is gone, so if you have bound to it, this is a good time to close and rebind your socket.

cq 1020333

13 years agonew version -1.0.112-38
Ronnie Sahlberg [Wed, 13 Oct 2010 21:08:52 +0000 (08:08 +1100)]
new version -1.0.112-38

13 years agoTry to restart LOCKD if "service nfslock start" fails.
Ronnie Sahlberg [Wed, 13 Oct 2010 21:06:47 +0000 (08:06 +1100)]
Try to restart LOCKD if "service nfslock start" fails.

Some systems this command occasionally returns [OK] == success
but lock manager fails to start.

Dodgy service scripts.

CQ1020366

13 years agonew version 1.0.112-37
Ronnie Sahlberg [Wed, 13 Oct 2010 03:43:53 +0000 (14:43 +1100)]
new version 1.0.112-37

13 years agoUnconditionally create the state directory in case it has been changed at runtime
Ronnie Sahlberg [Wed, 13 Oct 2010 00:06:30 +0000 (11:06 +1100)]
Unconditionally create the state directory in case it has been changed at runtime

CQS1019937

13 years agoNew version 1.0.112-36
Ronnie Sahlberg [Tue, 5 Oct 2010 04:00:52 +0000 (15:00 +1100)]
New version 1.0.112-36

Updates to ctdb_diagnostics

13 years agoAdd some command-line options to ctdb_diagnostics.
Martin Schwenke [Fri, 6 Aug 2010 01:10:56 +0000 (11:10 +1000)]
Add some command-line options to ctdb_diagnostics.

In some contexts ctdb_diagnostics generates too many errors when it is
run on heterogeneous and machine-configured clusters.  In some
clusters some nodes are expected to be differently configured and also
machine-generated configured files can have comments containing
timestamps.

This adds some command-line options that can be used to reduce the
number of errors reported:

    -n <nodes>  Comma separated list of nodes to operate on
    -c          Ignore comment lines (starting with '#') in file comparisons
    -w          Ignore whitespace in file comparisons
    --no-ads    Do not use commands that assume an Active Directory Server

The -n option simply allows ctdb_diagnostics to operate on a subset of
nodes, avoiding file comparisons with and data collection on nodes
that are differently configured.  For file comparisons, instead of
showing each file on the current node and then comparing other nodes
to that file, the file from the first (available or requested) nodes
is shown and then other nodes are compared to that.  That has resulted
in changes in output - that is, ctdb diagnostics no longer prints
messages referencing the current node.

-c and -w are used to weaken comparisons between configuration files.

--no-ads can be used to avoid running ADS-specific commands if a
cluster uses LDAP (or other non-ADS) configuration.

This also fixes a number of bugs in related code:

* A call to onnode was losing the >> NODE ...  << lines because they
  now go to stderr.  This was changed in onnode long ago but
  ctdb_diagnostics was never updated to match.

* ctdb_diagnostics was counting lines in /etc/ctdb/nodes to determine
  what nodes to operate on.  For some time the nodes file has
  supported syntax that makes this invalid.  "ctdb listnodes -Y" is
  now used to list available nodes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoNew version 1.0.112-35
Ronnie Sahlberg [Thu, 30 Sep 2010 20:47:54 +0000 (06:47 +1000)]
New version 1.0.112-35

* Fri Oct 1 2010 : Version 1.0.112-35
 - Fix futex hang during eventscript timeout
 - Fix a crash when printing a log message during shutdown

13 years agoWhen memory allocations for recovery fails,
Ronnie Sahlberg [Fri, 3 Sep 2010 01:58:27 +0000 (11:58 +1000)]
When memory allocations for recovery fails,
dont dereference a null pointer while trying to print the log message for the failure.

also shutdown ctdb with ctdb_fatal()

13 years agoeventscript: make sure we die when we timeout.
Rusty Russell [Thu, 2 Sep 2010 03:14:21 +0000 (12:44 +0930)]
eventscript: make sure we die when we timeout.

Volker noticed that system() can hang on a futex: we do this inside a
signal handler simply to dump extra diagnostics when we timeout, which is
very questionable but usually works.

Add a timeout of 90 seconds: after that, commit suicide.
(This is a workaround for this branch: master does this correctly).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agonew version 1.0.112-34
Ronnie Sahlberg [Tue, 24 Aug 2010 00:23:38 +0000 (10:23 +1000)]
new version 1.0.112-34

13 years agoRevert "add some extra debugging statements to the client side code sending controls"
Ronnie Sahlberg [Tue, 24 Aug 2010 00:22:17 +0000 (10:22 +1000)]
Revert "add some extra debugging statements to the client side code sending controls"

This reverts commit 1d1d475d7e18620330aaee95038c40b27e5496d4.

13 years ago On RHEL, "service nfs stop;service nfs start" and "service nfs restart"
Ronnie Sahlberg [Wed, 18 Aug 2010 21:18:22 +0000 (07:18 +1000)]
On RHEL,    "service nfs stop;service nfs start"  and "service nfs restart"
    sometimes (very rarely) fails to restart the service.

    Add a function to restart NFSd on SLES and RHEL-like systems.

    If we detect the system is unhealthy due to kNFSd not running,
    try to restart the service again "service nfs restart" and
    hope for the best.

CQ1019372

13 years agoadd some extra debugging statements to the client side code sending controls
Ronnie Sahlberg [Wed, 11 Aug 2010 04:42:44 +0000 (14:42 +1000)]
add some extra debugging statements to the client side code sending controls
and failing. in particular the GETRECMASTER control

13 years agoNew version 1.0.112-33
Ronnie Sahlberg [Wed, 11 Aug 2010 02:46:33 +0000 (12:46 +1000)]
New version 1.0.112-33

13 years agoAdd a new event :ipreallocated"
Ronnie Sahlberg [Wed, 11 Aug 2010 02:37:51 +0000 (12:37 +1000)]
Add a new event :ipreallocated"
This is called everytime a reallocation is performed.

While STARTRECOVERY/RECOVERED events are only called when
we do ipreallocation as part of a full database/cluster recovery,
this new event can be used to trigger on when we just do a light
failover due to a node becomming unhealthy.

I.e. situations where we do a failover but we do not perform a full
cluster recovery.

Use this to trigger for natgw so we select a new natgw master node
when failover happens and not just when cluster rebuilds happen.

13 years agonew version 1.0.112-32
Ronnie Sahlberg [Tue, 10 Aug 2010 03:56:02 +0000 (13:56 +1000)]
new version 1.0.112-32

 Tue Aug 10 2010 : Version 1.0.112-32
 - Dont check if natgw is enabled or not in the natgw script
 - disable the check if winbind is ok
 - optimize 61.nfstickles
 - fix a fd leak from the abort-vacuuming patch

13 years agoskip the check if NATGW is enabled.
Ronnie Sahlberg [Tue, 10 Aug 2010 03:53:18 +0000 (13:53 +1000)]
skip the check if NATGW is enabled.

many users use natgw incorrectly with invalid configurations.
It is easier to skip this check here

13 years agodisable the check that winbind works or not for now
Ronnie Sahlberg [Mon, 9 Aug 2010 02:29:39 +0000 (12:29 +1000)]
disable the check that winbind works or not for now

13 years agoOptimise 61.nfstickle to write the tickles more efficiently.
Martin Schwenke [Mon, 26 Jul 2010 06:22:59 +0000 (16:22 +1000)]
Optimise 61.nfstickle to write the tickles more efficiently.

Currently the file for each IP address is reopened to append the
details of each source socket.

This optimisation puts all the logic into awk, including the matching
of output lines from netstat.  The source sockets for each for each
destination IP are written into an array entry and then each array
entry is written to the corresponding file in a single operation.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoRevert "For deterministic IPs, check if the designated node can host the ip before"
Ronnie Sahlberg [Thu, 5 Aug 2010 05:41:35 +0000 (15:41 +1000)]
Revert "For deterministic IPs, check if the designated node can host the ip before"

This reverts commit 5e60aad0e19cabb29c3be191698e10049da151c7.

This change lowers the "flapping" but at the expense of less balance.
Keeping the system balancved is likely better than minimizing the amount of flapping
for this configuration

13 years agovacuum: close fd leak
Rusty Russell [Wed, 4 Aug 2010 22:31:55 +0000 (08:01 +0930)]
vacuum: close fd leak

Commit 517f05e42f17766b1e8db8f1f4789cbad968e304 "freeze: abort vacuuming
when we're going to freeze." introduced a file descriptor leak, because
the abortfd used to talk to the child wasn't closed.

Do this in the destructor.

CQ:S1019190
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agoNew version 1.0.112-31
Ronnie Sahlberg [Tue, 3 Aug 2010 05:42:25 +0000 (15:42 +1000)]
New version 1.0.112-31

 - Retry the vacuum abort code.
 - Add codestyle doc
 - When rebalancing ip addresses, increase number of iterations from 5
 - When using deterministic ips, dont force ips without home address
   to move back.

13 years agoFor deterministic IPs, check if the designated node can host the ip before
Ronnie Sahlberg [Tue, 3 Aug 2010 04:12:17 +0000 (14:12 +1000)]
For deterministic IPs, check if the designated node can host the ip before
we try to reassign it back to the home node.

If it can not, of if it is unknown, just leave the ip where it is.

This reduces the amount of "flapping" an ip address with no home node
does during recoveries.

13 years agoWhen trying to re-balance the ip assignment and shuffle ips from
Ronnie Sahlberg [Tue, 3 Aug 2010 03:34:27 +0000 (13:34 +1000)]
When trying to re-balance the ip assignment and shuffle ips from
nodes with many addresses to nodes with few addresses,
loop up to num_ips+5 times instead of only 5 times.

When we have very many public ips per node, we might need to loop more than
5 times or else we will exit without reaching optimal balance.

13 years agoAdd a code-style document.
Ronnie Sahlberg [Fri, 30 Jul 2010 06:37:22 +0000 (16:37 +1000)]
Add a code-style document.

Shamelessly sto^H^H^Hborrowed from samba3.

13 years agoadd back the vacuum crash bug in the childprocess
Ronnie Sahlberg [Fri, 30 Jul 2010 06:42:17 +0000 (16:42 +1000)]
add back the vacuum crash bug in the childprocess
that got lost in the "new release" commit.

13 years agoNew version : 1.0.112-30
Ronnie Sahlberg [Mon, 26 Jul 2010 06:52:36 +0000 (16:52 +1000)]
New version : 1.0.112-30

13 years agoMerge commit 'rusty/1.0.112' into 1.0.112
Ronnie sahlberg [Mon, 26 Jul 2010 06:49:16 +0000 (16:49 +1000)]
Merge commit 'rusty/1.0.112' into 1.0.112

13 years agovacuum: fix crash on vacuum abort
Rusty Russell [Mon, 26 Jul 2010 06:38:07 +0000 (16:08 +0930)]
vacuum: fix crash on vacuum abort

Martin Schwenke discovered that 517f05e42f17766b1e8db8f1f4789cbad968e304
("freeze: abort vacuuming when we're going to freeze.") used ctdb_db for
a logging message which is in fact uninitialized, causing a crash (even
if it wasn't actually logged).

Initialize it properly.  Also fix incorrect format in another logging
message introduced in that same change.

CQ:S1019093
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agoNew version 1.0.112-29
Ronnie Sahlberg [Mon, 26 Jul 2010 05:26:33 +0000 (15:26 +1000)]
New version 1.0.112-29

 - Fix for a SEGV that can happen when tcp tickles fail/timeout
   CQ:S1019041

13 years agotakeover: prevent crash by avoiding free in traverse on RST timeout
Rusty Russell [Mon, 26 Jul 2010 04:28:48 +0000 (13:58 +0930)]
takeover: prevent crash by avoiding free in traverse on RST timeout

After 5 attempts to send a RST to a client without any response, we free
"con"; this is done during a traverse.  This frees the node we are walking
through (the node is made a child of "con" down in rb_tree.c's
trbt_create_node() (Valgrind would catch this, as Martin confirmed).

So, we create a temporary parent and reparent onto that; then we free
that parent after the traverse, thus deleting the unwanted nodes.

CQ:S1019041
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agoNew version 1.0.112-28
Rusty Russell [Wed, 21 Jul 2010 07:51:09 +0000 (17:21 +0930)]
New version 1.0.112-28

13 years agoRevert "Make deterministic ips off by the default."
Rusty Russell [Wed, 21 Jul 2010 07:49:34 +0000 (17:19 +0930)]
Revert "Make deterministic ips off by the default."

This reverts commit 09d5dc94930a1349bb74b5557a4e71144ad525a4.

We decided more review is needed, and we should not change this
for 1.0.112.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agoNew version 1.0.112-27
Rusty Russell [Wed, 21 Jul 2010 03:03:17 +0000 (12:33 +0930)]
New version 1.0.112-27

13 years agoMake deterministic ips off by the default.
Rusty Russell [Wed, 21 Jul 2010 03:09:04 +0000 (12:39 +0930)]
Make deterministic ips off by the default.

The git log makes it clear that it's mainly useful for debugging; we
should turn it off in production to minimize IP address movement.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agofreeze: abort vacuuming when we're going to freeze.
Rusty Russell [Wed, 21 Jul 2010 02:59:55 +0000 (12:29 +0930)]
freeze: abort vacuuming when we're going to freeze.

There are some reports of freeze timeouts, and it looks like vacuuming might
be the culprit.  So we add code to tell them to abort when a freeze is
going on.

CQ:S1018154 & S1018349
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agovacuum: disabling vacuuming during a freeze
Rusty Russell [Wed, 21 Jul 2010 02:58:04 +0000 (12:28 +0930)]
vacuum: disabling vacuuming during a freeze

We shouldn't even think about vacuuming when we've frozen the database
(which is earlier than when we set CTDB_RECOVERY_ACTIVE)

CQ:S1018154 & S1018349
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agologging: give a unique logging name to each forked child.
Rusty Russell [Mon, 19 Jul 2010 09:59:09 +0000 (19:29 +0930)]
logging: give a unique logging name to each forked child.

This means we can distinguish which child is logging, esp. via syslog where we have no pid.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agoNew version 1.0.112-26
Rusty Russell [Thu, 15 Jul 2010 08:13:46 +0000 (17:43 +0930)]
New version 1.0.112-26

13 years agoconfig: wrap iptables in flock to avoid concurrancy.
Rusty Russell [Mon, 12 Jul 2010 05:41:42 +0000 (15:11 +0930)]
config: wrap iptables in flock to avoid concurrancy.

When doing a releaseip event, we do them in parallel for all the separate
IPs.  This creates a problem for iptables, which isn't reentrant, giving
the strange message:
iptables encountered unknown error "18446744073709551615" while initializing table "filter"

The worst possible symptom of this is that releaseip won't remove the rule
which prevents us listening to clients during releaseip, and the node will be
healthy but non-responsive.

The simple workaround is to flock-wrap iptables.  Better would be to rework
the code so we didn't need to use iptables in these paths.

CQ:S1018353
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agoNew version 1.0.112-25
Rusty Russell [Tue, 6 Jul 2010 08:03:00 +0000 (17:33 +0930)]
New version 1.0.112-25
* Tue Jul 6 2010 : Version 1.0.112-25
 - natgw firewall fix
   BZ62613

13 years agoMove NAT gateway firewall rules to recovered|updatenatgw events.
Martin Schwenke [Tue, 6 Jul 2010 07:54:43 +0000 (17:54 +1000)]
Move NAT gateway firewall rules to recovered|updatenatgw events.

The existing code wasn't working as designed in the start event.  It
should work here.

BZ: 62613
Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoNew version 1.0.112-24
Rusty Russell [Mon, 5 Jul 2010 02:44:06 +0000 (12:14 +0930)]
New version 1.0.112-24

* Mon Jul 5 2010 : Version 1.0.112-24
 - Extra logging on tdb_chainunlock failures.
 - Extra sanity check in ctdb_become_dmaster
   BZ65158
 - More robustness against IDR wrap
   BZ65158
 - Recovery failure under stress fix
   BZ:65158

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agoctdb_freeze: extend db priority hack to cover serverid.tdb deadlock.
Rusty Russell [Thu, 1 Jul 2010 11:46:55 +0000 (21:46 +1000)]
ctdb_freeze: extend db priority hack to cover serverid.tdb deadlock.

We discovered that recent smbd locks the serverid tdb while
holding a lock on another tdb (locking.tdb):
  7: POSIX  ADVISORY  WRITE smbd-2224318 locking.tdb.0 10600 10600
  22: -> POSIX  ADVISORY  READ  smbd-2224318 serverid.tdb.0 26580 26580

The result is a deadlock against the ctdb_freeze code called for
recovery.  We extend the "notify" workaround to this case, too.

BZ:65158
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agoWrap the IDR early, but not too early.
Ronnie Sahlberg [Thu, 10 Jun 2010 04:30:38 +0000 (14:30 +1000)]
Wrap the IDR early, but not too early.

We dont want it to wrap almost immediately so that basically all "ctdb ..."
commands log the "Reqid wrap" warning.

13 years agoDelay reusing ids to make protocol more robust
Rusty Russell [Wed, 9 Jun 2010 23:28:55 +0000 (08:58 +0930)]
Delay reusing ids to make protocol more robust

Ronnie and I tracked down a bug which seems to be caused by a node
running so slowly that we timed out the request and reused the request
id before it responded.

The result was that we unlocked the wrong record, leading to the
following:

ctdbd: tdb_unlock: count is 0
ctdbd: tdb_chainunlock failed
smbd[1630912]: [2010/06/08 15:32:28.251716,  0] lib/util_sock.c:1491(get_peer_addr_internal)
ctdbd: Could not find idr:43
ctdbd: server/ctdb_call.c:492 reqid 43 not found

This exact problem is now detected, but in general we want to delay
id reuse as long as possible to make our system more robust.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agoidtree: fix handling of large ids (eg INT_MAX)
Rusty Russell [Wed, 9 Jun 2010 23:25:56 +0000 (08:55 +0930)]
idtree: fix handling of large ids (eg INT_MAX)

Since idtree assigns sequentially, it rarely reaches high numbers.
But such numbers can be forced with idr_get_new_above(), and that
reveals two bugs:
1) Crash in sub_remove() caused by pa array being too short.
2) Shift by more than 32 in _idr_find(), which is undefined, causing
   the "outside the current tree" optimization to misfire and return NULL.

Signed-off-by: Rusty Russell <rusty@rustorp.com.au>
13 years agofix a debug message
Ronnie Sahlberg [Wed, 9 Jun 2010 06:22:01 +0000 (16:22 +1000)]
fix a debug message

13 years agoidr can timeout and wrap/be reused quite quickly.
Ronnie Sahlberg [Wed, 9 Jun 2010 06:12:36 +0000 (16:12 +1000)]
idr can timeout and wrap/be reused quite quickly.

If a noremote node hangs for an extended period, it is possible
that we might have a DMASTER request in flight for record A to that node.
Eventually we will reuse the idr, and may reuse it for a DMASTER request to a different node for a different record B.

If while the request for B is in flight,  the first tnode un-hangs and responds back
we would receive a dmaster reply for the wrong record.

This would cause a record to become perpetually locked, since inside the daemon we would tdb_chainlock(dmaster_reply->pdu->key)   but once the migration would complete we would chainunlock   idr->state->call->key

Adding code to verify that when we receive a dmaster reply packet that it does in fact match the exact same key that the state variable we have for the idr in flight.

13 years agoWe can not be holding a chainlock at this stage, so the tdb_chainunlock() call is...
Ronnie Sahlberg [Wed, 9 Jun 2010 05:12:26 +0000 (15:12 +1000)]
We can not be holding a chainlock at this stage, so the tdb_chainunlock() call is bogus

( a child process might be holding the lock, but not the main daemon)

13 years agoadd extra logging for failed ctdb_ltdb_unlock() for a few more places
Ronnie Sahlberg [Wed, 9 Jun 2010 04:31:05 +0000 (14:31 +1000)]
add extra logging for failed ctdb_ltdb_unlock() for a few more places
it is called from

13 years agoadd additional logging when tdb_chainunlock() fails
Ronnie Sahlberg [Wed, 9 Jun 2010 04:17:35 +0000 (14:17 +1000)]
add additional logging when tdb_chainunlock() fails
so we can see where it was called from when it fails

13 years agoprint the db name qwhen a chainunlock fails too
Ronnie Sahlberg [Wed, 9 Jun 2010 03:54:10 +0000 (13:54 +1000)]
print the db name qwhen a chainunlock fails too

13 years agowhen tdb_chainunlock() fails, print the tdb error that occured
Ronnie Sahlberg [Wed, 9 Jun 2010 03:52:22 +0000 (13:52 +1000)]
when tdb_chainunlock() fails, print the tdb error that occured

13 years agoNew version 1.0.112-23
Ronnie Sahlberg [Tue, 8 Jun 2010 02:17:01 +0000 (12:17 +1000)]
New version 1.0.112-23

* Tue Jun 8 2010 : Version 1.0.112-23
 - Fix a SEGV that can be triggered by "ctdb delip"
   BZ 62783
 - Add iptables filters to stop clients from connecting to the NATGW
   address.
   BZ62613
 - Add timestamps to the ctdb statistics output
 - Change "ctdb addip" to block until the address is active
   BZ63191
 - Add additional log messages when tdbs can no longer be locked/chain
   unlocked
   BZ64688

13 years agoAdditional log messages when tdb databases can no longer be chainlocked or chainunlocked
Ronnie Sahlberg [Tue, 8 Jun 2010 02:09:19 +0000 (12:09 +1000)]
Additional log messages when tdb databases can no longer be chainlocked or chainunlocked

BZ64688

13 years agochange the addip command to wait until the ip address is taken by the proper node
Ronnie Sahlberg [Mon, 7 Jun 2010 04:26:08 +0000 (14:26 +1000)]
change the addip command to wait until the ip address is taken by the proper node

BZ63191

13 years agoWhen we say "current time of statistics" in the "ctdb statistics" output,
Ronnie Sahlberg [Wed, 2 Jun 2010 07:06:14 +0000 (17:06 +1000)]
When we say "current time of statistics" in the "ctdb statistics" output,
print the current time and not the start time

13 years agoAdd a variable for start/current time to ctdb statistics
Ronnie Sahlberg [Wed, 2 Jun 2010 03:13:09 +0000 (13:13 +1000)]
Add a variable for start/current time to ctdb statistics
and print the time startistics was taken and for how long the statistics have been collected to the "ctdb statistics" output.

13 years ago Prevent clients from connecting to the natgw address.
Ronnie Sahlberg [Wed, 2 Jun 2010 02:47:01 +0000 (12:47 +1000)]
Prevent clients from connecting to the natgw address.
    This address is dedicated for outgoing connections.

    BZ62613

13 years agoFrom rusty
Ronnie Sahlberg [Wed, 26 May 2010 03:38:12 +0000 (13:38 +1000)]
From rusty
Fix a SEGV that could happend when deleting a public ip.

BZ62783

13 years agonew version 1.0.112-22
Ronnie Sahlberg [Mon, 24 May 2010 05:20:39 +0000 (15:20 +1000)]
new version 1.0.112-22

+* Mon May 24 2010 : Version 1.0.112-22
+ - Fix bug in 62.cnfs to allow exports that are quoted.
+ - Add monitoring og Quorum for the 62.cnfs script
+ - Allow restoredb to restore a backup to to a different database

13 years agoEnhance the "ctdb restoredb" command so you can restore a backup into a different...
Ronnie Sahlberg [Thu, 20 May 2010 01:26:37 +0000 (11:26 +1000)]
Enhance the "ctdb restoredb" command so you can restore a backup into a different database.

13 years agoAdd monitoring of quorum and make the node UNHEALTHY when quarum is lost
Ronnie Sahlberg [Mon, 24 May 2010 02:33:47 +0000 (12:33 +1000)]
Add monitoring of quorum and make the node UNHEALTHY when quarum is lost

13 years agoin 62.cnfs, lines in /etc/exports can have hte exports quoted,
Ronnie Sahlberg [Sun, 23 May 2010 23:51:52 +0000 (09:51 +1000)]
in 62.cnfs, lines in /etc/exports can have hte exports quoted,
so strip off any initial " on the exports line

13 years agoNew version 1.0.112-21
Ronnie Sahlberg [Fri, 21 May 2010 04:32:18 +0000 (14:32 +1000)]
New version 1.0.112-21

* Fri May 21 2010 : Version 1.0.112-21
 - Fix a bug where we would fail to remove the natgw configuration
   and would leave a ip address for natgw still remaining on loopback.
   BZ 58317
 - In the ctdb command line tool, we do not wait long enough for the ipreallocate
   command to finish on the recovery daemon. which sometimes would timeout if the
   recovery daemon was busy, or we had rolling recoveries.
   BZ 61783
 - During failed recoveries we could get in a state where recovery attempts stopped
   while database priority level 2 or 3 remain frozen.
   BZ 63951

13 years agoIt was possible for ->recovery_mode to get out of sync with the new three db prioriti...
Ronnie Sahlberg [Fri, 21 May 2010 04:25:47 +0000 (14:25 +1000)]
It was possible for ->recovery_mode to get out of sync with the new three db priorities in such a way that
->recovery_mode was set to normal   but database priorities leven2 or 3 was still set to frozen.

causing the recovery daemon to fail to detect that a recovery was needed to recover access to the database.

BZ63951

13 years agoIn control_ipreallocate() we wait at most 5 tries before aborting the command
Ronnie Sahlberg [Thu, 20 May 2010 02:35:57 +0000 (12:35 +1000)]
In control_ipreallocate() we wait at most 5 tries before aborting the command
and returning an error.
This might not be sufficient if there are several recoveries in a row.

Instead loop as long as it takes for the recovery master to finish the recoveries and re
spond to the ipreallocate call.

Increase the log level of the error message when the recovery master was busy and could
not perform the ipreallocation promptly

BZ61783

13 years agoFix a bug where we failed to remove the natgw address from loopback properly
Ronnie Sahlberg [Wed, 19 May 2010 03:23:43 +0000 (13:23 +1000)]
Fix a bug where we failed to remove the natgw address from loopback properly
bz58317

13 years agoNew version 1.0.112-20
Ronnie Sahlberg [Mon, 10 May 2010 23:35:03 +0000 (09:35 +1000)]
New version 1.0.112-20

+* Tue May 11 2010 : Version 1.0.112-20
+ - Add number of recoveries done to the ctdb statistics output.
+ - Use the fuill range for IDR values.
+   BZ 60540
+ - When performing a recovery, make sure all nodes agree with recmaster
+   on the reclock file.
+   BZ 62748
+ - Lower the loglevel for some debug messages
+   BZ 63074

13 years agoAdd the number of performed recoveries to the "ctdb statistics" output.
Ronnie Sahlberg [Mon, 10 May 2010 23:28:59 +0000 (09:28 +1000)]
Add the number of performed recoveries to the "ctdb statistics" output.

13 years agoctdb: use full range of IDR
Rusty Russell [Sat, 8 May 2010 12:54:11 +0000 (22:24 +0930)]
ctdb: use full range of IDR

This resolves a problem with huge numbers of requests which could overflow
16 bits.  Fortunately, the IDR should scale reasonably well, so we can simply
hold all the requests.

Although noone checks for failure, I added a constant for that.

BZ: 60540
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 years agoWhen we perform a recovery. Make sure that the recmaster will sync the reclock file...
Ronnie Sahlberg [Wed, 5 May 2010 23:25:53 +0000 (09:25 +1000)]
When we perform a recovery. Make sure that the recmaster will sync the reclock file across the cluster.

This prevents issues such as when the recovery master is configured to NOT use a reclock file but other nodes are configured to use one.

BZ 62748

14 years agoLower the debug level for the messages when a client registers/deregisters a server id
Ronnie Sahlberg [Tue, 4 May 2010 22:47:30 +0000 (08:47 +1000)]
Lower the debug level for the messages when a client registers/deregisters a server id

BZ63074

14 years agoNew version 1.0.112-19
Ronnie Sahlberg [Tue, 4 May 2010 03:50:26 +0000 (13:50 +1000)]
New version 1.0.112-19

This version adds a new eventscript 62.cnfs that
allows better integration with GPFS.

BZ 61913

14 years agoNew version 1.0.112
Ronnie Sahlberg [Mon, 3 May 2010 06:09:34 +0000 (16:09 +1000)]
New version 1.0.112

+* Mon May 3 2010 : Version 1.0.112-18
+ - Make the NATGW eventscript check for when the system is misconfigured
+   to use the same address for both natgw as well as a public address
+   and warn.  BZ60933
+ - A recent change to monitor the ip address assignment broke "ctdb moveip".
+   Fix ctdb moveip so it works again. BZ62782

14 years agoDont check ip assignment across the cluster while ip-verification
Ronnie Sahlberg [Wed, 28 Apr 2010 05:47:19 +0000 (15:47 +1000)]
Dont check ip assignment across the cluster while ip-verification
checks are disabled

14 years agoThe recent change to the recovery daemon to keep track of and
Ronnie Sahlberg [Wed, 28 Apr 2010 05:43:11 +0000 (15:43 +1000)]
The recent change to the recovery daemon to keep track of and
verify that all nodes agree on the most recent ip address assignments
broke "ctdb moveip ..." since that call would never trigger
a full takeover run and thus would immediately trigger an inconsistency.

Add a new message to the recovery daemon where we can tell the recovery daemon to update its assignments.

BZ62782

14 years agoMake create_merged_ip_list() a static function since
Ronnie Sahlberg [Wed, 28 Apr 2010 04:47:37 +0000 (14:47 +1000)]
Make create_merged_ip_list() a static function since
it is not called from outside of ctdb_takeover.c

14 years agoIn the log message when we have found an inconsistent ip address allocation,
Ronnie Sahlberg [Wed, 28 Apr 2010 04:44:53 +0000 (14:44 +1000)]
In the log message when we have found an inconsistent ip address allocation,
add extra log information about what the inconsistency is.

14 years agoIf the admin makes a configuration mistake and configures NATGW to use the
Ronnie Sahlberg [Tue, 27 Apr 2010 22:46:41 +0000 (08:46 +1000)]
If the admin makes a configuration mistake and configures NATGW to use the
same ip address as a normal public-address,
check for this in the natgw script and warn the user.

Also prevent ctdb from starting up since this configuration will not work.

BZ60933

14 years agoNew version 1.0.112-17
Ronnie Sahlberg [Thu, 22 Apr 2010 23:07:03 +0000 (09:07 +1000)]
New version 1.0.112-17

* Fri Apr 23 2010 : Version 1.0.112-17
 - In ctdb-crash-cleanup.sh  also check for and remove the NATGW address
   if set.
 - Add monitoring and warning of low memory condition
   CTDB_MONITOR_FREE_MEMORY_WARN

14 years agoAdd a setting where CTDB will monitor and warn for low memory conditions.
Ronnie Sahlberg [Thu, 22 Apr 2010 22:52:09 +0000 (08:52 +1000)]
Add a setting where CTDB will monitor and warn for low memory conditions.

    CTDB_MONITOR_FREE_MEMORY_WARN

BZ 59747

14 years agoIn the example script to remove all ip addresses after a ctdb crash,
Ronnie Sahlberg [Thu, 22 Apr 2010 22:35:01 +0000 (08:35 +1000)]
In the example script to remove all ip addresses after a ctdb crash,
add the NATGW address as one to be removed in addition to the
public addresses.

14 years agoNew version 1.0.112-16
Ronnie Sahlberg [Thu, 22 Apr 2010 04:16:39 +0000 (14:16 +1000)]
New version 1.0.112-16

14 years agoadd an example script that can be called from crontab to cleanup
Ronnie Sahlberg [Thu, 22 Apr 2010 04:02:11 +0000 (14:02 +1000)]
add an example script that can be called from crontab to cleanup
and release public ip addresses if ctdbd is no longer running

14 years agoadd a missing ||
Ronnie Sahlberg [Thu, 22 Apr 2010 03:36:13 +0000 (13:36 +1000)]
add a missing ||
to make the 10.interface script not fail with a syntax error

14 years agoNew version 1.0.112-15
Ronnie Sahlberg [Wed, 21 Apr 2010 05:42:00 +0000 (15:42 +1000)]
New version 1.0.112-15

* Wed Apr 21 2010 : Version 1.0.112-15
 - Change how we add/remove iptable rules during recovery to make
   rules leaks less likey.
 - change a debug message loglevel from ERR to NOTICE
   BZ62086
 - In the recovery daemon, track pulbic ip assignment
   across the cluster and verify consistency.
 - From Martins: change the 10.interface script to handle
   virtio interfaces correctly for virtual clusters.
 - Make the recovery master verify the reclock setting across the cluster
   and ban nodes with inconsistencies.
   BZ56354

14 years agoLet the recovery master verify the reclock setting on all nodes in the cluster.
Ronnie Sahlberg [Wed, 21 Apr 2010 03:46:54 +0000 (13:46 +1000)]
Let the recovery master verify the reclock setting on all nodes in the cluster.

Any node that is found to use a different filename from the first node
will be banned.

Nodes that have no reclock file at all configured are ignored in this check.

BZ56354