obnox/samba/samba-obnox.git
10 years agolocking: Move function find_lock_context() before ctdb_lock_schedule()
Amitay Isaacs [Fri, 2 Aug 2013 00:51:45 +0000 (10:51 +1000)]
locking: Move function find_lock_context() before ctdb_lock_schedule()

So that ctdb_lock_schedule() can call this function without requiring extra
prototype declaration.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 68af5405acc123b5a90decd2123e2a02961a8fcf)

10 years agoctdbd: Print set db sticky message after it's set
Amitay Isaacs [Tue, 30 Jul 2013 04:17:55 +0000 (14:17 +1000)]
ctdbd: Print set db sticky message after it's set

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 824dcec35ec461d78e22b2ea109473b32bfe3972)

10 years agotests: Add a test program to hold a lock on a database
Amitay Isaacs [Tue, 4 Dec 2012 07:27:10 +0000 (18:27 +1100)]
tests: Add a test program to hold a lock on a database

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit f6b066a23610fb0092298861c21a9b354b91e2f1)

10 years agorecoverd: Use correct tdb flags when creating missing databases
Amitay Isaacs [Tue, 30 Jul 2013 02:45:01 +0000 (12:45 +1000)]
recoverd: Use correct tdb flags when creating missing databases

When creating missing databases either locally or remotely, make sure
to use the correct tdb flags from other nodes.  Without this, volatile
databases can get attached without TDB_INCOMPATIBLE_HASH flag.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 10a057d8e15c8c18e540598a940d3548c731b0b4)

10 years agoclient: Always use jenkins hash when attaching volatile databases
Amitay Isaacs [Thu, 1 Aug 2013 01:07:59 +0000 (11:07 +1000)]
client: Always use jenkins hash when attaching volatile databases

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 7e7e59c4047c78159387089eca65d90037bcf722)

10 years agorecoverd: Make sure to use jenkins hash for recovery databases
Amitay Isaacs [Mon, 29 Jul 2013 03:50:44 +0000 (13:50 +1000)]
recoverd: Make sure to use jenkins hash for recovery databases

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 32c83e209823e9a4d6306bb7fd63d4500f3e2668)

10 years agorecoverd: Assemble up-to-date node flags information from remote nodes
Amitay Isaacs [Mon, 22 Jul 2013 07:26:28 +0000 (17:26 +1000)]
recoverd: Assemble up-to-date node flags information from remote nodes

Currently nodemap used by recovery master is the one obtained from the local
node.  This information may have been updated while processing main loop.
Before comparing node flags on all the nodes, create up-to-date node flags
information based on the information received from all the nodes.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit fcf77dec5af973a0e32f3999bc012053a6f47a96)

10 years agotools/ctdb: Only print the hot records with non-zero hopcount
Amitay Isaacs [Mon, 15 Jul 2013 06:35:30 +0000 (16:35 +1000)]
tools/ctdb: Only print the hot records with non-zero hopcount

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 049d9beb3783482490e6273a434ccbad23f85f0a)

10 years agoctdbd: Don't consider a hot record if the hopcount is zero
Amitay Isaacs [Mon, 15 Jul 2013 06:32:40 +0000 (16:32 +1000)]
ctdbd: Don't consider a hot record if the hopcount is zero

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit ab35773518ad15588013f4d859f7bee790437450)

10 years agoctdbd: Fix updating of hot keys in database statistics
Amitay Isaacs [Fri, 12 Jul 2013 07:33:13 +0000 (17:33 +1000)]
ctdbd: Fix updating of hot keys in database statistics

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit fde4b4db5a57f75c5efa5647c309f33e0d5a68f3)

10 years agoctdbd: Remove incomplete ctdb_db_statistics_wire structure
Amitay Isaacs [Mon, 15 Jul 2013 05:24:11 +0000 (15:24 +1000)]
ctdbd: Remove incomplete ctdb_db_statistics_wire structure

Instead of maintaining another structure, add an element as place holder for
marshall buffer of hot keys.  This avoids duplication of the structure.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit e73b2e12adc9db1dedb48d32bba3a8406a80f4cd)

10 years agoRevert "ctdbd: Remove incomplete ctdb_db_statistics_wire structure"
Amitay Isaacs [Mon, 15 Jul 2013 04:52:07 +0000 (14:52 +1000)]
Revert "ctdbd: Remove incomplete ctdb_db_statistics_wire structure"

The structure cannot be removed without adding support for marshalling keys
for hot records.

This reverts commit 26a4653df594d351ca0dc1bd5f5b2f5b0eb0a9a5.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 023ca2e84f5ed064a288526b9c2bc7e06674dd81)

10 years agodoc: Update XML files to use standard DocBook DTD
Martin Schwenke [Fri, 26 Jul 2013 05:09:24 +0000 (15:09 +1000)]
doc: Update XML files to use standard DocBook DTD

This simplifies building since we don't use any of the Samba
extensions.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 57aa2dffea60abd73a95233f8b761cc676adebb6)

