[SCM] Samba Shared Repository - branch v4-4-test updated
Karolin Seeger
kseeger at samba.org
Thu Jun 9 14:48:06 UTC 2016
The branch, v4-4-test has been updated
via 8acad0e ctdb-recoverd: Avoid duplicate recoverd event in parallel recovery
via fb89732 lib: replace: snprintf - Fix length calculation for hex/octal 64-bit values.
via 4f28e53 ctdb-packaging: Remove tevent-unix-util public library
via f41a550 lib/util: Avoid splitting tevent-unix-util as public library
via 53e55bc ctdb-recovery-helper: Add banning to parallel recovery
via 05a41ad ctdb-recoverd: Add message handler to assigning banning credits
via 24ed0a4 ctdb-protocol: Add srvid for assigning banning credits
via 8d67216 ctdb-daemon: Reset push_started flag once DB_PUSH_CONFIRM is done
via 4b268d0 ctdb-recovery: Update timeout and number of retries during recovery
via 9449b7e ctdb-recovery-helper: Introduce new #define variable
via 10b5961 ctdb-recovery-helper: Improve log message
via 9e7d0c9 ctdb-tests: Add a test for recovery of large databases
via 4b4b870 ctdb-recovery-helper: Introduce push database abstraction
via 406da1e ctdb-recovery-helper: Introduce pull database abstraction
via 5fbc339 ctdb-protocol: Add new capability
via d00deab ctdb-protocol: Add srvid for messages during recovery
via 314a5d5 ctdb-recovery-helper: Write recovery records to a recovery file
via 77257d9 ctdb-recovery-helper: Re-factor function to retain records from recdb
via 7785a9f ctdb-protocol: Add file IO functions for ctdb_rec_buffer
via e1fe4d2 ctdb-recovery-helper: Create accessors for recdb structure fields
via 2543f15 ctdb-recovery-helper: Rename pnn to dmaster in recdb_records()
via e455727 ctdb-recovery-helper: Pass capabilities to database recovery functions
via 715714d ctdb-recovery-helper: Factor out generic recv function
via e8c9c8f ctdb-client: Add client API functions for new controls
via 6c497e4 ctdb-daemon: Implement new controls DB_PULL and DB_PUSH_START/DB_PUSH_CONFIRM
via 24c8068 ctdb-protocol: Add new controls DB_PULL and DB_PUSH_START/DB_PUSH_CONFIRM
via d0c4375 ctdb-protocol: Add new data type ctdb_pulldb_ext for new control
via ea98f51 ctdb-tunables: Add new tunable RecBufferSizeLimit
via c35deed ctdb-client: Add client API for sending message to multiple nodes
via 677fc74 ctdb-recovery-helper: Get tunables first, so control timeout can be set
via 15fc4e8 ctdb-doc: Add documentation for missing tunables
via 83b92a8 ctdb-doc: Update tunables documentation
via 070c51f ctdb-doc: Sort the tunable variables in alphabetical order
via 4c77c02 ctdb-client: Add async version of set/remove message handler functions
via 9ca8891 ctdb-recovery: Add a log message when marshalling recovery database fails
via a33a783 ctdb-recovery: Create recovery databases in state dir
via 049bb18 ctdb-recoverd: Freeze databases whenever the node is INACTIVE
from e9ea633 VERSION: Bump version up to 4.4.5...
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-4-test
- Log -----------------------------------------------------------------
commit 8acad0e0f9bb73b70fc3b2fceef4fdf960239cad
Author: Amitay Isaacs <amitay at gmail.com>
Date: Wed Jun 8 14:15:22 2016 +1000
ctdb-recoverd: Avoid duplicate recoverd event in parallel recovery
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11956
In do_recovery, after the recovery and takeover is complete, recoverd
event is triggered. When the parallel database recovery was separated,
ctdb_recovery_helper implemented sending END_RECOVERY control which
causes recoverd event to be triggered. So when there is parallel database
recovery, recoverd event is triggered twice.
Instead move the call to run_recovered_eventscript() explicitly in
the serial recovery code path. This avoids the duplication trigger of
recoverd event.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit ecb74721e78942e66aaf2d2f88f141305e311328)
Autobuild-User(v4-4-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-4-test): Thu Jun 9 16:46:53 CEST 2016 on sn-devel-144
commit fb89732ce8831d3e6c9b26ef6148a7c758df95bb
Author: Lorinczy Zsigmond <lzsiga at freemail.c3.hu>
Date: Thu Jun 2 14:54:05 2016 -0700
lib: replace: snprintf - Fix length calculation for hex/octal 64-bit values.
Prevents truncation due to buffer size being too small.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11947
Signed-off-by: Lorinczy Zsigmond <lzsiga at freemail.c3.hu>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
Autobuild-User(master): Michael Adam <obnox at samba.org>
Autobuild-Date(master): Fri Jun 3 03:48:58 CEST 2016 on sn-devel-144
(cherry picked from commit 8814b2556583e1f8965e8bf5a93438d46e8d43e6)
commit 4f28e53e959cf931d9e191b769b9a013217c6ada
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Jun 2 17:59:16 2016 +1000
ctdb-packaging: Remove tevent-unix-util public library
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11946
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
(cherry picked from commit 97e1f53daeb1edf7f0a337c38dd9f8d7d8e36321)
commit f41a55029aabc5844e23ac8d1d946e3b27999877
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Jun 2 17:17:19 2016 +1000
lib/util: Avoid splitting tevent-unix-util as public library
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11946
Commit 670db6ac1d678babd25dd82c4467c0f094cfabc5 split tevent-util public
library to create tevent-unix-util public library for standalone ctdb
use. This created a public library dependency between samba and ctdb
for packaging.
Bundle tevent_unix.c in public library tevent-util as before. However,
to avoid the dependencies for packaging, standalone ctdb build will
build tevent-util as a private library with only tevent_unix.c
This simplifies any new subsystems (or libraries) which need tevent-util
and are linked in both samba and ctdb.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
(cherry picked from commit 2082c0c3b5b62286d111d91c56541710ecc0ffa1)
commit 53e55bc06a97486942b007597fed1cd2b07476f1
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Mar 15 15:08:24 2016 +1100
ctdb-recovery-helper: Add banning to parallel recovery
If one or more nodes are misbehaving during recovery, keep track of
failures as ban_credits. If the node with the highest ban_credits exceeds
5 ban credits, then tell recovery daemon to assign banning credits.
This will ban only a single node at a time in case of recovery failure.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Fri Mar 25 06:57:32 CET 2016 on sn-devel-144
(cherry picked from commit c51b8c22349bde6a3280c51ac147cab5ea27b5a6)
The last 3 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11941
commit 05a41adec333adabe9892c6a7036c6796531a435
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Mar 17 17:26:30 2016 +1100
ctdb-recoverd: Add message handler to assigning banning credits
This will be called from recovery helper to assign banning credits to
misbehaving node.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit ae366fb932e9d42fbde5aa48f04d70e15dc36888)
commit 24ed0a4d89773aa3dbc504f2ab2df876362ef8e5
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Mar 17 17:16:09 2016 +1100
ctdb-protocol: Add srvid for assigning banning credits
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit fc63eae80b7b521598560b970a4ce10a0838a3ce)
commit 8d672166f6b9b60c49cd749a89b46e1ce28e05a2
Author: Amitay Isaacs <amitay at gmail.com>
Date: Wed Jun 8 15:04:52 2016 +1000
ctdb-daemon: Reset push_started flag once DB_PUSH_CONFIRM is done
Once DB_PUSH_START is processed as part of recovery, push_started
flag tracks if there are multiple attempts to send DB_PUSH_START.
In DB_PUSH_CONFIRM, once the record count is confirmed, all information
related to DB_PUSH should be reset. However, The push_started flag was
not reset when the push_state was reset.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Wed Jun 8 14:31:52 CEST 2016 on sn-devel-144
(cherry picked from commit c620bf5debd57a4a5d7f893a2b6383098ff7a919)
The last 29 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11940
commit 4b268d0afe2c556c34e4b202c3a7fb4c53e8d3f2
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Jun 2 18:27:29 2016 +1000
ctdb-recovery: Update timeout and number of retries during recovery
The timeout RecoverTimeout (default 120) is used for control messages
sent during the recovery. If any of the nodes does not respond to any
of the recovery control messages for RecoverTimeout seconds, then it
will cause a failure of recovery of a database. Recovery helper will
retry the recovery for a database 5 times.
In the worst case, if a database could not be recovered within 5 attempts,
a total of 600 seconds would have passed. During this time period other
timeouts will be triggered causing unnecessary failures as follows:
1. During the recovery, even though recoverd is processing events,
it does not send a ping message to ctdb daemon. If a ping message is
not received for RecdPingTimeout (default 60) seconds, then ctdb will
count it as unresponsive recovery daemon. If the recovery daemon
fails for RecdFailCount (default 10) times, then ctdb daemon will
restart recovery daemon. So after 600 seconds, ctdb daemon will
restart recovery daemon.
2. If ctdb daemon stays in recovery for RecoveryDropAllIPs (default 120),
then it will drop all the public addresses. This will cause all
SMB client to be disconnected unnecessarily. The released public
addresses will not be taken over till the recovery is complete.
To avoid dropping of IPs and restarting recovery daemon during a delayed
recovery, adjust RecoverTimeout to 30 seconds and limit number of
retries for recovering a database to 3. If we don't hear from a node
for more than 25 seconds, then the node is considered disconnected.
So 30 seconds is sufficient timeout for controls during recovery.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Mon Jun 6 08:49:15 CEST 2016 on sn-devel-144
(cherry picked from commit 93dcca2a5f7af9698c9ba1024dbce1d1a66d4efb)
commit 9449b7ed91cbe06f4d83f932dd4a4a0b6c4f71db
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Mar 17 14:22:17 2016 +1100
ctdb-recovery-helper: Introduce new #define variable
... instead of hardcoding number of retries.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit ad7a407a13b87ec13d94a808111d2583bfd1d217)
commit 10b5961b5e4a92c9db2fd3ae17241aff20a2c3c8
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Mar 17 14:13:02 2016 +1100
ctdb-recovery-helper: Improve log message
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit e5a714a3c29fd8fdebe0203e68c7ce19f54af2d3)
commit 9e7d0c901d6079db71224e8a47e5fea989b073e9
Author: Amitay Isaacs <amitay at gmail.com>
Date: Sat Mar 5 15:04:48 2016 +1100
ctdb-tests: Add a test for recovery of large databases
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit a7b8ee87fe1b58ffb9da02ae8e3959a385e628d9)
commit 4b4b87057b7ed83884d58622d369d76e41d87eaf
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Feb 25 18:07:11 2016 +1100
ctdb-recovery-helper: Introduce push database abstraction
This abstraction uses capabilities of the remote nodes to either send
older PUSH_DB controls or newer DB_PUSH_START and DB_PUSH_CONFIRM
controls.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit ffea827bae2a8054ad488ae82eedb021cdfb71c4)
commit 406da1ec2235a602f8f1af75433d2d2022f9035a
Author: Amitay Isaacs <amitay at gmail.com>
Date: Wed Feb 24 18:10:49 2016 +1100
ctdb-recovery-helper: Introduce pull database abstraction
This abstraction depending on the capability of the remote node either
uses older PULL_DB control or newer DB_PULL control.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit b96a4759b397d873d56ccdd0c0b26e770cc10b89)
commit 5fbc339a830f7cb2b445bd0890eebd13cb18c032
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Feb 23 14:52:51 2016 +1100
ctdb-protocol: Add new capability
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit bb6541b386c7dfcc6dcbbd4cea39dc1ff80fe578)
commit d00deab25b9807ad0fdcba06247fd9374ae1cb5d
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Feb 23 18:03:10 2016 +1100
ctdb-protocol: Add srvid for messages during recovery
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit c5776f0529dd23979dd3ef36ffe7d7b8eb444d0d)
commit 314a5d5eb8815187145f999de1ba5e7d3f180989
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Mar 8 18:32:19 2016 +1100
ctdb-recovery-helper: Write recovery records to a recovery file
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit e1fdfdd1c13b0a81e4d2e8b87aeb6f6bafef1a92)
commit 77257d9d71484dc9b01d42c8a61c2f0a6c74a782
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Mar 8 17:48:46 2016 +1100
ctdb-recovery-helper: Re-factor function to retain records from recdb
Also, rename traverse function and traverse state for recdb_records
consistently.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit 9058fe06df7f24e9a1b8fd5792a537a1fa8f5a60)
commit 7785a9f3386eabdfb0674c0327b81a15e88ea801
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Mar 8 17:20:30 2016 +1100
ctdb-protocol: Add file IO functions for ctdb_rec_buffer
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit 76f653f0bc016dfa98a4d8688469be4ac450a17a)
commit e1fe4d28ee424c14a187ac73c62aa38240a9abdd
Author: Amitay Isaacs <amitay at gmail.com>
Date: Mon Feb 29 13:53:52 2016 +1100
ctdb-recovery-helper: Create accessors for recdb structure fields
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit a80ff09ed3da49c544fb121ae88e3ccb351fc4e7)
commit 2543f154e959ed58e0783ba572c1738eab96c6d7
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Feb 26 15:42:53 2016 +1100
ctdb-recovery-helper: Rename pnn to dmaster in recdb_records()
This variable is used to set the dmaster value for each record in
recdb_traverse().
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit 70011a1bfb24d9f4b2a042d353f907ef7c49bc1c)
commit e455727f02c77434350e5bec0e2dced47bef850d
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Feb 25 11:04:51 2016 +1100
ctdb-recovery-helper: Pass capabilities to database recovery functions
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit 5b926d882e3cf63d4ad3a9714fd0d440d6b5f3e5)
commit 715714d7cb047392bd152dfb8d9e2756183f857c
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Feb 26 17:36:39 2016 +1100
ctdb-recovery-helper: Factor out generic recv function
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit 5f43f92796f4f8130067e23555f94842bb803fcf)
commit e8c9c8f581bf6a2dbb89c314e083ad01c8afee86
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Feb 19 11:14:40 2016 +1100
ctdb-client: Add client API functions for new controls
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit 338e0dccd903b63bf15ae9af38c47aad01c110d0)
commit 6c497e423b0c96ee25038ca5776e4de6fca87db8
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Feb 19 17:32:09 2016 +1100
ctdb-daemon: Implement new controls DB_PULL and DB_PUSH_START/DB_PUSH_CONFIRM
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit 95a15cde45c47e36d87d54464bcd769ee96e43c2)
commit 24c80689cced1ffdfc632c8f60854af1c370cad9
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Feb 19 10:54:15 2016 +1100
ctdb-protocol: Add new controls DB_PULL and DB_PUSH_START/DB_PUSH_CONFIRM
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit 0fd156ae8478f2da35a68c6bd3f90f50a06aecb8)
commit d0c4375f728020f2f2e0185d1ba9af36a7c5913b
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Feb 19 10:45:19 2016 +1100
ctdb-protocol: Add new data type ctdb_pulldb_ext for new control
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit fe69b72569494ef09dc8fa8673af02c0bfc18434)
commit ea98f516161d59ec5b38b4616cbe8ac3971424f2
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Mar 8 17:29:31 2016 +1100
ctdb-tunables: Add new tunable RecBufferSizeLimit
This will be used to limit the size of record buffer sent in newer
controls for recovery and existing controls for vacuuming.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit c41808e6d292ec4cd861af545478e7dfb5c448e8)
commit c35deedb83b22b531c805f961f09187091c203da
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Feb 26 14:12:19 2016 +1100
ctdb-client: Add client API for sending message to multiple nodes
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit 67799c73af486962b897d1841a8a4234fdee824b)
commit 677fc74f096b7f91bb1b784ffca375933735ce29
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Mar 8 14:51:59 2016 +1100
ctdb-recovery-helper: Get tunables first, so control timeout can be set
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 at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit 700f39372ad9c893f8eb8884cd24999dc7026e60)
commit 15fc4e870ad3c6e11673568eeb80c9319cb13ce9
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Mar 8 14:37:41 2016 +1100
ctdb-doc: Add documentation for missing tunables
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit 3680aba2126d967a5518ab2d35d9e6d3f338e75e)
commit 83b92a8c367af15c9adad1cb53ae53950cd20323
Author: Amitay Isaacs <amitay at gmail.com>
Date: Mon Mar 7 19:26:43 2016 +1100
ctdb-doc: Update tunables documentation
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit e2539088e023ad88d314467a6a42b52c0decba77)
commit 070c51f427fec3e1c7acd3b2d715c27068752df1
Author: Amitay Isaacs <amitay at gmail.com>
Date: Mon Mar 7 17:05:11 2016 +1100
ctdb-doc: Sort the tunable variables in alphabetical order
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit 4bf6cab4a1e1c11f79fde40fc8b9ae29b0f00e35)
commit 4c77c029ee7c90b844352ef20cd88d814b9d7049
Author: Amitay Isaacs <amitay at gmail.com>
Date: Wed Nov 18 15:11:37 2015 +1100
ctdb-client: Add async version of set/remove message handler functions
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit d23c5a6c2f365b249233f9a1c6d42d220b2b7c67)
commit 9ca8891e3353a75588352e82a8eeaafc0d24bde5
Author: Amitay Isaacs <amitay at gmail.com>
Date: Wed Feb 10 11:39:37 2016 +1100
ctdb-recovery: Add a log message when marshalling recovery database fails
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
(cherry picked from commit 157e19b9848c4745e2a9a2169e25698cfd4dcaa6)
commit a33a7831a1cfe5506a633814e4671c47d36816e0
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Feb 11 14:32:34 2016 +1100
ctdb-recovery: Create recovery databases in state dir
This matches the behaviour during serial database recovery.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Thu Feb 11 08:01:14 CET 2016 on sn-devel-144
(cherry picked from commit 19a411f839c5c34fec2aa5e6cb095346be56d94e)
commit 049bb18d28bea7001b761c7ed7e3fa3b291a087c
Author: Amitay Isaacs <amitay at gmail.com>
Date: Wed Jun 1 12:10:46 2016 +1000
ctdb-recoverd: Freeze databases whenever the node is INACTIVE
If the node becomes stopped or banned after recovery is marked
active, then it will never freeze the databases, and hence the
node will keep banning itself indefinitely, until ctdbd is restarted.
This is a regression from 4.3, introduced with
b4357a79d916b1f8ade8fa78563fbef0ce670aa9
and
d8f3b490bbb691c9916eed0df5b980c1aef23c85
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11945
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>
Autobuild-User(master): Michael Adam <obnox at samba.org>
Autobuild-Date(master): Wed Jun 1 17:36:12 CEST 2016 on sn-devel-144
(cherry picked from commit f8141e91a693912ea1107a49320e83702a80757a)
-----------------------------------------------------------------------
Summary of changes:
ctdb/client/client.h | 43 +
ctdb/client/client_control_sync.c | 86 ++
ctdb/client/client_message.c | 311 ++++++
ctdb/doc/ctdb-tunables.7.xml | 685 ++++++------
ctdb/include/ctdb_private.h | 11 +
ctdb/packaging/RPM/ctdb.spec.in | 3 -
ctdb/protocol/protocol.h | 24 +-
ctdb/protocol/protocol_api.h | 18 +
ctdb/protocol/protocol_client.c | 70 ++
ctdb/protocol/protocol_control.c | 68 ++
ctdb/protocol/protocol_message.c | 12 +
ctdb/protocol/protocol_private.h | 5 +
ctdb/protocol/protocol_types.c | 90 ++
ctdb/server/ctdb_control.c | 12 +
ctdb/server/ctdb_recover.c | 341 ++++++
ctdb/server/ctdb_recoverd.c | 63 +-
ctdb/server/ctdb_recovery_helper.c | 1375 ++++++++++++++++++++----
ctdb/server/ctdb_tunables.c | 3 +-
ctdb/tests/simple/78_ctdb_large_db_recovery.sh | 107 ++
ctdb/tests/src/protocol_client_test.c | 48 +
ctdb/tests/src/protocol_types_test.c | 67 ++
ctdb/wscript | 4 +-
lib/replace/snprintf.c | 6 +-
lib/util/wscript_build | 23 +-
24 files changed, 2897 insertions(+), 578 deletions(-)
create mode 100755 ctdb/tests/simple/78_ctdb_large_db_recovery.sh
Changeset truncated at 500 lines:
diff --git a/ctdb/client/client.h b/ctdb/client/client.h
index bce0c6b..eebb7a6 100644
--- a/ctdb/client/client.h
+++ b/ctdb/client/client.h
@@ -72,10 +72,38 @@ struct tevent_req *ctdb_client_message_send(TALLOC_CTX *mem_ctx,
bool ctdb_client_message_recv(struct tevent_req *req, int *perr);
+struct tevent_req *ctdb_client_message_multi_send(
+ TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ uint32_t *pnn_list, int count,
+ struct ctdb_req_message *message);
+
+bool ctdb_client_message_multi_recv(struct tevent_req *req, int *perr,
+ TALLOC_CTX *mem_ctx, int **perr_list);
+
int ctdb_client_message(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
struct ctdb_client_context *client,
uint32_t destnode, struct ctdb_req_message *message);
+struct tevent_req *ctdb_client_set_message_handler_send(
+ TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ uint64_t srvid,
+ srvid_handler_fn handler,
+ void *private_data);
+bool ctdb_client_set_message_handler_recv(struct tevent_req *req, int *perr);
+
+struct tevent_req *ctdb_client_remove_message_handler_send(
+ TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ uint64_t srvid,
+ void *private_data);
+bool ctdb_client_remove_message_handler_recv(struct tevent_req *req,
+ int *perr);
+
int ctdb_client_set_message_handler(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct ctdb_client_context *client,
@@ -709,6 +737,21 @@ int ctdb_ctrl_db_transaction_cancel(TALLOC_CTX *mem_ctx,
int destnode, struct timeval timeout,
uint32_t db_id);
+int ctdb_ctrl_db_pull(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ int destnode, struct timeval timeout,
+ struct ctdb_pulldb_ext *pulldb, uint32_t *num_records);
+
+int ctdb_ctrl_db_push_start(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ int destnode, struct timeval timeout,
+ struct ctdb_pulldb_ext *pulldb);
+
+int ctdb_ctrl_db_push_confirm(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ int destnode, struct timeval timeout,
+ uint32_t db_id, uint32_t *num_records);
+
/* from client/client_db.c */
struct tevent_req *ctdb_attach_send(TALLOC_CTX *mem_ctx,
diff --git a/ctdb/client/client_control_sync.c b/ctdb/client/client_control_sync.c
index de52b47..753007e 100644
--- a/ctdb/client/client_control_sync.c
+++ b/ctdb/client/client_control_sync.c
@@ -3117,3 +3117,89 @@ int ctdb_ctrl_db_transaction_cancel(TALLOC_CTX *mem_ctx,
return 0;
}
+
+int ctdb_ctrl_db_pull(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ int destnode, struct timeval timeout,
+ struct ctdb_pulldb_ext *pulldb, uint32_t *num_records)
+{
+ struct ctdb_req_control request;
+ struct ctdb_reply_control *reply;
+ int ret;
+
+ ctdb_req_control_db_pull(&request, pulldb);
+ ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout,
+ &request, &reply);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR,
+ ("Control DB_PULL failed to node %u, ret=%d\n",
+ destnode, ret));
+ return ret;
+ }
+
+ ret = ctdb_reply_control_db_pull(reply, num_records);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR, ("Control DB_PULL failed, ret=%d\n", ret));
+ return ret;
+ }
+
+ return 0;
+}
+
+int ctdb_ctrl_db_push_start(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ int destnode, struct timeval timeout,
+ struct ctdb_pulldb_ext *pulldb)
+{
+ struct ctdb_req_control request;
+ struct ctdb_reply_control *reply;
+ int ret;
+
+ ctdb_req_control_db_push_start(&request, pulldb);
+ ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout,
+ &request, &reply);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR,
+ ("Control DB_PUSH failed to node %u, ret=%d\n",
+ destnode, ret));
+ return ret;
+ }
+
+ ret = ctdb_reply_control_db_push_start(reply);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR,
+ ("Control DB_PUSH failed, ret=%d\n", ret));
+ return ret;
+ }
+
+ return 0;
+}
+
+int ctdb_ctrl_db_push_confirm(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ int destnode, struct timeval timeout,
+ uint32_t db_id, uint32_t *num_records)
+{
+ struct ctdb_req_control request;
+ struct ctdb_reply_control *reply;
+ int ret;
+
+ ctdb_req_control_db_push_confirm(&request, db_id);
+ ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout,
+ &request, &reply);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR,
+ ("Control DB_PUSH failed to node %u, ret=%d\n",
+ destnode, ret));
+ return ret;
+ }
+
+ ret = ctdb_reply_control_db_push_confirm(reply, num_records);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR,
+ ("Control DB_PUSH failed, ret=%d\n", ret));
+ return ret;
+ }
+
+ return 0;
+}
diff --git a/ctdb/client/client_message.c b/ctdb/client/client_message.c
index bfa9ba2..8c75548 100644
--- a/ctdb/client/client_message.c
+++ b/ctdb/client/client_message.c
@@ -157,6 +157,138 @@ void ctdb_client_req_message(struct ctdb_client_context *client,
}
/*
+ * Handle multiple nodes
+ */
+
+struct ctdb_client_message_multi_state {
+ uint32_t *pnn_list;
+ int count;
+ int done;
+ int err;
+ int *err_list;
+};
+
+struct message_index_state {
+ struct tevent_req *req;
+ int index;
+};
+
+static void ctdb_client_message_multi_done(struct tevent_req *subreq);
+
+struct tevent_req *ctdb_client_message_multi_send(
+ TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ uint32_t *pnn_list, int count,
+ struct ctdb_req_message *message)
+{
+ struct tevent_req *req, *subreq;
+ struct ctdb_client_message_multi_state *state;
+ int i;
+
+ if (pnn_list == NULL || count == 0) {
+ return NULL;
+ }
+
+ req = tevent_req_create(mem_ctx, &state,
+ struct ctdb_client_message_multi_state);
+ if (req == NULL) {
+ return NULL;
+ }
+
+ state->pnn_list = pnn_list;
+ state->count = count;
+ state->done = 0;
+ state->err = 0;
+ state->err_list = talloc_zero_array(state, int, count);
+ if (tevent_req_nomem(state->err_list, req)) {
+ return tevent_req_post(req, ev);
+ }
+
+ for (i=0; i<count; i++) {
+ struct message_index_state *substate;
+
+ subreq = ctdb_client_message_send(state, ev, client,
+ pnn_list[i], message);
+ if (tevent_req_nomem(subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
+
+ substate = talloc(subreq, struct message_index_state);
+ if (tevent_req_nomem(substate, req)) {
+ return tevent_req_post(req, ev);
+ }
+
+ substate->req = req;
+ substate->index = i;
+
+ tevent_req_set_callback(subreq, ctdb_client_message_multi_done,
+ substate);
+ }
+
+ return req;
+}
+
+static void ctdb_client_message_multi_done(struct tevent_req *subreq)
+{
+ struct message_index_state *substate = tevent_req_callback_data(
+ subreq, struct message_index_state);
+ struct tevent_req *req = substate->req;
+ int idx = substate->index;
+ struct ctdb_client_message_multi_state *state = tevent_req_data(
+ req, struct ctdb_client_message_multi_state);
+ bool status;
+ int ret;
+
+ status = ctdb_client_message_recv(subreq, &ret);
+ TALLOC_FREE(subreq);
+ if (! status) {
+ if (state->err == 0) {
+ state->err = ret;
+ state->err_list[idx] = state->err;
+ }
+ }
+
+ state->done += 1;
+
+ if (state->done == state->count) {
+ tevent_req_done(req);
+ }
+}
+
+bool ctdb_client_message_multi_recv(struct tevent_req *req, int *perr,
+ TALLOC_CTX *mem_ctx, int **perr_list)
+{
+ struct ctdb_client_message_multi_state *state = tevent_req_data(
+ req, struct ctdb_client_message_multi_state);
+ int err;
+
+ if (tevent_req_is_unix_error(req, &err)) {
+ if (perr != NULL) {
+ *perr = err;
+ }
+ if (perr_list != NULL) {
+ *perr_list = talloc_steal(mem_ctx, state->err_list);
+ }
+ return false;
+ }
+
+ if (perr != NULL) {
+ *perr = state->err;
+ }
+
+ if (perr_list != NULL) {
+ *perr_list = talloc_steal(mem_ctx, state->err_list);
+ }
+
+ if (state->err != 0) {
+ return false;
+ }
+
+ return true;
+}
+
+/*
* sync version of message send
*/
@@ -192,6 +324,185 @@ int ctdb_client_message(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
return 0;
}
+struct ctdb_client_set_message_handler_state {
+ struct ctdb_client_context *client;
+ uint64_t srvid;
+ srvid_handler_fn handler;
+ void *private_data;
+};
+
+static void ctdb_client_set_message_handler_done(struct tevent_req *subreq);
+
+struct tevent_req *ctdb_client_set_message_handler_send(
+ TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ uint64_t srvid,
+ srvid_handler_fn handler,
+ void *private_data)
+{
+ struct tevent_req *req, *subreq;
+ struct ctdb_client_set_message_handler_state *state;
+ struct ctdb_req_control request;
+
+ req = tevent_req_create(mem_ctx, &state,
+ struct ctdb_client_set_message_handler_state);
+ if (req == NULL) {
+ return NULL;
+ }
+
+ state->client = client;
+ state->srvid = srvid;
+ state->handler = handler;
+ state->private_data = private_data;
+
+ ctdb_req_control_register_srvid(&request, srvid);
+ subreq = ctdb_client_control_send(state, ev, client, client->pnn,
+ tevent_timeval_zero(), &request);
+ if (tevent_req_nomem(subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
+ tevent_req_set_callback(subreq, ctdb_client_set_message_handler_done,
+ req);
+
+ return req;
+}
+
+static void ctdb_client_set_message_handler_done(struct tevent_req *subreq)
+{
+ struct tevent_req *req = tevent_req_callback_data(
+ subreq, struct tevent_req);
+ struct ctdb_client_set_message_handler_state *state = tevent_req_data(
+ req, struct ctdb_client_set_message_handler_state);
+ struct ctdb_reply_control *reply;
+ bool status;
+ int ret;
+
+ status = ctdb_client_control_recv(subreq, &ret, state, &reply);
+ TALLOC_FREE(subreq);
+ if (! status) {
+ tevent_req_error(req, ret);
+ return;
+ }
+
+ ret = ctdb_reply_control_register_srvid(reply);
+ talloc_free(reply);
+ if (ret != 0) {
+ tevent_req_error(req, ret);
+ return;
+ }
+
+ ret = srvid_register(state->client->srv, state->client, state->srvid,
+ state->handler, state->private_data);
+ if (ret != 0) {
+ tevent_req_error(req, ret);
+ return;
+ }
+
+ tevent_req_done(req);
+}
+
+bool ctdb_client_set_message_handler_recv(struct tevent_req *req, int *perr)
+{
+ int err;
+
+ if (tevent_req_is_unix_error(req, &err)) {
+ if (perr != NULL) {
+ *perr = err;
+ }
+ return false;
+ }
+ return true;
+}
+
+struct ctdb_client_remove_message_handler_state {
+ struct ctdb_client_context *client;
+ uint64_t srvid;
+ void *private_data;
+};
+
+static void ctdb_client_remove_message_handler_done(struct tevent_req *subreq);
+
+struct tevent_req *ctdb_client_remove_message_handler_send(
+ TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ uint64_t srvid,
+ void *private_data)
+{
+ struct tevent_req *req, *subreq;
+ struct ctdb_client_remove_message_handler_state *state;
+ struct ctdb_req_control request;
+
+ req = tevent_req_create(mem_ctx, &state,
+ struct ctdb_client_remove_message_handler_state);
+ if (req == NULL) {
+ return NULL;
+ }
+
+ state->client = client;
+ state->srvid = srvid;
+ state->private_data = private_data;
+
+ ctdb_req_control_deregister_srvid(&request, srvid);
+ subreq = ctdb_client_control_send(state, ev, client, client->pnn,
+ tevent_timeval_zero(), &request);
+ if (tevent_req_nomem(subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
+ tevent_req_set_callback(subreq,
+ ctdb_client_remove_message_handler_done, req);
+
+ return req;
+}
+
+static void ctdb_client_remove_message_handler_done(struct tevent_req *subreq)
+{
+ struct tevent_req *req = tevent_req_callback_data(
+ subreq, struct tevent_req);
+ struct ctdb_client_remove_message_handler_state *state = tevent_req_data(
+ req, struct ctdb_client_remove_message_handler_state);
+ struct ctdb_reply_control *reply;
+ bool status;
+ int ret;
+
+ status = ctdb_client_control_recv(subreq, &ret, state, &reply);
+ TALLOC_FREE(subreq);
+ if (! status) {
+ tevent_req_error(req, ret);
+ return;
+ }
+
+ ret = ctdb_reply_control_deregister_srvid(reply);
+ talloc_free(reply);
+ if (ret != 0) {
+ tevent_req_error(req, ret);
+ return;
+ }
+
+ ret = srvid_deregister(state->client->srv, state->srvid,
+ state->private_data);
+ if (ret != 0) {
+ tevent_req_error(req, ret);
+ return;
+ }
+
+ tevent_req_done(req);
+}
+
+bool ctdb_client_remove_message_handler_recv(struct tevent_req *req, int *perr)
+{
+ int err;
+
+ if (tevent_req_is_unix_error(req, &err)) {
+ if (perr != NULL) {
+ *perr = err;
+ }
+ return false;
+ }
+ return true;
+}
+
int ctdb_client_set_message_handler(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct ctdb_client_context *client,
diff --git a/ctdb/doc/ctdb-tunables.7.xml b/ctdb/doc/ctdb-tunables.7.xml
index 6c164f3..d2d2616 100644
--- a/ctdb/doc/ctdb-tunables.7.xml
+++ b/ctdb/doc/ctdb-tunables.7.xml
@@ -29,39 +29,28 @@
<command>getvar</command> commands for more details.
</para>
- <refsect2>
- <title>MaxRedirectCount</title>
- <para>Default: 3</para>
- <para>
--
Samba Shared Repository
More information about the samba-cvs
mailing list