[SCM] Samba Shared Repository - branch master updated

Martin Schwenke martins at samba.org
Mon Aug 8 09:31:03 UTC 2016


The branch, master has been updated
       via  464b386 ctdb-packaging: Stop RPM from renaming working config to ctdb.rpmsave
       via  d7ecc91 ctdb-daemon: Clean up SET_DB_PRIORITY/GET_DB_PRIORITY deprecation
       via  940272d ctdb-daemon: Fix CID 1125627 Resource leak (RESOURCE_LEAK)
       via  b4f23a7 ctdb-common: Fix CID 1125585 Dereference after null check (FORWARD_NULL)
       via  bbf0b90 ctdb-common: Fix CID 1125583 Dereference after null check (FORWARD_NULL)
       via  7ae3699 ctdb-common: Fix CID 1125581 Dereference after null check (FORWARD_NULL)
       via  f802a11 ctdb-tests: Fix CID 1361816 Buffer not null terminated (BUFFER_SIZE_WARNING)
       via  4541301 ctdb-common: Fix CID 1363227 Resource leak (RESOURCE_LEAK)
       via  1f942ec ctdb-mutex: Avoid corner case where helper is already reparented to init
       via  88a5791 ctdb-tools: Use INVALID_GENERATION macro instead of value
       via  2295f50 ctdb-doc: Document that "ctdb tickle" can now read from stdin
       via  f2b319e ctdb-tools: "ctdb tickle" command should run without daemon
       via  4d144d7 ctdb-tools: Cancel transaction on error or if commit fails
       via  8aa0003 ctdb-client: transaction_cancel must free transaction handle
       via  3c51ac4 ctdb-tools: Free temporary memory context before exiting
       via  c9750c8 ctdb-tools: Close tdb database on error
       via  2e5e51e ctdb-tools: Free connection list after processing it
       via  1f6835c ctdb-tools: Add early return for empty connection list
       via  b54bd76 ctdb-tools: Free tickle list before exiting
       via  814002c ctdb-tools: Free record if it does not contain valid data
       via  bfe891e ctdb-tools: Fix CID 1364706 - resource leak
       via  5f5d954 ctdb-tools: Fix CID 1364705 - resource leak
       via  45b9c37 ctdb-tools: Fix CID 1364704 - resource leak
       via  94bf6e6 ctdb-tools: Fix CID 1364703 - resource leak
       via  10019f7 ctdb-tools: Fix CID 1364702 - resource leak
       via  25f27e1 ctdb-tools: Fix CID 1364701 - resource leak
       via  bf1dab2 ctdb-tools: Fix CID 1364699 - dereference after null check
       via  049dd07 ctdb-tests: Add explicit wait to the fork_helper()
       via  8ce8e1d ctdb-tests: Clean up and rename simple transaction_loop recovery test
       via  de04cd5 ctdb-tests: Clean up and rename simple transaction_loop test
       via  18b41fc ctdb-tests: Implement --interactive/-i option in transaction_loop
       via  c10dcc7 ctdb-tests: Clean up and rename simple fetch_ring test
       via  82cffc2f ctdb-tests: Implement --interactive/-i option in fetch ring
       via  e7a2203 ctdb-tests: Clean up and rename simple message_ring test
       via  fbb3ef4 ctdb-tests: Implement --interactive/-i option in message_ring
       via  b100d78 ctdb-tests: Add --interactive/-i option to test options parsing code
      from  1ddd01d s4: repl: Ensure all error paths in dreplsrv_op_pull_source_get_changes_trigger() are protected with tevent returns.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 464b386d55b0c509b86645bdac7f6d3df489e902
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Aug 3 06:51:57 2016 +1000

    ctdb-packaging: Stop RPM from renaming working config to ctdb.rpmsave
    
    The change to ctdbd.conf and removal of /etc/sysconfig/ctdb as a
    configuration file makes RPM rename the latter with a .rpmsave suffix.
    This means that a working configuration is moved aside on upgrade and
    manual intervention is needed.
    
    Avoid this by convincing RPM that the existing /etc/sysconfig/ctdb is
    still a configuration file.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12125
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Martin Schwenke <martins at samba.org>
    Autobuild-Date(master): Mon Aug  8 11:30:58 CEST 2016 on sn-devel-144