10 years agoinitscript: The wrapper script should export CTDB_SOCKET
Martin Schwenke [Fri, 26 Jul 2013 01:20:47 +0000 (11:20 +1000)]
initscript: The wrapper script should export CTDB_SOCKET

This ensures that any invocation of the ctdb tool (within the wrapper)
gets the desired value.  This at least ensures that ctdbd will be
started.

If a non-standard value is set for CTDB_SOCKET then command-line users
will still need the variable in their environment.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 37ccc7c6cc43a80aaa92291aea7a438f4225488a)

10 years agoctdbd: Kill client process without checking for tracked child
Martin Schwenke [Thu, 25 Jul 2013 06:17:07 +0000 (16:17 +1000)]
ctdbd: Kill client process without checking for tracked child

Commit f73a4b1495830bcdd094a93732a89dd53b3c2f78 added a safety check
to ensure that CTDB never kills unrelated processes.  However, client
processes are unrelated.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 782814288bb560099ee44b607bf35f3eddf37f82)

10 years agoeventscripts: kill_tcp_connections() should send connections to stdin
Martin Schwenke [Thu, 25 Jul 2013 03:40:43 +0000 (13:40 +1000)]
eventscripts: kill_tcp_connections() should send connections to stdin

This avoids issuing multiple "ctdb killtcp" commands to terminate tcp
connections, one per connection.  This will considerably reduce the
time when there is a large number of tcp connections.  This also makes
it possible to avoid calling "ctdb killtcp" when there are no connections.

Add a couple of unit tests for killtcp and update eventscript unit
test infrastructure to support.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit a20d94717d2e4ab866d8a002cdf39c0669b74c6a)

10 years agotools/ctdb: Allow killtcp to read connections from standard input
Martin Schwenke [Thu, 25 Jul 2013 03:28:26 +0000 (13:28 +1000)]
tools/ctdb: Allow killtcp to read connections from standard input

This will allows eventscripts to send information about multiple tcp
connections to a single "ctdb killtcp" command, saving the overhead of
setting up a client connection per tcp connection.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit af5aa369c266430fe912df0c26116b68bac3572e)

10 years agotests: Always tally the number of passed/failed tests
Martin Schwenke [Mon, 22 Jul 2013 10:11:58 +0000 (20:11 +1000)]
tests: Always tally the number of passed/failed tests

Regardless of whether a summary is being printed!

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a69e03a5e4671e998d45b4fef8611a421bbdb3e1)

10 years agorecoverd: Call takeover fail callback only once per node
Martin Schwenke [Mon, 22 Jul 2013 06:39:46 +0000 (16:39 +1000)]
recoverd: Call takeover fail callback only once per node

Currently the fail callback is called once per (takeip/releaseip) control
failure.  This is overkill and can get a node banned much too quickly.

Instead, keep track of control failures per node and only call fail
callback once per failed node.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit bf4a7c1ad87e0e848296d15d63eb8cd901ca5335)

10 years agoscripts: Run scriptstatus for hung event
Martin Schwenke [Mon, 22 Jul 2013 05:08:32 +0000 (15:08 +1000)]
scripts: Run scriptstatus for hung event

The timeout information printed by ctdbd is less than useful because
it refers to the cumulative time taken by the eventscripts run so far.
Adding scriptstatus output indicates where time was actually spent.

Since there is now quite a bit of output, serialise the calls to this
script using flock.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 1b016b2dfc5d7d3f2a42ce4dfe569608e90eb714)

10 years agoctdbd: Pass event name to hung script debugger
Martin Schwenke [Mon, 22 Jul 2013 05:06:52 +0000 (15:06 +1000)]
ctdbd: Pass event name to hung script debugger

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit e0f3fa1020e13b84bdd672538168d148f1847d57)

10 years agotests/complex: Fix NFS tests to work with root_squash
Martin Schwenke [Mon, 22 Jul 2013 04:32:13 +0000 (14:32 +1000)]
tests/complex: Fix NFS tests to work with root_squash

Refactor the NFS test setup/cleanup code into new common functions.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 29e98017221326bdc9b1c4f7c05b3b495c1de29b)

10 years agotests: Fix exit status of run_tests when a single test is run with -H
Martin Schwenke [Fri, 19 Jul 2013 09:59:43 +0000 (19:59 +1000)]
tests: Fix exit status of run_tests when a single test is run with -H

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 9d6e1c147bd036d832b98c155f405ee2a5d6f57f)

10 years agotests/simple: Add -p in onnode test to help show groups of connections
Martin Schwenke [Fri, 19 Jul 2013 05:33:38 +0000 (15:33 +1000)]
tests/simple: Add -p in onnode test to help show groups of connections

Change the command from "true" to "hostname" since the former won't
produce any output when used in combination with "onnode -p".  This
could just be changed to "echo" but the hostname might actually be
useful.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit ae3c03d80264e997b7da9f3279d7810e18b8a1df)

