summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | Eventscripts: remove unnecessary absolute paths from external commands.Martin Schwenke2011-08-038-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For eventscript unit testing it will be necessary to override external commands to allow stub implementations to be used. If absolute paths aren't used then this can be done using either a fake bin/ subdirectory or by using shell functions. This removes all of the simple cases of absolute paths. Signed-off-by: Martin Schwenke <martin@meltin.net> Conflicts: config/ctdb.init config/events.d/50.samba Keep old code but remove absolute paths. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 05851d50b0078de8bf4691442d718825adca6fe8)
| | * | | Eventscripts: new functions set_proc() and get_proc().Martin Schwenke2011-08-031-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These provide a thin layer around writing and reading files in /proc. They can be easily replaced by stubs for unit testing. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 637f9d8af517b73c72ed8f3cc2a2661f11eb2126)
| | * | | Eventscripts: remove ctdb_wait_command() and ctdb_wait_tcp_ports() functions.Martin Schwenke2011-08-031-59/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These haven't been used for a long time. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f5fd361cadb3ea18d29e2d7215a7853718e48d00)
| | * | | Eventscripts: iptables() should put lock in $CTDB_VARDIR.Martin Schwenke2011-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3f04793f391c63b78ffb9c9851ab3f0daf3ed50a)
| | * | | Make Emacs recognise that the eventscript functions file is a shell script.Martin Schwenke2011-08-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a6dfb76cfa759f6f9409f24368111c4f85ca0fbf)
| | * | | Eventscript functions: add $CTDB_ETCDIR and hook service() functions.Martin Schwenke2011-08-031-29/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * $CTDB_ETCDIR defaults to /etc but can be changed for testing. All hard-coded instances of /etc have been changed to $CTDB_ETCDIR. This includes references to /etc/init.d and /etc/sysconfig. * service() and nice_service() functions now call new function _service(). This makes it easier to override these functions (say, in rc.local) for testing and call most of the existing functionality using _service(). Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f43c9a7604b779bb6257ddb2bf3cbe266d496a63)
| | * | | Set $CTDB_VARDIR in the functions file.Martin Schwenke2011-08-033-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be needed when eventscripts that use it are called externally. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ebd53b66b0cc66d9d04830781886234167fc2164)
| * | | | Merge remote branch 'martins/test_suite'Ronnie Sahlberg2011-08-105-91/+43
| |\ \ \ \ | | |_|/ / | |/| | / | | | |/ | | |/| (This used to be ctdb commit 92eac08764e87bd3042d2a24ed36b2a339a04960)
| | * | Test suite: print debug output after cluster (un)healthy flip-flop on restart.Martin Schwenke2011-08-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0e14213dfa841080c07fa6fce23b192493adb926)
| | * | Allow proxy_node to be specified for wait_until_node_has_status().Martin Schwenke2011-08-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Default to "any"... but allow specification because sometimes it matters... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c12c97598afcd07ce4876b26e0b734bc825e54c1)
| | * | Test suite: Fix consistency in 26_ctdb_config_check_error_on_unreachable.Martin Schwenke2011-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test currently waits until any node thinks that the test node is disconnected, and then uses node 0 as a proxy for testing. However, nodes may notice at different times that a node is disconnected, so this test can fail unnecessarily. We force the proxy node for the wait-until-disconnected to be the same as the proxy node used to launch the actual tests. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 73cfc304513358e99e6505c95f44a4d319201309)
| | * | Test suite: Fix consistency in 09_ctdb_ping.sh.Martin Schwenke2011-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Same problem as described in commit 283a85b42d9c0a26acb64d5abcc7f175e31e6e75. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7758fd0591467a758e5d22404aa59fcbc1e1cb8b)
| | * | Test suite: Strip architecture suffix from CTDB RPM package version.Martin Schwenke2011-08-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Later versions of RPM seem to include it but we don't want it. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6c8eedb21a5e231d4a26ac26706ea51f348a27e0)
| | * | Test suite: remove getmonmode test.Martin Schwenke2011-08-081-59/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can't be made 100% reliable since the monitor mode can change underneath us due to some event. Therefore, the test is useless. Signed-off-by: Martin Schwenke <martin@meltin.net> Conflicts: tests/simple/20_ctdb_getmonmode.sh Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 98ccdc6241a73036c4f210bb510f1cb5cff588cc)
| | * | Test suite: Try much harder to get a healthy cluster when it is restarted.Martin Schwenke2011-08-081-29/+35
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 91e74cb01a11012e41ef9633c98f13ddbb2e5908)
| * | | io: Make queue_io_read() safe for reentryDavid Disseldorp2011-08-051-74/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | queue_io_read() may be reentered via the queue callback, recoverd is particularly guilty of this. queue_io_read() is not safe for reentry if more than one packet is received and partial chunks follow - data read off the pipe on re-entry is assumed to be the start-of-packet four byte length. This leads to a wrongly aligned stream and the notorious "Invalid packet of length 0" errors. This change fixes queue_io_read() to be safe under reentry, only a single packet is processed per call. https://bugzilla.samba.org/show_bug.cgi?id=8319 (This used to be ctdb commit 9ea41d2fab612772f861270c8a59c01c43bd3a4c)
| * | | Remove a log message about setting linkstate for an unknown interface.Ronnie Sahlberg2011-08-051-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sometimes we do want to try to set the linkstate for interfaces that are not in use by public addresses right now (but posisbly by other mechanisms) and these messages just spam the logs S1026357 (This used to be ctdb commit f2fe0a090a9650910ebe49514b3ca01dc593bea3)
| * | | remove log message we dont needRonnie Sahlberg2011-08-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | S1026492 (This used to be ctdb commit c5f6e44b92210519d4bfc24611cae3f9978cc2e5)
| * | | remove a non-error logmessage about persistent databases being healthy, as ↵Ronnie Sahlberg2011-08-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | expected S1026492 (This used to be ctdb commit da9e02085523e27fa29e35c60034f6a8aaaa81e8)
| * | | remove a log message we dont need about "allow clients to attach to databases"Ronnie Sahlberg2011-08-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | S1026492 (This used to be ctdb commit 42c3e4c5216000c370814441e38c7a8180047aaf)
| * | | Change the message when we start the daemon to "CTDB starting on node"Ronnie Sahlberg2011-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | S1026492 (This used to be ctdb commit 4dfe85dc19eea7b3382a005f63e1a3ef824aea90)
| * | | Merge remote branch 'martins/test_suite'Ronnie Sahlberg2011-08-034-18/+76
| |\| | | | | | | | | | | | | | (This used to be ctdb commit 113c763f15ab1db3810f40504b60bab5d3f2f212)
| | * | Test suite: when the cluster flip-flops (un)healthy, using "ctdb status -Y".Martin Schwenke2011-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d3dc9410501767c07d9b0106bb73c979d869c127)
| | * | Test suite: Print debug info from cluster nodes when time jumps occur.Martin Schwenke2011-08-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 21cdc7ed6942238faeb42983c862d4abc3f54ffb)
| | * | Test suite: Add debug for cluster (un)healthy flip-flop after restart.Martin Schwenke2011-08-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're seeing the cluster become healthy after a restart and then revert to being unhealthy. It looks like there's a race and the cluster shouldn't have been healthy, given that we seem to see that the monitor cycle hasn't yet been run. This collects some state debug info from all nodes after the cluster becomes healthy. This is printed if the cluster is then unexpectedly unhealthy a short time later. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c2efb5897e4258df649149f9904d7ac47322e1b4)
| | * | Test suite: add more debug to time jump post mortem.Martin Schwenke2011-08-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit fed3c2b80b8add8d1cf33abdd5dd8d8001af44d4)
| | * | Test suite: add automated checking of time logs.Martin Schwenke2011-08-031-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This depends on the format of onnode output and also depends on simple/00_ctdb_onnode.sh having been run. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 93b53b186df55942bf4d9e90cae329f47889af72)
| | * | Test suite: make time log use seconds since epoch.Martin Schwenke2011-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Easier to implement automatic checking. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 18db530880849b59445d7aa508bf218bdd77ea1c)
| | * | Test suite: CTDB_SAMBA_SKIP_SHARE_CHECK test now uses _loadconfig().Martin Schwenke2011-08-031-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 651e6703b6dc4d11ba7d6d0b44d3be1f485a0f75)
| | * | Test suite: CTDB_NFS_SKIP_SHARE_CHECK test now uses _loadconfig().Martin Schwenke2011-08-031-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The manual replacement of loadconfig() had bit rotted and no longer worked. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit bf23e7166385d305c6860b37c120f70a9aa33aa5)
| | * | Test suite: make time logging only happen on a real cluster, not local daemons.Martin Schwenke2011-08-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a6b3a7b7db9aa5fc971aae11b9b012e72c7d240c)
| | * | Test suite: add time logging.Martin Schwenke2011-08-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're seeing some weirdness with CTDB controls timing out. We're wondering if time is jumping forward, so this creates a time log on each node that we can examine later if tests fail weirdly. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 5d82d89ee99f10bead101aebda645a80435ba246)
| * | | Merge remote branch 'martins/onnode_tests'Ronnie Sahlberg2011-08-0322-8/+919
| |\| | | | | | | | | | | | | | (This used to be ctdb commit 0384f1902bb64d6683b689de226fff4e54331c24)
| | * | Tests: eventscripts and onnode tests use stubs/ subdirectory instead of bin/.Martin Schwenke2011-08-035-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This sets up a more useful convention and avoids future .gitignore problems. Resolved conflict while cherry-picking this: Don't take the eventscripts files for this branch. We'll put them elsewhere. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a9879e37d4e3bb714ef6c0c4144c6949daec0b53)
| | * | Tests: run_tests script no longer prints filename in summary descriptions.Martin Schwenke2011-08-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If filenames should be printed in descriptions in the summary then the descriptions should include the filename. A better option is to include something more human-readable that makes the test just as easily identifiable. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0efdbd61bdc2343e5459959b300bccc9986b1d78)
| | * | Tests: onnode tests changed to use a simple define_test() function.Martin Schwenke2011-08-0315-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes global changes easier. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3af086398fecb5f7c501190f9620b9c7b201f0ca)
| | * | Tests: add initial onnode testsMartin Schwenke2011-08-0321-0/+873
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add some simple tests for the onnode command. These use fake ssh and ctdb commands that are added to $PATH. The infrastructure used is quite flexible and would allow more complex tests to be written. As-is, these tests expose some bugs in the an older version of onnode that is included so it can be used to validate some of the tests. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f7f9d0943474cb2de7832d7ca95210ea9e9c772b)
| | * | Tests: change output format of run_tests script and add -q optionMartin Schwenke2011-08-031-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Putting PASSED/FAILED on the left makes it easier to scan the results and simplifies the code. Also put starts around the word "*FAILED*" to make it more obvious. Also add a -q option to throw away test output and only display the summary (if -s is also specified). Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c44b632b010b7d57007f3c8f294271c7e0217e0d)
| | * | Test suite: add a -d option to the run_tests script.Martin Schwenke2011-08-031-2/+17
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | This causes summary lines (when used with -s) to be pretty printed and include the test description. This is the 4th line of the test output - that is, immediately after the header. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0e5cc2a58b0d38e10a2ef9e81dc887c20f3fbdcb)
| * | Merge remote branch 'martins/lcp2_sim'Ronnie Sahlberg2011-08-036-164/+592
| |\ \ | | | | | | | | | | | | (This used to be ctdb commit cc9a09b2cbe300ad5848932b9273270ad50ea6b0)
| | * | IP allocation simulation - Pad IPv4 addresses in LCP2 algorithm.Martin Schwenke2011-07-291-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes IPv4 addresses comparable with IPv6 but reduces the overall effectiveness of the algorithm. The alternative would be to treat these addresses separately while trying to keep all the IPs in overall balance... which is basically the problem that LCP2 solves. :-) Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3a7624f9d468b99714a7b6a45313f9e7f66011ed)
| | * | IP allocation simulation - make stats label for LCP2 imbalance more meaningful.Martin Schwenke2011-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This time in the stats summary. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit aabb2507dacc63ae026e6c99704a2fb79950e82c)
| | * | IP allocation simulation - make stats label for LCP2 imbalance more meaningful.Martin Schwenke2011-07-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 721a06e28bacf9e03fd8eb4aff53dd17c363ffa1)
| | * | IP allocation simulation - add examples.Martin Schwenke2011-07-295-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 8a1ae0c5a3aa788ed0f29c264249ba7bc5d226a7)
| | * | IP allocation simulation - tighten up termination condition for -x.Martin Schwenke2011-07-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there are IP groups, do not terminate when the overall cluster goes out of balance. Also make explicit that grat_ip_moves is an integer not a boolean, so only terminate if it is greater than 0. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0899f14b1483682d73d1ee2d2419db54ffeadc4b)
| | * | IP allocation simulation - fix documentation for diff() function.Martin Schwenke2011-07-291-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It had out-of-date information and a typo. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 5d0d2b8b528414c859da0e6fd5959321db33608b)
| | * | IP allocation simulation - add mean imbalance statistics.Martin Schwenke2011-07-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b541194d6075e5db72fb691fb79dc81659771cb1)
| | * | IP allocation simulation - add -A/--aggressive option.Martin Schwenke2011-07-291-16/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is likely to cause many more state changes for nodes. In this mode the odds of a failover are applied to determine whether a state change occurs for each node. If no state change occurs then the process is repeated. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b7c42bff9457ec8294b04245af8e3b6010707d1a)
| | * | IP allocation simulation - add LCP2 imbalance metric to node state output.Martin Schwenke2011-07-291-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Print the LCP imbalance metric after the list of IPs. To make this more sensible, but most of the printing logic into the Node class. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 2e680e6b421d72cf2d217d3c3c1564da0bb19633)
| | * | IP allocation simulation - add analysis of IP groups.Martin Schwenke2011-07-291-22/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The public addresses passed to the node constructer can be nested 2 levels. Each sub-list is an IP group for which separate balance analysis is done. However, the public address list is flattened and the actual IP assignment algorithm doesn't know about IP groups. This allows extra statistics to be printed and an extra termination condition to be added for unbalanced IP groups. Most code from calculate_imbalance() is factored out to a a new function imbalance_for_ips(), which calculates imbalance for the given IPs. calculate_imbalance() now returns the overall imbalance and a list containing imbalances for each IP group. To support this node_ip_coverage() now takes an optional list of IPs to check coverage within. This also adds extra output to show statistics for the LCP2 imbalance metric. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 701395087156b2a5c7be1564897b796df35b69ec)