commit d7ecc913bb40783c8cf8c66e3c3e99e6df414381
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jul 28 12:02:25 2016 +1000

    ctdb-daemon: Clean up SET_DB_PRIORITY/GET_DB_PRIORITY deprecation
    
    The current message is broken:
    
      Control SET_DB_PRIORITY is not implemented any more, use  instead
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12126
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 940272d215049f5f5079aa926e69eae1985a4bfa
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 5 16:50:58 2016 +1000

    ctdb-daemon: Fix CID 1125627 Resource leak (RESOURCE_LEAK)
    
    Also fixes CID 1125628.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit b4f23a7e95cd9c8fc4a6324d4ec5a2881eaec207
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 5 16:39:50 2016 +1000

    ctdb-common: Fix CID 1125585 Dereference after null check (FORWARD_NULL)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit bbf0b907cb04184515d0f5f09f14824df1c2e59f
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 5 16:38:45 2016 +1000

    ctdb-common: Fix CID 1125583 Dereference after null check (FORWARD_NULL)
    
    This also fixes CID 1125584.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 7ae3699831427725f12e0a26a0681e59f2fbb2d9
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 5 16:37:00 2016 +1000

    ctdb-common: Fix CID 1125581 Dereference after null check (FORWARD_NULL)
    
    This also fixes CID 1125582.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit f802a11d3ba808baba6cb2d31d706952df1e3159
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Aug 4 15:58:50 2016 +1000

    ctdb-tests: Fix CID 1361816 Buffer not null terminated (BUFFER_SIZE_WARNING)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 4541301d92e3c140adb6444143ad697d35926179
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Aug 4 15:50:12 2016 +1000

    ctdb-common: Fix CID 1363227 Resource leak (RESOURCE_LEAK)
    
    Occurs on an invalid line that isn't the first.  Isn't really a leak
    because it is allocated off mem_ctx, which should be freed by the
    caller.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 1f942ec36c98127e25d7aa9b8370a4f621b9d362
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 5 14:17:01 2016 +1000

    ctdb-mutex: Avoid corner case where helper is already reparented to init
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12113
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 88a579101537fb1ed5182c7c5da4ad49e0516546
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Aug 5 12:40:40 2016 +1000

    ctdb-tools: Use INVALID_GENERATION macro instead of value
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 2295f5009dabfc09eec40bb4f30679d76310ce12
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Mar 24 21:04:25 2015 +1100

    ctdb-doc: Document that "ctdb tickle" can now read from stdin
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12123
    
    Although this has been queued for a while, with changes to add stdin
    support to the original ctdb tool, this came for free with the
    replacement tool.
    
    addtickle and deltickle also now have this feature.  However, they're
    internal commands and we're not adding new documentation for
    internal/debug commands.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit f2b319e457eb43410997615f834f0a21fa5e5b0a
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Aug 4 15:16:09 2016 +1000

    ctdb-tools: "ctdb tickle" command should run without daemon
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12123
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 4d144d7106d56bbb48669dd35eb324377dd09b59
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Aug 5 13:13:08 2016 +1000

    ctdb-tools: Cancel transaction on error or if commit fails
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12122
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 8aa00035faeb307c061dc20e62a0ace7f2a1413b
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Aug 5 13:10:28 2016 +1000

    ctdb-client: transaction_cancel must free transaction handle
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12122
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 3c51ac48df50a877ded34f3678aeb13f3509570d
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Aug 5 13:56:40 2016 +1000

    ctdb-tools: Free temporary memory context before exiting
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit c9750c821e06364cb4559f857c359c14e6799303
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Aug 5 13:25:25 2016 +1000

    ctdb-tools: Close tdb database on error
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 2e5e51ebcd3ec8283cdd9c9d13dbe1fc836f8a3d
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Aug 5 12:46:18 2016 +1000

    ctdb-tools: Free connection list after processing it
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 1f6835c73245366111946b92605315c0cac84295
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 5 11:27:14 2016 +1000

    ctdb-tools: Add early return for empty connection list
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
    
    If the connection list is empty then process_clist_send() still
    creates a request.  However, since no subrequests are created for
    controls sent, tevent_req_poll() waits forever for an event.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit b54bd763b7a4ff3cd1983a8ccc89b23db5263a4d
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Aug 5 12:43:11 2016 +1000

    ctdb-tools: Free tickle list before exiting
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 814002c9a10227fd6cc13fdc974d2312201d7c19
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Aug 5 12:34:13 2016 +1000

    ctdb-tools: Free record if it does not contain valid data
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit bfe891e418fd372c1e7036f08e81b65c27843a79
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Aug 4 15:58:34 2016 +1000

    ctdb-tools: Fix CID 1364706 - resource leak
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 5f5d9549fcae4b2fa4b99bef3892a24bdbb0eaa9
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Aug 4 15:56:23 2016 +1000

    ctdb-tools: Fix CID 1364705 - resource leak
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 45b9c379b590ce0ff03ccaf6c970e0aee1a4b745
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Aug 4 15:51:39 2016 +1000

    ctdb-tools: Fix CID 1364704 - resource leak
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 94bf6e69dba1b97d90168efceaafa43d27186778
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Aug 4 15:50:38 2016 +1000

    ctdb-tools: Fix CID 1364703 - resource leak
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 10019f7cdfa4b3f5485f063d409aa55ca5f14f6a
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Aug 4 15:46:33 2016 +1000

    ctdb-tools: Fix CID 1364702 - resource leak
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 25f27e16b26e2c96a35dd7b42d22d16d63be6037
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Aug 4 15:41:57 2016 +1000

    ctdb-tools: Fix CID 1364701 - resource leak
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit bf1dab28d1d5887f39739eb29537727d97054c5d
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Aug 4 15:37:33 2016 +1000

    ctdb-tools: Fix CID 1364699 - dereference after null check
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 049dd07b909dc56a246799f8a96235989a5a605f
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jul 28 16:21:44 2016 +1000

    ctdb-tests: Add explicit wait to the fork_helper()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12109
    
    To create a client process that waits after connect(), instead of trying
    to do a blocking write(), go to sleep.  The parent can then kill the client
    process, once testing is done.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 8ce8e1d7f8c05158f0f5f4e673f3d9a40f94f00d
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Aug 2 14:52:14 2016 +1000

    ctdb-tests: Clean up and rename simple transaction_loop recovery test
    
    * Rename to clarify purpose of test
    
    * Simplify test info to avoid unnecessary bit-rot
    
    * Restart after test since test does heavy database manipulation
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12109
    
    Pair-programmed-with: Amitay Isaacs <amitay at gmail.com>
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit de04cd578416168290c51f7c4e326b864ab425a4
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Aug 2 14:50:31 2016 +1000

    ctdb-tests: Clean up and rename simple transaction_loop test
    
    * Rename to clarify purpose of test
    
    * Simplify test info to avoid unnecessary bit-rot
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12109
    
    Pair-programmed-with: Amitay Isaacs <amitay at gmail.com>
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 18b41fcb51942ebcd4041fe3e3694712a5a5e43a
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Aug 2 15:00:54 2016 +1000

    ctdb-tests: Implement --interactive/-i option in transaction_loop
    
    Also add PNNs to output.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12109
    
    Pair-programmed-with: Amitay Isaacs <amitay at gmail.com>
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit c10dcc7b91df62f740a4789763234f8bb2f0a27f
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Aug 2 14:42:45 2016 +1000

    ctdb-tests: Clean up and rename simple fetch_ring test
    
    * Rename to clarify purpose of test
    
    * Simplify test info to avoid unnecessary bit-rot
    
    * Have fetch_ring print PNN for clearer output and update patterns in
      test script to suit
    
    * Simplify sanity checking pattern due to less data because of
      --interactive/-i option
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12109
    
    Pair-programmed-with: Amitay Isaacs <amitay at gmail.com>
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 82cffc2f5759fb73bba37e45fc20b24b30ab0438
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Aug 2 14:36:45 2016 +1000

    ctdb-tests: Implement --interactive/-i option in fetch ring
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12109
    
    Pair-programmed-with: Amitay Isaacs <amitay at gmail.com>
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit e7a220377ec14090435f448c9a900f8f8e852a77
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Aug 2 14:47:39 2016 +1000

    ctdb-tests: Clean up and rename simple message_ring test
    
    * Rename to clarify purpose of test
    
    * Simplify test info to avoid unnecessary bit-rot
    
    * Have message_ring print PNN for clearer output and update patterns
      in test script to suit.
    
    * Drop quantitative percentage check since this is hard to predict
      when under extreme load.  To compensate, tighten up expectations for
      the total number of messages in each direction: at least 10 messages
      are required over 10 seconds.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12109
    
    Pair-programmed-with: Amitay Isaacs <amitay at gmail.com>
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit fbb3ef46b99f4e3ccf710367e50f8b9f89fee52c
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Aug 2 14:19:18 2016 +1000

    ctdb-tests: Implement --interactive/-i option in message_ring
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12109
    
    Pair-programmed-with: Amitay Isaacs <amitay at gmail.com>
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit b100d78597959ad314e4f4f6816a8ff14100fb6e
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Aug 2 14:16:35 2016 +1000

    ctdb-tests: Add --interactive/-i option to test options parsing code
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12109
    
    Pair-programmed-with: Amitay Isaacs <amitay at gmail.com>
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/client/client_db.c                            |  3 +
 ctdb/common/rb_tree.c                              |  6 +-
 ctdb/common/system_util.c                          |  1 +
 ctdb/doc/cluster_mutex_helper.txt                  |  3 +-
 ctdb/doc/ctdb.1.xml                                | 23 ++++--
 ctdb/packaging/RPM/ctdb.spec.in                    | 11 +++
 ctdb/server/ctdb_control.c                         |  4 +-
 ctdb/server/ctdb_logging.c                         |  9 ++-
 ctdb/server/ctdb_mutex_fcntl_helper.c              | 13 +++
 ctdb/tests/simple/51_ctdb_bench.sh                 | 92 ----------------------
 ctdb/tests/simple/51_message_ring.sh               | 66 ++++++++++++++++
 ctdb/tests/simple/52_ctdb_fetch.sh                 | 64 ---------------
 ctdb/tests/simple/52_fetch_ring.sh                 | 46 +++++++++++
 ..._ctdb_transaction.sh => 53_transaction_loop.sh} | 15 +---
 ...recovery.sh => 54_transaction_loop_recovery.sh} | 18 +----
 ctdb/tests/src/fake_ctdbd.c                        |  4 +-
 ctdb/tests/src/fetch_ring.c                        | 15 +++-
 ctdb/tests/src/message_ring.c                      | 19 +++--
 ctdb/tests/src/porting_tests.c                     | 17 ++--
 ctdb/tests/src/test_options.c                      |  3 +
 ctdb/tests/src/test_options.h                      |  1 +
 ctdb/tests/src/transaction_loop.c                  | 19 +++--
 ctdb/tools/ctdb.c                                  | 58 +++++++++++---
 23 files changed, 274 insertions(+), 236 deletions(-)
 delete mode 100755 ctdb/tests/simple/51_ctdb_bench.sh
 create mode 100755 ctdb/tests/simple/51_message_ring.sh
 delete mode 100755 ctdb/tests/simple/52_ctdb_fetch.sh
 create mode 100755 ctdb/tests/simple/52_fetch_ring.sh
 rename ctdb/tests/simple/{53_ctdb_transaction.sh => 53_transaction_loop.sh} (61%)
 rename ctdb/tests/simple/{54_ctdb_transaction_recovery.sh => 54_transaction_loop_recovery.sh} (71%)