10 years agoctdbd: Sleep at exit to allow time for log messages to flush
Martin Schwenke [Wed, 17 Jul 2013 01:14:37 +0000 (11:14 +1000)]
ctdbd: Sleep at exit to allow time for log messages to flush

Register print_exit_message() earlier so that it covers most of the
early exits.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 90d792cf28d6a823141e4c417b6978f02a9cf596)

10 years agoctdbd: Exit if something is already listening on CTDB socket
Martin Schwenke [Fri, 19 Jul 2013 05:36:29 +0000 (15:36 +1000)]
ctdbd: Exit if something is already listening on CTDB socket

Don't blindly remove the socket.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 3dd5b925dcf0e9a5b877638e471c5ecf36b46c58)

10 years agotests/eventscripts: Add tests for monitoring of missing interfaces
Martin Schwenke [Tue, 16 Jul 2013 09:57:18 +0000 (19:57 +1000)]
tests/eventscripts: Add tests for monitoring of missing interfaces

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 53e4eca74429f76adc81d98e3d11d1bd61194d71)

10 years agoeventscripts: A missing interface should cause monitoring to fail
Martin Schwenke [Fri, 12 Jul 2013 02:48:34 +0000 (12:48 +1000)]
eventscripts: A missing interface should cause monitoring to fail

A missing interface is at least as bad as an interface with a link
that is down so should have a similar effect.

This couldn't be done previously because orphaned interfaces used to
be listed for monitoring.  This was worked around in 10.interface in
commit 49b2d1bd9554461ed8edbfc21e777c0eca9e1443 and fixed in ctdbd in
commit cc1a3ae911d3fee8b87fda5de5ab6d9499d7510a.

If $CTDB_PARTIALLY_ONLINE_INTERFACES="yes" then monitoring won't
actually fail but the interface is still marked as down.

While we're touching this code, use "ip link" instead of "ip addr".
It is marginally cheaper but not enough for a separate patch.  ;-)

This effectively reverts d67955b42f7627be9dae995230c8fcbb8a948ec2.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 501f19b16fd6d67fbb754248868c38ee5bcf79ef)

10 years agoeventscripts: Get list of configured interfaces using "ctdb ifaces"
Martin Schwenke [Fri, 12 Jul 2013 02:33:36 +0000 (12:33 +1000)]
eventscripts: Get list of configured interfaces using "ctdb ifaces"

This was previosuly changed because ctdbd didn't garbage collect
orphaned interfaces.  This was fixed in commit
cc1a3ae911d3fee8b87fda5de5ab6d9499d7510a.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit c6ab0f9405d5fa5b0b1693bc92e59da0d555a9d7)

10 years agoctdbd: Allow extra recovery to repair persistent DBs during first recovery
Martin Schwenke [Mon, 24 Jun 2013 05:49:48 +0000 (15:49 +1000)]
ctdbd: Allow extra recovery to repair persistent DBs during first recovery

Commit 8076773a9924dcf8aff16f7d96b2b9ac383ecc28 introduced a potential
regression because a node may not have completed the "recovered" event
(so might still be in CTDB_RUNSTATE_FIRST_RECOVERY) when another node
becomes healthy.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 57ef5d3827ea3417a32703e259a53ce6fd10ac45)

10 years agopackaging: Bundle debug_locks.sh script in RPM
Amitay Isaacs [Tue, 16 Jul 2013 02:53:16 +0000 (12:53 +1000)]
packaging: Bundle debug_locks.sh script in RPM

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 5740155cc5de1a223412e8529aa1a383a5412514)

10 years agopackaging: No need to check for existence of scripts, they always do
Amitay Isaacs [Tue, 16 Jul 2013 02:52:00 +0000 (12:52 +1000)]
packaging: No need to check for existence of scripts, they always do

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 67c227a5d30cb8487b20b19b20bdfa4613906609)

10 years agoscripts: ctdbd_wrapper logs a message to syslog if syslog is not being used
Martin Schwenke [Thu, 11 Jul 2013 04:26:38 +0000 (14:26 +1000)]
scripts: ctdbd_wrapper logs a message to syslog if syslog is not being used

It can be very disconcerting when logging to syslog is expected but
nothing is being logged there.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 412bc0e20bef694d4e911dc9c984fd7716231f1f)

10 years agoUpdate Nagios check to work with ctdb versions past 30 Aug 2011
Mathieu Parent [Fri, 7 Jun 2013 17:01:06 +0000 (19:01 +0200)]
Update Nagios check to work with ctdb versions past 30 Aug 2011

Because of commit a779d83a6213e2ba

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a4afe7af9c9391048d6f80135bbd5e15367770c7)

10 years agorecoverd: Really fix bogus info in message about changed flags
Martin Schwenke [Thu, 11 Jul 2013 03:01:13 +0000 (13:01 +1000)]
recoverd: Really fix bogus info in message about changed flags

Commit 9119a568c2b4601318f7751f537dca2f92a7230b attempted to fix this.
However, this was wrong because old_flags and new_flags were confused.
The latter has since been fixed in commit
7eb2f89979360b6cc98ca9b17c48310277fa89fc so this can now be fixed
properly.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 40f2825d6e818dc8c745b6385a545969dfb45fbc)

