summaryrefslogtreecommitdiffstats
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
...
* ctdb-tests/simple: Update persistent DB testsMartin Schwenke2013-11-273-13/+13
| | | | | | | | | | | * Low level DB checks should ignore the sequence number record. * A restart is needed after messing with the RecoverPDBBySeqNum tunable. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-recoverd: For persistent databases a sequence number of 0 is validMartin Schwenke2013-11-271-2/+3
| | | | | | | | Otherwise recovery ends up done by RSN when it is unnecessary. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-locking: Use vfork instead of fork to exec helpersAmitay Isaacs2013-11-271-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a significant overhead using fork() over vfork(), specially when the child process execs a helper. The overhead is in memory space and time. # strace -c ./test_fork 1024 200 count=1024, size=204800, total=200M failed fork=0 time for fork() = 4879.597000 us % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 100.00 4.543321 3304 1375 375 clone 0.00 0.000071 0 1033 mmap 0.00 0.000000 0 1 read 0.00 0.000000 0 3 write 0.00 0.000000 0 2 open 0.00 0.000000 0 2 close 0.00 0.000000 0 3 fstat 0.00 0.000000 0 3 mprotect 0.00 0.000000 0 1 munmap 0.00 0.000000 0 3 brk 0.00 0.000000 0 1 1 access 0.00 0.000000 0 1 execve 0.00 0.000000 0 1 arch_prctl ------ ----------- ----------- --------- --------- ---------------- 100.00 4.543392 2429 376 total # strace -c ./test_vfork 1024 200 count=1024, size=204800, total=200M failed fork=0 time for fork() = 82.041000 us % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 96.47 0.001204 1 1000 vfork 3.53 0.000044 0 1033 mmap 0.00 0.000000 0 1 read 0.00 0.000000 0 3 write 0.00 0.000000 0 2 open 0.00 0.000000 0 2 close 0.00 0.000000 0 3 fstat 0.00 0.000000 0 3 mprotect 0.00 0.000000 0 1 munmap 0.00 0.000000 0 3 brk 0.00 0.000000 0 1 1 access 0.00 0.000000 0 1 execve 0.00 0.000000 0 1 arch_prctl ------ ----------- ----------- --------- --------- ---------------- 100.00 0.001248 2054 1 total Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-common: Refactor code to keep track of child processesAmitay Isaacs2013-11-272-8/+15
| | | | | | | This code can then be used to track child processes created with vfork(). Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-scripts: Run a single instance of debug_locks.sh at a give timeAmitay Isaacs2013-11-271-24/+34
| | | | | | | | | | This prevents spamming of logs if multiple lock requests are waiting and keep timing out. Also, improve the logging format with separators. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-locking: Update current lock statistics when lock is scheduledAmitay Isaacs2013-11-271-2/+2
| | | | | | | | | When a child process is created for a lock request, the current locks statistics should be updated immediately. This will provide accurate information on number of active lock requests. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-locking: Do not merge multiple lock requests to avoid unfair schedulingAmitay Isaacs2013-11-271-1/+6
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-locking: Implement active lock requests limit per databaseAmitay Isaacs2013-11-272-9/+13
| | | | | | | | | | | | This limit was currently a global limit and not per database. This prevents any database freeze lock requests from getting scheduled if the global limit was reached. Only individual record requests should be limited and database freeze requests should always get scheduled. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-scripts: Rewrite statd-callout to avoid 10 minute lagMartin Schwenke2013-11-273-113/+96
| | | | | | | | | This is naive and assumes no performance problems when updating persistent DBs. It also does no error handling. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-client: Treat empty __db_sequence_number__ record as 0Amitay Isaacs2013-11-271-0/+5
| | | | | | | | | This fixes the issue of transaction commit failing due to an empty __db_sequence_number__ record in persistent database left by previous cancelled transaction. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-doc: Update ctdb.1 - primarily to add pdelete/pfetch/pstore/ptransMartin Schwenke2013-11-271-129/+195
| | | | | | | | | | | | | | | | | | | Also: * More <refentryinfo> above <refmeta> to make the XML valid. * Describe DB argument in introduction and use it for database commands. * Remove unnecessary format="linespecific" from <screen> tags, since it will not be allowed in DocBook 5.0. * Sort the items in "INTERNAL COMMANDS". * Update/simplify some command descriptions. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tools/ctdb: New ptrans commandMartin Schwenke2013-11-273-0/+278
| | | | | | | | Also add test. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-onnode: New -i option to stop stdin from being closedMartin Schwenke2013-11-272-5/+22
| | | | | | | | | | This can be useful for piping data to onnode in certain circumstances. There are now also enough command-line options that they should definitely be alphabetically ordered. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests/integration: try_command_on_node() shouldn't lose onnode optionsMartin Schwenke2013-11-271-1/+1
| | | | | | | | Currently it only passes the last (non -v) option seen. It should pass them all. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-recoverd: Fix backward compatibility for CTDB_SRVID_TAKEOVER_RUNMartin Schwenke2013-11-273-20/+42
| | | | | | | | | When running a mixed version cluster, compatibility with older versions was was broken during recent refactorisation. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-scripts: debug_locks.sh should use configuration to find TDB locationMartin Schwenke2013-11-271-2/+10
| | | | | | | | That is, don't use fixed paths. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-recoverd: A node refuses to play against itselfMartin Schwenke2013-11-271-0/+5
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-recoverd: Remove duplicate code to update flags during recoveryMartin Schwenke2013-11-271-17/+0
| | | | | | | | This also happens earlier in do_recovery() and the nodemap is not updated after that, so this update is redundant. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-build: Update to latest upstream config.guessMartin Schwenke2013-11-271-63/+86
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tools/ctdb: Fix db commands when dbid is given instead of nameAmitay Isaacs2013-11-271-32/+31
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: CTDB tool should always be invoked as $CTDB instad of ctdbAmitay Isaacs2013-11-277-92/+92
| | | | | | | | $CTDB_TEST_WRAPPER is required only to run test functions or test binaries on remote nodes. For running ctdb command, $CTDB is sufficient. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: No need to run onnode in parallel for single nodeAmitay Isaacs2013-11-273-6/+6
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: Remove -q option to try_command_on_nodeAmitay Isaacs2013-11-2712-99/+99
| | | | | | | This option is always passed to onnode by default. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests: Coverity fixesAmitay Isaacs2013-11-191-8/+14
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Nov 19 19:06:51 CET 2013 on sn-devel-104
* ctdb-tcp: Coverity fixesAmitay Isaacs2013-11-191-7/+25
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tools/ctdb: Coverity fixesAmitay Isaacs2013-11-191-5/+11
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-common: Coverity fixesAmitay Isaacs2013-11-193-16/+37
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-client: Coverity fixesAmitay Isaacs2013-11-191-1/+4
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-server: Coverity fixesAmitay Isaacs2013-11-198-24/+49
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Fix calling of ctdb tool from testAmitay Isaacs2013-11-071-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 9381c33dfd40192b7532d942059c2959dfae059d)
* Revert "tests: If transaction_start fails, try again"Amitay Isaacs2013-11-071-1/+1
| | | | | | | | | | | | This reverts commit ed7d999214ee009e480c26410a04fa105028cb8e. This is not necessary since ctdb_transaction_start() now will return NULL only when there is a failure and not when another transaction is currently active. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 46615c8e0e63291605d76a6d35f1a93180718c36)
* client: Make g_lock_lock() wait till lock is obtainedAmitay Isaacs2013-11-071-1/+11
| | | | | | | | | | This makes the behaviour of g_lock_lock() similar to that implemented in Samba. Now ctdb_transaction_start() will return NULL only when there are failures and not when another transaction is active. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 59489019ad15a5ad6b0f295e742fc9832745a842)
* eventscript: Fix link creation failure if the link already exist but the ↵Srikrishan Malik2013-11-011-1/+1
| | | | | | | | target path is missing Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com> (This used to be ctdb commit 370022e1ff654db99d0c3ce0c49914c249e57289)
* doc: Update NEWSMartin Schwenke2013-10-301-0/+103
| | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 30a6565a7b476516f3daed0669b5650e1be3cd18)
* web: Add links to new manpagesAmitay Isaacs2013-10-301-5/+9
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit a7a844e7600b59d876de94ec5bf7bd1647508cdf)
* doc: Major updates to manual pagesMartin Schwenke2013-10-3010-2858/+5389
| | | | | | | | | This includes new manpages for ctdb.7, ctdb.conf.5 and ctdb-tunables.7. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 15b5c6c00c248bc1a8364a6da103296a55d7bfb6)
* tunables: Remove obsolete tunablesAmitay Isaacs2013-10-302-6/+0
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit ca5fc3431573c44d55d09d987c715fb53756fc1f)
* recoverd: Rebalancing should be done regardless tunableMartin Schwenke2013-10-301-7/+14
| | | | | | | | | Rebalance target nodes should be set even if a deferred rebalance is not configured. The user can explicitly cause a takeover run. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit afd9b51644af074752d74c412cb4e7ec2eba2c69)
* recoverd: Improve an error message in the election codeMartin Schwenke2013-10-301-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 275ed9ebe287e39d891888c13810c70f347af8ac)
* Revert "if a new node enters the cluster, that node will already be frozen ↵Martin Schwenke2013-10-301-20/+13
| | | | | | | | | | | | | | | | | | | at start" This is unnecessary due to 03e2e436db5cfd29a56d13f5d2101e42389bfc94. Furthermore, if a node doesn't force an election but wins it then it can fail to record that it is the new recovery master. This can lead to a reverse split brain where there is no recovery master. This reverts commit c5035657606283d2e35bea40992505e84ca8e7be. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Conflicts: server/ctdb_recoverd.c (This used to be ctdb commit c8b542e059a54b8d524bd430cad9d82e5edd864d)
* ctdbd: When a node is connected, log at DEBUG NOTICE not DEBUG_INFOMartin Schwenke2013-10-291-2/+3
| | | | | | | | | This is important enough that we should see it when the log level is DEBUG_NOTICE. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit eb8ec5681bfccb26c8ffae72952d54bb0ba46249)
* tests/complex: Remove CTDB_NFS_SKIP_SHARE_CHECK testMartin Schwenke2013-10-291-129/+0
| | | | | | | | | | This is a needlessly complex way of testing the same thing as the eventscripts unit tests 60.nfs.monitor.161.sh and 60.nfs.monitor.162.sh. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d1674aad224f8f0c9a03c3cd38a647318ba0f03e)
* tests/complex: Remove CTDB_SAMBA_SKIP_SHARE_CHECK testMartin Schwenke2013-10-291-134/+0
| | | | | | | | | | | | | | This is adequately covered by eventscripts unit tests 50.samba.monitor.105.sh and 50.samba.monitor.106.sh. This test is broken if CTDB_SAMBA_CHECK_PORTS is not specified in the CTDB configuration. Fixing it is hard and involves adding a more complex stub for testparm. We already have that in the eventscript unit tests above. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 81b94fbb7495ac3204f1a84c673c8babf04663bc)
* eventscripts: Rewrite the smb.conf cache file handlingMartin Schwenke2013-10-292-78/+49
| | | | | | | | | | | | | | | | | | | | | | | The background update is never guaranteed to complete before the cache is used, so don't bother trying it at the beginning. Instead, put a timeout on a foreground update. If the foreground update fails: * If there's no available cache file then die. * If there is a previous cache file then use it and log a warning. * Do a background update at the end of the monitor event. Also remove commas in the "smb ports" list before use, since (newer?) testparm seem to insert commas into the default value. Update the associated test to add a comma. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 8c6f511254ecb0381a609b37e3a0ee6e5ec5d562)
* tools/ctdb: Fix documentation string for ban commandMartin Schwenke2013-10-291-1/+1
| | | | | | | | Ban time of 0 is not supported. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c072eb1f6488f94f83a6d3a81d88bf29ad866943)
* Revert "recoverd: Disable takeover runs on other nodes for 5 minutes"Martin Schwenke2013-10-291-2/+2
| | | | | | | | | | | 5 minutes is too long to leave the cluster in limbo if the recovery daemon dies during a takeover run, even though this is quite unlikely. We need a new recover master to be able to do takeover runs fairly quickly. This reverts commit 71080676bb4acbd0d9b595a30cf7fe6dddbf426f. (This used to be ctdb commit 3e41170c78fc7a2bf526129c9b7db3739b61c6bf)
* tools/onnode: Fix healthy/ok node handlingMartin Schwenke2013-10-294-19/+18
| | | | | | | | | | | | | | | | | | | | | | | This bit-rotted a long time ago when the "ThisNode" column was added to "ctdb -Y status" output. The fake "ctdb -Y status" output in the test was never updated to reflect this change. Instead of making sure that all columns are "0", just check that they're not "1". This implicitly ignores "Y" and "N" in this "ThisNode" column without having to do anything else clever. Also update associated tests. The main "ctdb ok" test had a duplicate opening line for a here document, which was tickled by this change. This fixes samba bz#8122. Signed-off-by: Martin Schwenke <martin@meltin.net> onnode test fixup Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 01a46205c3a3d6609dc0b0324319b89667dffa32)
* daemon: Change the default recovery method for persistent databasesAmitay Isaacs2013-10-282-5/+8
| | | | | | | | | Use sequence numbers to do recovery for persistent databases instead of RSNs. This fixes the problem of registry corruption during recovery. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 56486d1c01cc8ad0e4b8cee7a22429e72e50f03d)
* packaging: Create runtime directories for CTDBAmitay Isaacs2013-10-251-0/+3
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit c7450f9e22133333bf82c88a17ac25990ebc77ab)
* initscript: Update systemd configuration to put PID file in /run/ctdbMartin Schwenke2013-10-251-3/+3
| | | | | | | | | | Elsewhere we're moving the socket to /var/run/ctdb. We might end up with PID files and sockets for other daemons later, so let's call the directory "ctdb" instead of "ctdbd". Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b63f6fd2d295c8e18cbf3420ab05fce07b727f31)