Changeset truncated at 500 lines:

diff --git a/ctdb/client/client_db.c b/ctdb/client/client_db.c
index 98de1b8..794119d 100644
--- a/ctdb/client/client_db.c
+++ b/ctdb/client/client_db.c
@@ -2304,6 +2304,7 @@ static void ctdb_transaction_cancel_done(struct tevent_req *subreq)
 		DEBUG(DEBUG_ERR,
 		      ("transaction_cancel: %s g_lock unlock failed, ret=%d\n",
 		       state->h->db->db_name, ret));
+		talloc_free(state->h);
 		tevent_req_error(req, ret);
 		return;
 	}
@@ -2336,6 +2337,7 @@ int ctdb_transaction_cancel(struct ctdb_transaction_handle *h)
 
 	mem_ctx = talloc_new(NULL);
 	if (mem_ctx == NULL) {
+		talloc_free(h);
 		return ENOMEM;
 	}
 
@@ -2343,6 +2345,7 @@ int ctdb_transaction_cancel(struct ctdb_transaction_handle *h)
 					   tevent_timeval_zero(), h);
 	if (req == NULL) {
 		talloc_free(mem_ctx);
+		talloc_free(h);
 		return ENOMEM;
 	}
 
diff --git a/ctdb/common/rb_tree.c b/ctdb/common/rb_tree.c
index 1c602a7..990ec61 100644
--- a/ctdb/common/rb_tree.c
+++ b/ctdb/common/rb_tree.c
@@ -216,21 +216,21 @@ static inline int trbt_get_color_right(trbt_node_t *node)
 /* setting a NULL node to black is a nop */
 static inline void trbt_set_color(trbt_node_t *node, int color)
 {
-	if ( (node==NULL) && (color==TRBT_BLACK) ) {
+	if (node == NULL) {
 		return;
 	}
 	node->rb_color = color;
 }
 static inline void trbt_set_color_left(trbt_node_t *node, int color)
 {
-	if ( ((node==NULL)||(node->left==NULL)) && (color==TRBT_BLACK) ) {
+	if (node == NULL || node->left == NULL) {
 		return;
 	}
 	node->left->rb_color = color;
 }
 static inline void trbt_set_color_right(trbt_node_t *node, int color)
 {
-	if ( ((node==NULL)||(node->right==NULL)) && (color==TRBT_BLACK) ) {
+	if (node == NULL || node->right == NULL) {
 		return;
 	}
 	node->right->rb_color = color;
diff --git a/ctdb/common/system_util.c b/ctdb/common/system_util.c
index ea53f5d..9fc6c44 100644
--- a/ctdb/common/system_util.c
+++ b/ctdb/common/system_util.c
@@ -420,6 +420,7 @@ int ctdb_parse_connections(FILE *fp, TALLOC_CTX *mem_ctx,
 		if (ret != 2) {
 			DEBUG(DEBUG_ERR, ("Bad line [%d]: %s\n",
 					  line_num, line));
+			talloc_free(conn);
 			return EINVAL;
 		}
 
diff --git a/ctdb/doc/cluster_mutex_helper.txt b/ctdb/doc/cluster_mutex_helper.txt
index 0fc3a50..20c8eb2 100644
--- a/ctdb/doc/cluster_mutex_helper.txt
+++ b/ctdb/doc/cluster_mutex_helper.txt
@@ -64,7 +64,8 @@ Valid status codes are:
 If a 0 status code is sent then it the helper should periodically
 check if the (original) parent processes still exists while awaiting
 termination.  If the parent process disappears then the helper should
-release the mutex and exit.  This avoids stale mutexes.
+release the mutex and exit.  This avoids stale mutexes.  Note that a
+helper should never wait for parent process ID 1!
 
 If a non-0 status code is sent then the helper can exit immediately.
 However, if the helper does not exit then it must terminate if it
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index 7878c4c..9324813 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -1440,13 +1440,24 @@ RUNNING
     </refsect2>
 
     <refsect2>
-      <title>tickle <parameter>SRC-IPADDR</parameter>:<parameter>SRC-PORT</parameter> <parameter>DST-IPADDR</parameter>:<parameter>DST-PORT</parameter></title>
+      <title>tickle</title>
       <para>
-	Send a TCP tickle to the source host for the specified TCP
-	connection.  A TCP tickle is a TCP ACK packet with an invalid
-	sequence and acknowledge number and will when received by the
-	source host result in it sending an immediate correct ACK back
-	to the other end.
+	Read a list of TCP connections, one per line, from standard
+	input and send a TCP tickle to the source host for each
+	connection.  A connection is specified as:
+      </para>
+      <synopsis>
+	<parameter>SRC-IPADDR</parameter>:<parameter>SRC-PORT</parameter> <parameter>DST-IPADDR</parameter>:<parameter>DST-PORT</parameter>
+      </synopsis>
+      <para>
+	A single connection can be specified on the command-line
+	rather than on standard input.
+      </para>
+      <para>
+	A TCP tickle is a TCP ACK packet with an invalid sequence and
+	acknowledge number and will when received by the source host
+	result in it sending an immediate correct ACK back to the
+	other end.
       </para>
       <para>
 	TCP tickles are useful to "tickle" clients after a IP failover has
diff --git a/ctdb/packaging/RPM/ctdb.spec.in b/ctdb/packaging/RPM/ctdb.spec.in
index 28af1d0..ea97d8e 100644
--- a/ctdb/packaging/RPM/ctdb.spec.in
+++ b/ctdb/packaging/RPM/ctdb.spec.in
@@ -115,6 +115,15 @@ DESTDIR=$RPM_BUILD_ROOT ./buildtools/bin/waf install
 
 install -m644 config/ctdbd.conf $RPM_BUILD_ROOT%{_sysconfdir}/ctdb
 
+# Add a pointer to modern location for configuration file.  Allow with
+# "noreplace" in the files section, this stops RPM moving aside a
+# working configuration.
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
+cat >$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ctdb <<EOF
+# CTDB configuration is now in %{_sysconfdir}/ctdb/ctdbd.conf
+EOF
+chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ctdb
+
 %if %{with_systemd}
 mkdir -p $RPM_BUILD_ROOT%{_unitdir}
 install -m 755 config/ctdb.service $RPM_BUILD_ROOT%{_unitdir}
@@ -151,6 +160,8 @@ rm -rf $RPM_BUILD_ROOT
 %config(noreplace) %{_sysconfdir}/ctdb/gcore_trace.sh
 %config(noreplace) %{_sysconfdir}/ctdb/debug_locks.sh
 
+%config(noreplace, missingok) %{_sysconfdir}/sysconfig/ctdb
+
 %if %{with_systemd}
 %{_unitdir}/ctdb.service
 %else
diff --git a/ctdb/server/ctdb_control.c b/ctdb/server/ctdb_control.c
index f01815c..4c66483 100644
--- a/ctdb/server/ctdb_control.c
+++ b/ctdb/server/ctdb_control.c
@@ -565,10 +565,10 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
 		return ctdb_control_get_ban_state(ctdb, outdata);
 
 	case CTDB_CONTROL_SET_DB_PRIORITY:
-		return control_not_implemented("SET_DB_PRIORITY", "");
+		return control_not_implemented("SET_DB_PRIORITY", NULL);
 
 	case CTDB_CONTROL_GET_DB_PRIORITY:
-		return control_not_implemented("GET_DB_PRIORITY", "");
+		return control_not_implemented("GET_DB_PRIORITY", NULL);
 
 	case CTDB_CONTROL_TRANSACTION_CANCEL:
 		return control_not_implemented("TRANSACTION_CANCEL", NULL);
diff --git a/ctdb/server/ctdb_logging.c b/ctdb/server/ctdb_logging.c
index 168d3b5..692df73 100644
--- a/ctdb/server/ctdb_logging.c
+++ b/ctdb/server/ctdb_logging.c
@@ -282,9 +282,14 @@ int ctdb_set_child_logging(struct ctdb_context *ctdb)
 
 	/* We'll fail if stderr/stdout not already open; it's simpler. */
 	old_stdout = dup(STDOUT_FILENO);
+	if (old_stdout < 0) {
+		DEBUG(DEBUG_ERR, ("Failed to dup stdout for child logging\n"));
+		return -1;
+	}
 	old_stderr = dup(STDERR_FILENO);
-	if (old_stdout < 0 || old_stderr < 0) {
-		DEBUG(DEBUG_ERR, ("Failed to dup stdout/stderr for child logging\n"));
+	if (old_stderr < 0) {
+		DEBUG(DEBUG_ERR, ("Failed to dup stderr for child logging\n"));
+		close(old_stdout);
 		return -1;
 	}
 	if (dup2(p[1], STDOUT_FILENO) < 0 || dup2(p[1], STDERR_FILENO) < 0) {
diff --git a/ctdb/server/ctdb_mutex_fcntl_helper.c b/ctdb/server/ctdb_mutex_fcntl_helper.c
index 06c2205..87358be 100644
--- a/ctdb/server/ctdb_mutex_fcntl_helper.c
+++ b/ctdb/server/ctdb_mutex_fcntl_helper.c
@@ -82,6 +82,19 @@ int main(int argc, char *argv[])
 	}
 
 	ppid = getppid();
+
+	if (ppid == 1) {
+		/* The original parent is gone and the process has
+		 * been reparented to init.  This can happen if the
+		 * helper is started just as the parent is killed
+		 * during shutdown.  The error message doesn't need to
+		 * be stellar, since there won't be anything around to
+		 * capture and log it...
+		 */
+		fprintf(stderr, "%s: PPID == 1\n", progname);
+		exit(1);
+	}
+
 	file = argv[1];
 
 	result = fcntl_lock(file, &fd);
diff --git a/ctdb/tests/simple/51_ctdb_bench.sh b/ctdb/tests/simple/51_ctdb_bench.sh
deleted file mode 100755
index b8d6e5a..0000000
--- a/ctdb/tests/simple/51_ctdb_bench.sh
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/bash
-
-test_info()
-{
-    cat <<EOF
-Run the ctdb_bench test and sanity check the output.
-
-This doesn't test for performance regressions or similarly anything
-useful.  Only vague sanity checking of results is done.
-
-Prerequisites:
-
-* An active CTDB cluster with at least 2 active nodes.
-
-Steps:
-
-1. Verify that the status on all of the ctdb nodes is 'OK'.
-2. Run ctdb_bench on all nodes with default options.
-3. Ensure that the number of +ve and -ive messages are within 1% of
-   each other.
-4. Ensure that the number of messages per second is greater than 10.
-
-Expected results:
-
-* ctdb_bench runs without error and prints reasonable results.
-EOF
-}
-
-. "${TEST_SCRIPTS_DIR}/integration.bash"
-
-ctdb_test_init "$@"
-
-set -e
-
-cluster_is_healthy
-
-try_command_on_node 0 "$CTDB listnodes"
-num_nodes=$(echo "$out" | wc -l)
-
-echo "Running ctdb_bench on all $num_nodes nodes."
-try_command_on_node -v -p all $CTDB_TEST_WRAPPER $VALGRIND message_ring -n $num_nodes
-
-# Get the last line of output.
-while read line ; do
-    prev=$line
-done <<<"$out"
-
-pat='^(Ring: [[:digit:]]+(\.[[:digit:]]+)? msgs/sec \(\+ve=[[:digit:]]+ -ve=[[:digit:]]+\)[[:space:]]?|Waiting for cluster[[:space:]]?)+$'
-sanity_check_output 1 "$pat" "$out"
-
-# $prev should look like this:
-#    Ring: 10670.93 msgs/sec (+ve=53391 -ve=53373)
-stuff="${prev##*Ring: }"
-mps="${stuff% msgs/sec*}"
-
-if [ ${mps%.*} -ge 10 ] ; then
-    echo "OK: $mps msgs/sec >= 10 msgs/sec"
-else
-    echo "BAD: $mps msgs/sec < 10 msgs/sec"
-    exit 1
-fi
-
-stuff="${stuff#*msgs/sec (+ve=}"
-positive="${stuff%% *}"
-
-if [ $positive -gt 0 ] ; then
-    echo "OK: +ive ($positive) > 0"
-else
-    echo "BAD: +ive ($positive) = 0"
-    exit 1
-fi
-
-stuff="${stuff#*-ve=}"
-negative="${stuff%)}"
-
-if [ $negative -gt 0 ] ; then
-    echo "OK: -ive ($negative) > 0"
-else
-    echo "BAD: -ive ($negative) = 0"
-    exit 1
-fi
-
-perc_diff=$(( ($positive - $negative) * 100 / $positive ))
-perc_diff=${perc_diff#-}
-
-check_percent=5
-if [ $perc_diff -le $check_percent ] ; then
-    echo "OK: percentage difference between +ive and -ive ($perc_diff%) <= $check_percent%"
-else
-    echo "BAD: percentage difference between +ive and -ive ($perc_diff%) > $check_percent%"
-    exit 1
-fi
diff --git a/ctdb/tests/simple/51_message_ring.sh b/ctdb/tests/simple/51_message_ring.sh
new file mode 100755
index 0000000..e1bdab3
--- /dev/null
+++ b/ctdb/tests/simple/51_message_ring.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+test_info()
+{
+    cat <<EOF
+Run the message_ring test and sanity check the output.
+
+Prerequisites:
+
+* An active CTDB cluster with at least 2 active nodes.
+EOF
+}
+
+. "${TEST_SCRIPTS_DIR}/integration.bash"
+
+ctdb_test_init "$@"
+
+set -e
+
+cluster_is_healthy
+
+try_command_on_node 0 "$CTDB listnodes"
+num_nodes=$(echo "$out" | wc -l)
+
+echo "Running message_ring on all $num_nodes nodes."
+try_command_on_node -v -p all $CTDB_TEST_WRAPPER $VALGRIND message_ring -n $num_nodes
+
+# Get the last line of output.
+while read line ; do
+    prev=$line
+done <<<"$out"
+
+pat='^(Waiting for cluster|Ring\[[[:digit:]]+\]: [[:digit:]]+(\.[[:digit:]]+)? msgs/sec \(\+ve=[[:digit:]]+ -ve=[[:digit:]]+\))$'
+sanity_check_output 1 "$pat" "$out"
+
+# $prev should look like this:
+#    Ring[1]: 10670.93 msgs/sec (+ve=53391 -ve=53373)
+stuff="${prev##Ring\[*\]: }"
+mps="${stuff% msgs/sec*}"
+
+if [ ${mps%.*} -ge 10 ] ; then
+    echo "OK: $mps msgs/sec >= 10 msgs/sec"
+else
+    echo "BAD: $mps msgs/sec < 10 msgs/sec"
+    exit 1
+fi
+
+stuff="${stuff#*msgs/sec (+ve=}"
+positive="${stuff%% *}"
+
+if [ $positive -ge 10 ] ; then
+    echo "OK: +ive ($positive) >= 10"
+else
+    echo "BAD: +ive ($positive) < 10"
+    exit 1
+fi
+
+stuff="${stuff#*-ve=}"
+negative="${stuff%)}"
+
+if [ $negative -ge 10 ] ; then
+    echo "OK: -ive ($negative) >= 10"
+else
+    echo "BAD: -ive ($negative) < 10"
+    exit 1
+fi
diff --git a/ctdb/tests/simple/52_ctdb_fetch.sh b/ctdb/tests/simple/52_ctdb_fetch.sh
deleted file mode 100755
index 60beef2..0000000
--- a/ctdb/tests/simple/52_ctdb_fetch.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/bash
-
-test_info()
-{
-    cat <<EOF
-Run the ctdb_fetch test and sanity check the output.
-
-This doesn't test for performance regressions or similarly anything
-useful.  Only vague sanity checking of results is done.
-
-Prerequisites:
-
-* An active CTDB cluster with at least 2 active nodes.
-
-Steps:
-
-1. Verify that the status on all of the ctdb nodes is 'OK'.
-2. Run ctdb_fetch on all nodes with default options.
-3. Ensure that the number of +ve and -ive messages are within 1% of
-   each other.
-4. Ensure that the number of messages per second is greater than 10.
-
-Expected results:
-
-* ctdb_fetch runs without error and prints reasonable results.
-EOF
-}
-
-. "${TEST_SCRIPTS_DIR}/integration.bash"
-
-ctdb_test_init "$@"
-
-set -e
-
-cluster_is_healthy
-
-try_command_on_node 0 "$CTDB listnodes"
-num_nodes=$(echo "$out" | wc -l)
-
-echo "Running ctdb_fetch on all $num_nodes nodes."
-try_command_on_node -v -p all $CTDB_TEST_WRAPPER $VALGRIND fetch_ring -n $num_nodes
-
-pat='^(Fetch: [[:digit:]]+(\.[[:digit:]]+)? msgs/sec[[:space:]]?|msg_count=[[:digit:]]+ on node [[:digit:]]|Fetching final record|DATA:|Test data|Waiting for cluster[[:space:]]?|.*: Reqid wrap!|Sleeping for [[:digit:]]+ seconds|)+$'
-sanity_check_output 1 "$pat" "$out"
-
-# Filter out the performance figures:
-out_fetch=$(echo "$out" | egrep '^(Fetch: .*)+$')
-
-# Get the last line of output.
-while read line ; do
-    prev=$line
-done <<<"$out_fetch"
-
-# $prev should look like this:
-#    Fetch: 10670.93 msgs/sec
-stuff="${prev##*Fetch: }"
-mps="${stuff% msgs/sec*}"
-
-if [ ${mps%.*} -ge 10 ] ; then
-    echo "OK: $mps msgs/sec >= 10 msgs/sec"
-else
-    echo "BAD: $mps msgs/sec < 10 msgs/sec"
-    exit 1
-fi
diff --git a/ctdb/tests/simple/52_fetch_ring.sh b/ctdb/tests/simple/52_fetch_ring.sh
new file mode 100755
index 0000000..81e6a7a
--- /dev/null
+++ b/ctdb/tests/simple/52_fetch_ring.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+test_info()
+{
+    cat <<EOF
+Run the fetch_ring test and sanity check the output.
+
+Prerequisites:
+
+* An active CTDB cluster with at least 2 active nodes.
+EOF
+}
+
+. "${TEST_SCRIPTS_DIR}/integration.bash"
+
+ctdb_test_init "$@"
+
+set -e
+
+cluster_is_healthy
+
+try_command_on_node 0 "$CTDB listnodes"
+num_nodes=$(echo "$out" | wc -l)
+
+echo "Running fetch_ring on all $num_nodes nodes."
+try_command_on_node -v -p all $CTDB_TEST_WRAPPER $VALGRIND fetch_ring -n $num_nodes
+
+pat='^(Waiting for cluster|Fetch\[[[:digit:]]+\]: [[:digit:]]+(\.[[:digit:]]+)? msgs/sec)$'
+sanity_check_output 1 "$pat" "$out"
+
+# Get the last line of output.
+while read line ; do
+    prev=$line
+done <<<"$out"
+
+# $prev should look like this:
+#    Fetch[1]: 10670.93 msgs/sec
+stuff="${prev##*Fetch\[*\]: }"
+mps="${stuff% msgs/sec*}"
+
+if [ ${mps%.*} -ge 10 ] ; then
+    echo "OK: $mps msgs/sec >= 10 msgs/sec"
+else
+    echo "BAD: $mps msgs/sec < 10 msgs/sec"
+    exit 1


-- 
Samba Shared Repository



More information about the samba-cvs mailing list