10 years agodoc: Update NEWS
Martin Schwenke [Wed, 10 Jul 2013 04:44:56 +0000 (14:44 +1000)]
doc: Update NEWS

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 76703514040b804b880cab909f6ff52576f80f89)

10 years agoPrint deleted nodes as well
Sumit Bose [Mon, 19 Nov 2012 17:45:37 +0000 (18:45 +0100)]
Print deleted nodes as well

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 0930a3b806977555509c3228726e2250aef1f971)

10 years agoIPv6 neighbor solicit cleanup
Sumit Bose [Thu, 1 Sep 2011 13:18:46 +0000 (15:18 +0200)]
IPv6 neighbor solicit cleanup

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit a81edf7eb908659a379f0cb55fd5d04551dc2c37)

10 years agoFix memory leak in ctdb_send_message()
Sumit Bose [Mon, 19 Nov 2012 10:13:03 +0000 (11:13 +0100)]
Fix memory leak in ctdb_send_message()

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit da87395d29f5d11ecfedaf36b53fa060a9140bfd)

10 years agoFixes for various issues found by Coverity
Sumit Bose [Wed, 10 Aug 2011 15:53:56 +0000 (17:53 +0200)]
Fixes for various issues found by Coverity

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 05bfdbbd0d4abdfbcf28e3930086723508b35952)

10 years agoCheck return value of tdb_delete()
Sumit Bose [Mon, 19 Nov 2012 10:20:31 +0000 (11:20 +0100)]
Check return value of tdb_delete()

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 5cdcc3d45d358ddbcd7e864898eed9cbd9935429)

10 years agoweb: Update webpages
Amitay Isaacs [Thu, 11 Jul 2013 03:46:18 +0000 (13:46 +1000)]
web: Update webpages

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit ed9ba1d3dcfcb51aa69bf4d7a74b95063743d8d9)

10 years agoTests: Correct the arguments to memset
Amitay Isaacs [Thu, 11 Jul 2013 01:34:46 +0000 (11:34 +1000)]
Tests: Correct the arguments to memset

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 9ffcd6a91287d86bae7b0c73aa129c81126e08e7)

10 years agodoc: Update NEWS
Amitay Isaacs [Wed, 10 Jul 2013 04:44:56 +0000 (14:44 +1000)]
doc: Update NEWS

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-with: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 14141b02b61d2783b750ee5b30f9520253e88f09)

10 years agopackaging: Add systemd support
Martin Schwenke [Wed, 10 Jul 2013 07:19:55 +0000 (17:19 +1000)]
packaging: Add systemd support

Based on an original patch by Sumit Bose <sbose@redhat.com>.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit e43a4b7b69a21c4cec2453dcac436b64bf5d7f06)

10 years agobuild: Turn off all deprecation warnings
Martin Schwenke [Wed, 10 Jul 2013 06:35:53 +0000 (16:35 +1000)]
build: Turn off all deprecation warnings

The "‘tevent_loop_allow_nesting’ is deprecated" warnings will be
around for a while and are annoying.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 30a0040fbb7c4d97d107f0e55c600295c2603a68)

10 years agobuild: Remove -DTEVENT_DEPRECATED_QUIET=1 from CFLAGS
Martin Schwenke [Wed, 10 Jul 2013 06:30:29 +0000 (16:30 +1000)]
build: Remove -DTEVENT_DEPRECATED_QUIET=1 from CFLAGS

This reverts the last part of 788cdbddbc902a5b076d23473450065b551d274d
- the rest of this has been implicitly reverted via tevent syncs.
This is just leftover noise.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit b6bbfb4c464c39e322830cbbebcc51c225508584)

10 years agoinitscript: Simpify initscript and control CTDB via new ctdbd_wrapper
Martin Schwenke [Tue, 9 Jul 2013 05:22:07 +0000 (15:22 +1000)]
initscript: Simpify initscript and control CTDB via new ctdbd_wrapper

Currently the initscript is very complex.  This makes it hard to read
and hard to add support for new init systems, such as systemd.

Create a wrapper called ctdbd_wrapper to be installed alongside ctdbd.
This is called by the initscript to start and stop ctdbd.  It does the
ctdbd option construct and waits until ctdbd is properly initialised
before it exits.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit e3abc7eebab5cceddc4ce7817890dd5db9be3450)

10 years agorecoverd: Recovery daemon should use ctdb_get_pnn, which can't fail
Martin Schwenke [Mon, 8 Jul 2013 02:45:31 +0000 (12:45 +1000)]
recoverd: Recovery daemon should use ctdb_get_pnn, which can't fail

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit c6fded59fa4da67f738a90fdacb51900e41801f9)

10 years agoctdbd: Print tdb flags when logging attached to database message
Amitay Isaacs [Wed, 10 Jul 2013 02:23:30 +0000 (12:23 +1000)]
ctdbd: Print tdb flags when logging attached to database message

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 846109169ee5e3d03135156e45c8dac93aa2e95b)

