summaryrefslogtreecommitdiff
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-daemon: Replace an unsafe strcpy(3) callMartin Schwenke2016-03-221-2/+6
| | | | | | | Tweak another strncpy(3) call. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Jeremy Allison <jra@samba.org>
* ctdb-daemon: Validate length of new interface namesMartin Schwenke2016-03-221-0/+5
| | | | | | | | | Interface names that are too long will be truncated by strncpy(3) later on. It is better to validate the length of each new interface name to ensure it will be usable. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Jeremy Allison <jra@samba.org>
* ctdb: Fix CID 1356313 Explicit null dereferencedVolker Lendecke2016-03-181-6/+8
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ctdb-tests: Add a utility to parse ctdb packetsAmitay Isaacs2016-03-172-0/+113
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Thu Mar 17 13:56:41 CET 2016 on sn-devel-144
* ctdb-protocol: Add protocol debug routinesAmitay Isaacs2016-03-173-0/+656
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Check header is not null before copyingAmitay Isaacs2016-03-173-9/+27
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Increase the timeout for TRANS3_COMMIT controlAmitay Isaacs2016-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | On a busy system, TRANS3_COMMIT control can take upto or longer than 3 seconds. On timeout, there are few possible outcomes. 1. The transaction has completed on all nodes and TRANS3_COMMIT control has returned. In such a case, there is no problem. 2. The transaction has completed on the local node, but TRANS3_COMMIT control is still active. In such a case, ctdb_transaction_commit() can return successfully. If this is being called from ctdb, then ctdb will exit. This will cause ctdb daemon to trigger recovery since the client exited while transaction is active. This will cause unnecessary recovery. 3. Database recovery was started and ctdb_transaction_commit() will retry till the recovery completes the transaction. Increasing the timeout to 30 seconds will avoid the spurious database recoveries when TRANS3_COMMIT control takes longer to finish. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Mar 11 19:59:53 CET 2016 on sn-devel-144
* ctdb-tunables: Mark tunable DeferredRebalanceOnNodeAdd obsoleteMartin Schwenke2016-03-101-1/+1
| | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Thu Mar 10 06:51:46 CET 2016 on sn-devel-144
* ctdb-recoverd: Drop use of DeferredRebalanceOnNodeAdd tunableMartin Schwenke2016-03-101-32/+0
| | | | | | | | | | | | | If set, this was used to setup an IP takeover run on a timer after certain updates to the public IP address configuration (e.g. "ctdb addip"). However, "ctdb reloadips" completely manages public IP reconfiguration and avoids the anomalies that DeferredRebalanceOnNodeAdd was introduced to work around. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Drop "ctdb rebalancenode"Martin Schwenke2016-03-102-49/+0
| | | | | | | | | This was a workaround for trying to ensure public IP addresses are properly rebalanced after running "ctdb addip" on multiple nodes. "ctdb reloadips" is a better solution. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Drop "ctdb rebalanceip"Martin Schwenke2016-03-103-79/+2
| | | | | | | | | | This is undocumented and is not needed. It was a workaround for trying to ensure public IP addresses are properly rebalanced after running "ctdb addip" on multiple nodes. "ctdb reloadips" is a better solution. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-doc: Drop outdated NEWS fileMartin Schwenke2016-03-102-355/+1
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-doc: Update ctdb man pageAmitay Isaacs2016-03-101-34/+50
| | | | | | | Update ctdb statistics and ctdb dbstatistics output. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-doc: Update ctdb man pageAmitay Isaacs2016-03-101-12/+26
| | | | | | | Do not use obsolete tunables in examples. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tunables: Fix the implementation of LIST_TUNABLES controlAmitay Isaacs2016-03-101-8/+10
| | | | | | | Do not assume the first tunable is not obsolete. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-recovery-helper: Get tunables first, so control timeout can be setAmitay Isaacs2016-03-101-46/+51
| | | | | | | | | During the recovery process, the timeout value for sending all controls is decided by RecoverTimeout tunable. So in the recovery process, first get the tunables, so the control timeout gets set correctly. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-doc: Add documentation for missing tunablesAmitay Isaacs2016-03-101-0/+55
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-doc: Update tunables documentationAmitay Isaacs2016-03-101-124/+123
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tunables: Mark tunable ReclockPingPeriod obsoleteAmitay Isaacs2016-03-101-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tunables: Mark tunable MaxRedirectCount obsoleteAmitay Isaacs2016-03-102-20/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tunables: Add missing flags in the initializerAmitay Isaacs2016-03-101-5/+5
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-doc: Sort the tunable variables in alphabetical orderAmitay Isaacs2016-03-101-326/+332
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Add a new NFS tickle test for the releasing nodeMartin Schwenke2016-03-101-0/+69
| | | | | | | | | Current NFS and CIFS tickle tests do not test the killtcp functionality on the releasing node. 2-way killing is done for NFS, so this test explicitly looks for packets from the releasing node. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Allow tcptickle_sniff_wait_show() to filter by MAC addressMartin Schwenke2016-03-101-2/+19
| | | | | | | | | tcpdump does not support filtering on MAC address when reading from a file. Therefore, this is implemented by conditionally using grep to filter the output of tcpdump. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Re-indent and re-format some functionsMartin Schwenke2016-03-101-22/+25
| | | | | | | This makes the next commit much easier to read. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Fix CIFS tickle testMartin Schwenke2016-03-101-18/+12
| | | | | | | | | | There's a tiny chance that the connection information may not be transferred to other nodes quickly enough, so add an explicit wait. Also clean up the description and recognise that it is the takeover node that does the tickling. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Fix description of NFS tickle testMartin Schwenke2016-03-101-15/+4
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-packaging: Set --libexecdir in RPM spec fileMartin Schwenke2016-03-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | If the files section uses %{_libexecdir} then CTDB must also be configured to build and install with the same path, otherwise rpmbuild can fail due to a mismatch. "rpmbuild --showrc" indicates that the default %configure command sets: --libexecdir=%{_libexecdir} \ A mismatch will occur on SUSE systems, where SLES 12 and OpenSUSE 12 set _libexecdir to %{_exec_prefix}/lib. The failure was initially seen when testing on Debian where _libexecdir is set to %{_prefix}/lib/x86_64-linux-gnu, though Debian is an unlikely platform for building RPMs... Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Mon Mar 7 14:43:15 CET 2016 on sn-devel-144
* ctdb-locking: Use real-time only for actual record or DB lockingAmitay Isaacs2016-03-071-5/+22
| | | | | | | | | | | | | Use real-time priority only for obtaining record and database locks. Do not open databases with real-time priority as it can cause thundering herd on fcntl lock while opening tdb database. Also relinquish real-time priority after the lock is obtained. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Mon Mar 7 11:29:00 CET 2016 on sn-devel-144
* ctdb-takeover: Inform clients when dropping all IP addressesAmitay Isaacs2016-03-071-0/+11
| | | | | | | | | CTDB releases all IPs in following cases: starting up, shutting down, node gets banned, node does not come out of recovery for a long time. Always inform samba when CTDB releases IP addresses. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-takeover: Do not kill smbd processes on releasing IPAmitay Isaacs2016-03-071-42/+0
| | | | | | | | CTDB already notifies Samba with RELEASE_IP message. Samba can take appropriate action based on that. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-packaging: Drop changelog section from RPM spec fileMartin Schwenke2016-03-071-793/+0
| | | | | | | | | | This is unmaintained and misleading. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Mon Mar 7 05:00:15 CET 2016 on sn-devel-144
* ctdb-common: For AF_PACKET socket types, protocol is in network orderAmitay Isaacs2016-03-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11770 From man page of packet(7): protocol is the IEEE 802.3 protocol number in network byte order. See the <linux/if_ether.h> include file for a list of allowed protocols. When protocol is set to htons(ETH_P_ALL), then all protocols are received. Protocol argument was changed from network order to host order wrongly in commit 9f8395cb7d49b63a82f75bf504f5f83920102b29. Specifying "protocol" field to socket(AF_PACKET, ...) call only affects the packets that are recevied. So use protocol = 0 when sending raw packets. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Mar 4 12:58:50 CET 2016 on sn-devel-144
* ctdb-tests: Override local daemon configuration from the environmentMartin Schwenke2016-03-011-0/+4
| | | | | | | | | | | | | | | | | Anything starting with CTDB_ is appended to each node's configuration file. This is made slightly more difficult because the "env" command doesn't necessarily quote values for consumption by the shell. The strategy used here is a bit fragile (assumes double-quotes, no nested quotes) but this is test code and only developers are expected to use this override. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Tue Mar 1 08:56:09 CET 2016 on sn-devel-144
* ctdb-tests: Change local daemon startup to use ctdbd_wrapperMartin Schwenke2016-03-011-8/+26
| | | | | | | | This uses a configuration file which can be more easily overridden that explicit command-line options. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Simplify handling of public addresses for local daemonsMartin Schwenke2016-03-011-9/+7
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Allow configuration file to be overriddenMartin Schwenke2016-03-011-1/+1
| | | | | | | For testing only (so not documented), set CTDBD_CONF. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: Fix detection of gnukfreebsdSteven Chamberlain2016-03-011-1/+1
| | | | | | | | | | GNU/kFreeBSD's platform name is 'gnukfreebsd', not just 'kfreebsd'. Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Tue Mar 1 05:42:23 CET 2016 on sn-devel-144
* ctdb: Drop unnecessary defines of TEVENT_DEPRECATEDMartin Schwenke2016-02-263-7/+0
| | | | | | | | | | | | | These have been scattered around the code so that tevent_loop_allow_nesting() can be called. However, only the main daemon and some tests currently use nested event loops. TEVENT_DEPRECATED is already defined in the places where it is needed. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Fri Feb 26 07:11:29 CET 2016 on sn-devel-144
* ctdb-client: Add missing initialisation of calldataAmitay Isaacs2016-02-241-0/+1
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Wed Feb 24 11:57:23 CET 2016 on sn-devel-144
* ctdb-client: Keep trying to migrate till record lock is obtainedAmitay Isaacs2016-02-241-1/+3
| | | | | | | | | If a record is not on a local node, then it is migrated from remote node. However, before the client can get a lock on the record, it's possible for the record to get migrated away. In that case, repeat migration. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Remove TALLOC_CTX argument from sync functionsAmitay Isaacs2016-02-242-8/+18
| | | | | | | There is no allocated memory returned from these functions. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Add async version of set/remove message handler functionsAmitay Isaacs2016-02-242-0/+197
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Add sync API for waiting for recoveryAmitay Isaacs2016-02-242-0/+28
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Drop TALLOC_CTX argument from ctdb_attachAmitay Isaacs2016-02-242-2/+11
| | | | | | | | The database context returned is allocated off the client and is not allocated from user-supplied TALLOC_CTX. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Add new API for ctdb_client_wait_timeout()Amitay Isaacs2016-02-242-0/+46
| | | | | | | This is similar to ctdb_client_wait() with additional timeout argument. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Do not use sync functions in async computationAmitay Isaacs2016-02-241-21/+71
| | | | | | | This leads to nested event loops. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-client: Do not use sync functions in async computationAmitay Isaacs2016-02-241-24/+39
| | | | | | | This leads to nested event loops. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-recovery: Limit scope of reclock latency statisticsMartin Schwenke2016-02-231-4/+4
| | | | | | | | | | | | | | | | | | | | It does not make sense to update this statistic for the timeout case, since this could skew the statistic. To keep it simple, just update it for the usual case where there is lock contention, since this is the usual case. So the daemon statistic measures time to test the lock and the corresponding recovery daemon statistic measures time to take the lock. Additionally, the recovery daemon will eventually use this code to take the lock, and the method of updating the latency statistic will need to be pushed further out to a configurable handler that depends on the calling context. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Tue Feb 23 10:32:06 CET 2016 on sn-devel-144
* ctdb-recovery: Negate the status when checking the recovery lockMartin Schwenke2016-02-231-5/+5
| | | | | | | | | | | | | | Have 0 indicate that the lock was taken. This allows non-zero values to be used to indicate why the lock could not be taken. EACCES means lock contention. For now use just EACCES to cover all failures, since ctdb_recovery_lock() returns a bool and details of other errors will be lost. ctdb_recovery_lock() will undergo some big changes, so don't try to fix this now. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>