10 years agoctdbd: Set process names for child processes
Amitay Isaacs [Tue, 9 Jul 2013 02:32:53 +0000 (12:32 +1000)]
ctdbd: Set process names for child processes

This helps distinguish processes in process list in top, perf, etc.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 2493f57ce268d6fe7e4c40a87852c347fd60d29e)

10 years agocommon/system: Add ctdb_set_process_name() function
Amitay Isaacs [Tue, 9 Jul 2013 02:24:59 +0000 (12:24 +1000)]
common/system: Add ctdb_set_process_name() function

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit fc3689c977f48d7988eed0654fb8e5ce4b8bfc8b)

10 years agotraverse: Remove unused start_time field
Amitay Isaacs [Thu, 6 Jun 2013 06:29:04 +0000 (16:29 +1000)]
traverse: Remove unused start_time field

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit dc834d5e78c3fb97ae15cddf1139b3c4a4051a7c)

10 years agotraverse: Send records directly from traverse child to srcnode
Amitay Isaacs [Thu, 6 Jun 2013 06:26:25 +0000 (16:26 +1000)]
traverse: Send records directly from traverse child to srcnode

Currently CTDB daemon reads records from a child process and then sends them to
srcnode via TRAVERSE_DATA control.  This ties up main CTDB daemon and also
requires an extra copy of the record in the CTDB daemon.  Instead send records
directly from traverse child process.

The control from child process still goes via local CTDB daemon as there
is no infrastructure currently to open a TCP socket to the srcnode.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 1a74192aa7d51ed99553e7292860027f06b6ef37)

10 years agotraverse: Pass reqid and srcnode information to local database traverse
Amitay Isaacs [Thu, 6 Jun 2013 06:12:07 +0000 (16:12 +1000)]
traverse: Pass reqid and srcnode information to local database traverse

So that traverse child process can directly send the TRAVERSE_DATA control to
the srcnode without first sending it to local node.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit faabce1b99fb3de9ff03bf54d303e7656538fee3)

10 years agopackaging: When building with system libraries, add dependency for them
Amitay Isaacs [Mon, 8 Jul 2013 06:14:59 +0000 (16:14 +1000)]
packaging: When building with system libraries, add dependency for them

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 8225b3e77e140db34b52571a95d553d1e59e3f1e)

10 years agoctdbd: No need for DeadlockTimeout tunable
Amitay Isaacs [Mon, 8 Jul 2013 05:49:58 +0000 (15:49 +1000)]
ctdbd: No need for DeadlockTimeout tunable

The code for deadlock detection and killing smbd process causing deadlock
has been removed and replaced with external debug script.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 2211cd94bea266547d3e6f167d3160a6b23bec88)

10 years agoinitscript: Export CTDB_DEBUG_LOCKS variable
Amitay Isaacs [Mon, 8 Jul 2013 05:57:22 +0000 (15:57 +1000)]
initscript: Export CTDB_DEBUG_LOCKS variable

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit a415a1986900135f889efc25ecaf2761b1dae81a)

10 years agoscripts: Add an example debug_locks.sh script to debug locking issue
Amitay Isaacs [Mon, 8 Jul 2013 05:56:30 +0000 (15:56 +1000)]
scripts: Add an example debug_locks.sh script to debug locking issue

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit c711ff4702c5f95b75e4bf030665fc2afffc2f9e)

10 years agolocking: Use external script to debug locking issues
Amitay Isaacs [Mon, 8 Jul 2013 05:46:53 +0000 (15:46 +1000)]
locking: Use external script to debug locking issues

Use an external script to parse /proc/locks and log useful debugging
information about locks rather than doing that in C code.

To use this feature, add configuration variable to /etc/sysconfig/ctdb:

  CTDB_DEBUG_LOCKS=/etc/ctdb/debug_locks.sh

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 2bfb8499366d530f16515b08928056bbda40f781)

10 years agolocking: Update locking bucket intervals
Amitay Isaacs [Wed, 3 Jul 2013 01:01:21 +0000 (11:01 +1000)]
locking: Update locking bucket intervals

 0   < 1 ms
 1   < 10 ms
 2   < 100 ms
 3   < 1 s
 4   < 2 s
 5   < 4 s
 6   < 8 s
 7   < 16 s
 8   < 32 s
 9   < 64 s
10   >= 64 s

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 6fc36a7036933237d09151a0baf4d8ccd2bc2c99)

10 years agolocking: Update locks latency in CTDB statistics only for RECORD or DB locks
Amitay Isaacs [Wed, 3 Jul 2013 01:46:53 +0000 (11:46 +1000)]
locking: Update locks latency in CTDB statistics only for RECORD or DB locks

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit dcc42a75b4638b3aa40c44ed9e0aaae26483e2b0)

10 years agotools/ctdb: Fix the format of DB statistics output
Amitay Isaacs [Tue, 25 Jun 2013 05:36:13 +0000 (15:36 +1000)]
tools/ctdb: Fix the format of DB statistics output

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 594c421f90ce132c75fbd985872114e4967f92b5)

10 years agoctdbd: Remove incomplete ctdb_db_statistics_wire structure
Amitay Isaacs [Tue, 25 Jun 2013 05:25:16 +0000 (15:25 +1000)]
ctdbd: Remove incomplete ctdb_db_statistics_wire structure

Send the ctdb_db_statistics directly instead of first copying it to
duplicate ctdb_db_statistics_wire structure.  This simplifies the
implementation of the control to get database statistics.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 26a4653df594d351ca0dc1bd5f5b2f5b0eb0a9a5)

10 years agoctdbd: Update debug messages for setting readonly property on database
Amitay Isaacs [Wed, 3 Jul 2013 23:04:49 +0000 (09:04 +1000)]
ctdbd: Update debug messages for setting readonly property on database

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 545a46437dfb2b755bb2fddb11dea8c4ccce3ed7)

10 years agorecoverd: Fix buffer overflow error in reloadips
Amitay Isaacs [Fri, 5 Jul 2013 04:04:20 +0000 (14:04 +1000)]
recoverd: Fix buffer overflow error in reloadips

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 41182623891d74a7e9e9c453183411a161201e67)

10 years agotests/eventscripts: Add some rudimentary tests for 60.ganesha
Martin Schwenke [Thu, 4 Jul 2013 10:02:29 +0000 (20:02 +1000)]
tests/eventscripts: Add some rudimentary tests for 60.ganesha

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit e1cf1f728236d808bb41265e74bc65f54bf1c133)

10 years agoeventscripts: New configuration variable $CTDB_SKIP_GANESHA_NFSD_CHECK
Martin Schwenke [Thu, 4 Jul 2013 06:05:01 +0000 (16:05 +1000)]
eventscripts: New configuration variable $CTDB_SKIP_GANESHA_NFSD_CHECK

This allows 60.ganesha to be unit tested, except for the core Ganesha
monitoring code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit f606df4f2db754592e6d1a16c26e155cacb2beef)

10 years agoeventscript: Move Ganesha nfsd monitoring to a function
Martin Schwenke [Thu, 4 Jul 2013 06:00:33 +0000 (16:00 +1000)]
eventscript: Move Ganesha nfsd monitoring to a function

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit ceb5b2d37f7ab4894908ec26f3812b3bed991525)

10 years agoeventscripts: Drop RPC service version from nfs_check_rpc_service() calls
Martin Schwenke [Thu, 4 Jul 2013 05:11:54 +0000 (15:11 +1000)]
eventscripts: Drop RPC service version from nfs_check_rpc_service() calls

Support for this was removed in commit
77302dbfd85754e02559eccb2dd6c090db0b6b9f and I overlooked its use in
60.ganesha.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 520914e7ee1b879c1080e5857fda18ed5b973fd6)

10 years agoctdbd: Log something when releasing all IPs
Martin Schwenke [Tue, 2 Jul 2013 04:43:17 +0000 (14:43 +1000)]
ctdbd: Log something when releasing all IPs

At the moment this is silent and it can be confusing to see IPs just
disappear.

Also, this message:

  Been in recovery mode for too long. Dropping all IPS

can cause anxiety when all IPs should already have been dropped.
Adding a comforting message saying that 0 IPs were dropped relieves
such anxiety.  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 4d0f26b306fc465d551d340b0e7dce4412eae3fd)

10 years agorecoverd: Minor style improvements for ctdb_reload_remote_public_ips()
Martin Schwenke [Sun, 30 Jun 2013 09:00:36 +0000 (19:00 +1000)]
recoverd: Minor style improvements for ctdb_reload_remote_public_ips()

* Add a variable to the loop to make the code more readable and have
  it generally fit into 80 columns.

* Improve comments.

* Improve log messages.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 0a292fa8939a1343e44cadaa8ed9f3c0f18ca82f)

10 years agorecoverd: Clean up log messages in remote IP verification
Martin Schwenke [Sun, 30 Jun 2013 08:45:46 +0000 (18:45 +1000)]
recoverd: Clean up log messages in remote IP verification

The log messages in verify_remote_ip_allocation() are confusing
because they don't include the PNN of the problem node, because it is
not known in this function.

Add the PNN of the node being verified as a function argument and then
shuffle the log messages around to make them clearer.

Also fold 3 nested if statements into just one.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit f0942fa01cd422133fc9398f56b4855397d7bc86)

10 years agorecoverd: Fix an unclear log message - "Restart recovery process"
Martin Schwenke [Sun, 30 Jun 2013 07:57:33 +0000 (17:57 +1000)]
recoverd: Fix an unclear log message - "Restart recovery process"

When the recovery master notices a node in recovery mode it starts the
recovery process, it doesn't restart it.

Update documentation to match.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 298c4d2c3b4ea3d900c91f5a0a5aca2952a13d61)

10 years agorecoverd: Fix an incorrect comment
Martin Schwenke [Sun, 30 Jun 2013 07:53:37 +0000 (17:53 +1000)]
recoverd: Fix an incorrect comment

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 9f6cd8b0bea619991c9f3bf35188c5950dabf8f4)

10 years agoctdbd: Use ctdb_die() on "setup" event failure
Martin Schwenke [Sun, 30 Jun 2013 07:48:01 +0000 (17:48 +1000)]
ctdbd: Use ctdb_die() on "setup" event failure

This is slightly easier to read because it all fits on 1 line.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 035bf3eecf99337c84d4ad16cdbf297b1fa037db)

10 years agoctdbd: Avoid a core dump when "init" event fails
Martin Schwenke [Sun, 30 Jun 2013 07:43:52 +0000 (17:43 +1000)]
ctdbd: Avoid a core dump when "init" event fails

The "init" event only really fails in the scripts, which should log
something useful on failure.  Therefore, a core dump isn't terribly
useful and sometimes attracts unwanted attention.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 3af2d833b63af9931792106db71797f3692669a8)

10 years agoutil: New function ctdb_die()
Martin Schwenke [Sun, 30 Jun 2013 07:42:11 +0000 (17:42 +1000)]
util: New function ctdb_die()

This is like ctdb_fatal() but exits cleanly without dumping core or
generating a backtrace.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit c0a9456692c88a7a5542cd893d8f326524d3f94e)

10 years agoeventscripts: When replaying monitor status, don't log empty output
Martin Schwenke [Mon, 24 Jun 2013 09:03:26 +0000 (19:03 +1000)]
eventscripts: When replaying monitor status, don't log empty output

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit ce04f1c107b4392ca955d9f29b93aaaae62439ce)

10 years agoctdbd: Release IP callback should fail if the IP is still hosted
Martin Schwenke [Mon, 24 Jun 2013 06:05:03 +0000 (16:05 +1000)]
ctdbd: Release IP callback should fail if the IP is still hosted

At the moment there (at least) are 2 bugs that cause rogue IPs:

* A race where release_ip_callback() runs after a "subsequent" take IP
  has completed.  The IP is back on an interface but we unset
  vnn->iface in the callback.

* A "releaseip" eventscript times out.  We ignore the timeout and call
  it success, deleting the VNN even if the IP is still hosted.

  We could decide not to ignore the timeout and ban the node, but
  killing TCP connections can take a long time and that might result
  in a lot of manning.  We probably won't reinstate banning on
  "releaseip" until killing TCP connections has been optimised.

In both cases, a rogue IP can be avoided by leaving vnn->iface set and
simply failing the control.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c5797f2942e83da24df548ea07196fbbac0eab20)

10 years agoctdbd: Log warnings in release IP when unexpected interface is encountered
Martin Schwenke [Mon, 24 Jun 2013 05:49:48 +0000 (15:49 +1000)]
ctdbd: Log warnings in release IP when unexpected interface is encountered

Previous code changes work around a potential problems but do not
provide useful information when the a problem occurs.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit f1f1b0c24b9b6cd24b83a4e4da16e179287ec6ac)

10 years agoping_pong: Validate num_locks argument > 0
Amitay Isaacs [Thu, 4 Jul 2013 07:37:05 +0000 (17:37 +1000)]
ping_pong: Validate num_locks argument > 0

This fixes the floating point error if num_locks = 0.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 16afe36de52561a62372c14b567683dc898369d5)

10 years agotests: If connection to ctdb daemon fails, exit
Amitay Isaacs [Thu, 4 Jul 2013 07:27:00 +0000 (17:27 +1000)]
tests: If connection to ctdb daemon fails, exit

This fixes the segmentation error if any of the test code fails to
connect to CTDB daemon.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit d48eecd748830598f4f080952f2bf05d6f92738c)

10 years agobuild: Fix compiler warnings for uninitialized variables
Amitay Isaacs [Thu, 4 Jul 2013 07:00:23 +0000 (17:00 +1000)]
build: Fix compiler warnings for uninitialized variables

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 5408c5c4050539e5aa06a5e82ceb63a6cb5cef0c)

10 years agorecoverd: Send the result from child process only once
Amitay Isaacs [Thu, 4 Jul 2013 05:36:29 +0000 (15:36 +1000)]
recoverd: Send the result from child process only once

The result has been sent before the child keeps waiting for parent
ctdbd process.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 9aa13bcedd83d463c871e3cf1f3a65da3cd83992)

10 years agopackaging: Enable compiler optimizations
Amitay Isaacs [Thu, 4 Jul 2013 05:31:52 +0000 (15:31 +1000)]
packaging: Enable compiler optimizations

This reverts d09570c70551aa40390ce9ceffe7bc234e1afafe.

... hoping the segv has been found in last 6 years. :-)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 9b529189f8456fad7868fc154ae27a6fd87e93b3)

10 years agopackaging: Allow building RPMs with system tdb/talloc/tevent
Amitay Isaacs [Thu, 4 Jul 2013 05:14:10 +0000 (15:14 +1000)]
packaging: Allow building RPMs with system tdb/talloc/tevent

To build CTDB RPMs with system installed libraries, use following command:

  ./packaging/RPM/makerpms.sh \
    --with system_talloc \
    --with system_tdb \
    --with system_tevent

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit bb54f3924ff19cd089b0a166fe8368db162ad709)

10 years agopackaging: Do not mark /etc/ctdb/functions as configuration file
Amitay Isaacs [Thu, 4 Jul 2013 04:29:09 +0000 (14:29 +1000)]
packaging: Do not mark /etc/ctdb/functions as configuration file

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 1b0faae9c939a2f8da3cacba715ca62a5830d190)

10 years agopackaging: Install README.notify.d using %doc directive
Amitay Isaacs [Thu, 4 Jul 2013 03:19:56 +0000 (13:19 +1000)]
packaging: Install README.notify.d using %doc directive

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 53d34eb2f9e5434dea4e7182b6af566a3a96a368)

10 years agopackaging: Install docs using %doc directive
Amitay Isaacs [Thu, 4 Jul 2013 02:45:32 +0000 (12:45 +1000)]
packaging: Install docs using %doc directive

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 6fe584d05543eebd24abd19bab502dc4da04e921)

10 years agopackaging: Remove ctdb_transaction from docdir
Amitay Isaacs [Thu, 4 Jul 2013 01:33:38 +0000 (11:33 +1000)]
packaging: Remove ctdb_transaction from docdir

It's bundled in ctdb-tests package.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 7e53fbf92b6dd5211d918ea0e23126b7dfa50c42)

10 years agodoc: Add a disclaimer for the EnableBans tunable
Martin Schwenke [Sun, 30 Jun 2013 07:23:08 +0000 (17:23 +1000)]
doc: Add a disclaimer for the EnableBans tunable

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 145b1966c1b34f1667a175235e1df2741294391c)

10 years agodoc: Add banning bug fixes to NEWS
Martin Schwenke [Sun, 30 Jun 2013 07:22:06 +0000 (17:22 +1000)]
doc: Add banning bug fixes to NEWS

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit b4c06e8ec8b227c1e6c01444038c3b15b5f9e606)

10 years agoctdbd: Don't ban self if init or shutdown event fails
Amitay Isaacs [Tue, 2 Jul 2013 02:40:37 +0000 (12:40 +1000)]
ctdbd: Don't ban self if init or shutdown event fails

There is no point in banning the node if init or shutdown event times
out since it's going to quit anyway.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit ef1c4e99ca66e7a990bc557f34abb624c315e6ba)

10 years agodoc: The second half of monitoring is only for recovery master
Amitay Isaacs [Thu, 27 Jun 2013 07:46:43 +0000 (17:46 +1000)]
doc: The second half of monitoring is only for recovery master

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit fcd5e1f04c5fe6c98399429b8f0918b8779acba6)

10 years agorecoverd: when the recmaster is banned, use that information when forcing an election
Michael Adam [Wed, 26 Jun 2013 07:23:22 +0000 (09:23 +0200)]
recoverd: when the recmaster is banned, use that information when forcing an election

When we trigger an election because the recmaster considers itself inactive,
update our local nodemap with the recmaster's flags before calling
force_election(). This way, we don't send the inactive node freeze commands
(e.g.) that may fail and then lead to ourselves getting banned.

The theory is that this should help avoiding banning loops.

Signed-off-by: Michael Adam <obnox@samba.org>
(This used to be ctdb commit 932360992b08a5483d90c0590218ba0fd756119e)

10 years agorecoverd: fix a comment typo
Michael Adam [Wed, 26 Jun 2013 05:11:51 +0000 (07:11 +0200)]
recoverd: fix a comment typo

Signed-off-by: Michael Adam <obnox@samba.org>
(This used to be ctdb commit 741944f118e98f178b860194eecb215180949d18)

10 years agorecoverd: fix a comment in main_loop
Michael Adam [Fri, 21 Jun 2013 15:57:37 +0000 (17:57 +0200)]
recoverd: fix a comment in main_loop

Signed-off-by: Michael Adam <obnox@samba.org>
(This used to be ctdb commit ac06c46e4a80c635f6094b5ac6f0bf3e3a02db95)

10 years agorecoverd: eliminate some trailing spaces from ctdb_election_win()
Michael Adam [Fri, 21 Jun 2013 12:06:22 +0000 (14:06 +0200)]
recoverd: eliminate some trailing spaces from ctdb_election_win()

Signed-off-by: Michael Adam <obnox@samba.org>
(This used to be ctdb commit df30c0a05ed908fc2a997c56ff5484736b23b70f)

10 years agorecoverd: Don't continue if the current node gets banned
Martin Schwenke [Fri, 28 Jun 2013 06:31:07 +0000 (16:31 +1000)]
recoverd: Don't continue if the current node gets banned

Can not continue with recovery or monitoring cluster.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 14399de1dd0bd8dabf1f48b1457e3ccb37589d8a)