[SCM] Samba Shared Repository - branch v4-8-test updated

Karolin Seeger kseeger at samba.org
Tue Jul 10 13:10:03 UTC 2018


The branch, v4-8-test has been updated
       via  b5d333c ctdb-tests: Avoid segfault by initializing logging
       via  a19d52e ctdb-tests: Avoid segfault by initializing logging
       via  6600f4b ctdb-pmda: Use modified API in pcp library 4.0
       via  0e3f149 socket_wrapper: Add missing dependency on tirpc
       via  7f46b39 ctdb-daemon: Only consider client ID for local database attach
       via  35128a9 ctdb-tests: Switch fake_ctdbd to use ctdb_get_peer_pid()
       via  8af4bac uid_wrapper: Be strict when checking __attribute__ features
       via  e021b43 resolv_wrapper: Be strict when checking __attribute__ features
       via  81a05ba pam_wrapper: Be strict when checking __attribute__ features
       via  d3b773d nss_wrapper: Be strict when checking __attribute__ features
       via  a4ada0b socket_wrapper: Be strict when checking __attribute__ features
       via  7a0807d wafsamba: Be strict when checking __attribute__ features
       via  89de78e wafsamba: Add strict option to CHECK_CODE
       via  4561e66 ctdb-common: Use correct return type for tevent_queue_add_entry
       via  a95e528 tdb: Fix build on AIX
       via  ac5ca1d ctdb: Fix build on AIX
       via  9974975 ctdb-common: Use sin6_len only if the structure supports it
       via  bf7ae2f replace: Add test for sin6_len in sockaddr_in6 structure
       via  2819c0d ctdb-docs: Fix the documentation for VNN map
       via  7a701e2 ctdb-server: Rename CTDB_BROADCAST_VNNMAP -> CTDB_BROADCAST_ACTIVE
       via  a2d3593 ctdb-tests: Add a simple test for database traverses
       via  1f25b710 ctdb-tests: Add check for non-lmaster node status in integration tests
       via  f4d7abd ctdb-client: Fix typo where CTDB_BROADCAST_ALL is repeated
       via  eaa3c9a s3:tests: Add test for smbclient --quiet
       via  de5bde9 s3:client: Add --quiet option to smbclient
      from  1df7f93 VERSION: Bump version up to 4.8.4...

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-8-test


- Log -----------------------------------------------------------------
commit b5d333c26484cff8f933ba8389e46514ea501282
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jul 5 13:40:33 2018 +1000

    ctdb-tests: Avoid segfault by initializing logging
    
    This is in addition to af697008531.
    
    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 Jul  5 15:22:16 CEST 2018 on sn-devel-144
    
    (cherry picked from commit a30ac853ff9bca023c53ad98775eabb23156c566)
    
    Autobuild-User(v4-8-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-8-test): Tue Jul 10 15:09:25 CEST 2018 on sn-devel-144

commit a19d52e6c827b78d3883d37fcdaa76013e5c3177
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 21 20:00:41 2018 +1000

    ctdb-tests: Avoid segfault by initializing logging
    
    Setting DEBUGLEVEL before calling debug_init() causes segmentation
    violation with gcc8.  DEBUGLEVEL_CLASS is statically initialized to
    debug_class_list_initial which is defined as const.  Only after
    debug_init() is called, DEBUGLEVEL_CLASS becomes a talloc'd array.
    
    So before modifying DEBUGLEVEL, ensure debug_init() is called via
    setup_logging().  (debug_init is a static function.)
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit af697008531bd74546656841dd3a1ed92522fc57)

commit 6600f4b1641160c902e8318c64a33575610deb31
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Mar 1 12:32:26 2018 +1100

    ctdb-pmda: Use modified API in pcp library 4.0
    
    Support backward compatibility by checking for __pmID_int type, which
    was previously in <pcp/impl.h>.  In the new version, this type is not
    defined anymore and there is no need to include <pcp/impl.h>.
    
    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  2 00:38:52 CET 2018 on sn-devel-144
    
    (cherry picked from commit 426e4a5a20cff73a80d80b46f15826deac3f934f)

commit 0e3f149a09201ae53d489fd48eec705df0ffdcca
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon May 14 16:52:58 2018 +1000

    socket_wrapper: Add missing dependency on tirpc
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Tue May 22 13:57:07 CEST 2018 on sn-devel-144
    
    (cherry picked from commit 7049b2153b08152f03a0fcbb1817b430fe0a8451)

commit 7f46b392bf499b3f21b6e48e90f2bfa0877e8a2a
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jun 26 20:12:23 2018 +1000

    ctdb-daemon: Only consider client ID for local database attach
    
    The comment immediately above this code says "don't allow local
    clients to attach" and then looks up the client ID regardless of
    whether the request is local or remote.
    
    This means that an intentional remote attach from a client will not
    work correctly.  No real client should ever do that since clients
    attach so they an access databases locally.  Perhaps some sanity
    checks should be added.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13500
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 63255ef92552da92956c05160f33622d0bbc3a28)

commit 35128a93e7b1efd10f691e1f3ef12a48116c1c0c
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 8 22:31:48 2018 +1000

    ctdb-tests: Switch fake_ctdbd to use ctdb_get_peer_pid()
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 05a908d71c4b7484ba0243fa51bc05c79c8fb357)

commit 8af4bac8ec602df413d2b2a02e4b37c6558f0ce5
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 3 14:45:39 2018 +1000

    uid_wrapper: Be strict when checking __attribute__ features
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Martin Schwenke <martins at samba.org>
    Autobuild-Date(master): Thu Jul  5 03:01:33 CEST 2018 on sn-devel-144
    
    (cherry picked from commit 734ea271ab01e74d0694f3fbc9acdf980d866b30)

commit e021b4371eee29201c369d633aa3ef6f09c0cb33
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 3 14:45:24 2018 +1000

    resolv_wrapper: Be strict when checking __attribute__ features
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit c220e310b40c67b73248141b3af544bad19fd39d)

commit 81a05ba6d16af22eade72892b608cfaa2e227ecf
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 3 14:45:04 2018 +1000

    pam_wrapper: Be strict when checking __attribute__ features
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 65b0746694a0cbd8f40c5e89dc9a680044f7a1a9)

commit d3b773d757d836ce9189e61e9c010d6154513d59
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 3 14:44:48 2018 +1000

    nss_wrapper: Be strict when checking __attribute__ features
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 9a670bde563b269587c051c655a7b3778c008c87)

commit a4ada0b6318dae85075c8a76a6989a4d4b27d889
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 3 14:36:16 2018 +1000

    socket_wrapper: Be strict when checking __attribute__ features
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 77cdfe3ecc06a9aef9ea4201a1a76a9a7b47a73f)

commit 7a0807d68b1e9543f059d90638119a39174538d4
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 3 14:34:29 2018 +1000

    wafsamba: Be strict when checking __attribute__ features
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit a9775c2429554e029164ad9b98dc8c8c749c50fe)

commit 89de78eedfbb1a11e4c6f94f1838d78576d2dd86
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 3 13:56:13 2018 +1000

    wafsamba: Add strict option to CHECK_CODE
    
    Some compilers (e.g. xlc) ignores unsupported features, generates a
    warning, but does not fail compilation.
    
    This ensures that any compiler warnings are treated as errors and the
    feature support is correctly identified.  This adds equivalent compiler
    option to -Werror for xlc.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit c08d65c3eea997d52e311f027d84bdc3f9c93059)

commit 4561e668a0b31aef2d812804c4c26343a40d3b14
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 3 14:08:22 2018 +1000

    ctdb-common: Use correct return type for tevent_queue_add_entry
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit b977ded38a79e1eadd6965e8b7fd49f86322b4d6)

commit a95e5286a4c06cf447f6943a01063863b61a99fa
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Jun 29 16:12:30 2018 +1000

    tdb: Fix build on AIX
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493
    
    Here is the build error on AIX 7.1.
    
    ../../lib/tdb/tools/tdbtool.c:39:12: error: 'disable_lock' redeclared as different kind of symbol
     static int disable_lock;
                ^~~~~~~~~~~~
    In file included from /usr/include/sys/gfs.h:24:0,
                     from /usr/include/sys/vfs.h:27,
                     from ../../lib/replace/system/filesys.h:48,
                     from ../../lib/tdb/tools/tdbtool.c:26:
    /usr/include/sys/lock_def.h:314:5: note: previous declaration of 'disable_lock' was here
     int disable_lock(int,simple_lock_t);
         ^~~~~~~~~~~~
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit edffe4d16514fa0c87655e040842f6c20d89791c)

commit ac5ca1d3cbb51488bb437d7014f7134745a983a4
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Jun 29 15:55:49 2018 +1000

    ctdb: Fix build on AIX
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 40a8ab1ce0c1b291af7263da13c25c37cee69670)

commit 9974975faccdceddd8f37b75eb39099636685486
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jun 27 13:41:38 2018 +1000

    ctdb-common: Use sin6_len only if the structure supports it
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 79992dbb73ac9749ac987cb6a88964fa600b4c35)

commit bf7ae2fb5d4bdd4d3110f28b96130f54fe98daa5
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jun 27 13:41:10 2018 +1000

    replace: Add test for sin6_len in sockaddr_in6 structure
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 7eeba9c5a4541e581b062fb9ee26f13b7373c541)

commit 2819c0d9a3c7fa35ce272a0e7e06e7a1c9f7011b
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 15 06:07:54 2018 +1000

    ctdb-docs: Fix the documentation for VNN map
    
    It is incorrectly says that nodes not in the VNN map can not be
    DMASTER.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13499
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit af446d5209e37a38363911e5f339869b73d87963)

commit 7a701e28aea4c392f2e121e4b007fd85760484e6
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 15 06:01:52 2018 +1000

    ctdb-server: Rename CTDB_BROADCAST_VNNMAP -> CTDB_BROADCAST_ACTIVE
    
    This broadcast is misnamed.  Both places where this type of broadcast
    is used expect the broadcast to go to all active nodes.
    
    Make the corresponding change to the semantics in the daemon by
    sending to all active nodes.
    
    There is a mismatch between the ideas of VNN map and active nodes.  A
    node that is not in the VNN map but is active can still host database
    records.  These were the same until the LMASTER capability was
    introduced and then the logic was not updated.
    
    The only place where the VNN map is relevant is when finding the
    location master of a record in the migration code.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13499
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 36938bfdd075a174daecb466085702adfe6a6c09)

commit a2d359358ddb20d57c76ac13376a1c1469be329e
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 15 05:51:45 2018 +1000

    ctdb-tests: Add a simple test for database traverses
    
    This tests that volatile databases traverse correctly, including the
    case where a record was updated on a non-lmaster node.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13499
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit ec72fadecd5233234947633360fe46a3a4053c07)

commit 1f25b710a83cb9549b52a45cc4981e3fd3188ba5
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 15 05:51:17 2018 +1000

    ctdb-tests: Add check for non-lmaster node status in integration tests
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13499
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 4b008556d6b1f07fd5057af845526bf941497f18)

commit f4d7abd5a76aca82e98c714806a649fee80f8cba
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jun 14 16:17:09 2018 +1000

    ctdb-client: Fix typo where CTDB_BROADCAST_ALL is repeated
    
    Surely this is meant to be CTDB_BROADCAST_CONNECTED?
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13499
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 77db0b15b56f9921961bd753c210e6fdbaf97f6d)

commit eaa3c9a22f6199ae45b2431e9d6cc3da00744300
Author: Justin Stephenson <jstephen at redhat.com>
Date:   Mon Jun 25 10:29:28 2018 -0400

    s3:tests: Add test for smbclient --quiet
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13485
    
    Signed-off-by: Justin Stephenson <jstephen at redhat.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Björn Baumbach <bb at sernet.de>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Tue Jun 26 20:29:19 CEST 2018 on sn-devel-144
    
    (cherry picked from commit f90f434e041461fbea2e101066c79ec8caf35cce)

commit de5bde9fdecf462af449312e2098f634ffa6f52a
Author: Justin Stephenson <jstephen at redhat.com>
Date:   Mon Jun 25 09:58:56 2018 -0400

    s3:client: Add --quiet option to smbclient
    
    Add quiet command-line argument to allow suppressing the help log
    message printed automatically after establishing a smbclient connection
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13485
    
    Signed-off-by: Justin Stephenson <jstephen at redhat.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Björn Baumbach <bb at sernet.de>
    (cherry picked from commit 89a8b3ecd47b6d9a33e66f22d2786f0ae3b4cb72)

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

Summary of changes:
 buildtools/wafsamba/samba_autoconf.py        | 12 +++-
 buildtools/wafsamba/wscript                  |  4 ++
 ctdb/client/client_tunnel.c                  |  4 +-
 ctdb/common/ctdb_util.c                      |  4 +-
 ctdb/common/sock_io.c                        |  6 +-
 ctdb/common/system_util.c                    |  2 +-
 ctdb/doc/ctdb.1.xml                          |  7 +--
 ctdb/include/ctdb_private.h                  |  7 ++-
 ctdb/protocol/protocol.h                     |  2 +-
 ctdb/protocol/protocol_debug.c               |  4 +-
 ctdb/protocol/protocol_util.c                |  2 +-
 ctdb/server/ctdb_cluster_mutex.c             |  4 +-
 ctdb/server/ctdb_control.c                   | 36 ++++++++---
 ctdb/server/ctdb_ltdb_server.c               | 21 +++++--
 ctdb/server/ctdb_server.c                    | 16 +++--
 ctdb/server/ctdb_traverse.c                  |  4 +-
 ctdb/server/ipalloc.c                        |  4 +-
 ctdb/tests/scripts/integration.bash          |  1 +
 ctdb/tests/simple/79_volatile_db_traverse.sh | 94 ++++++++++++++++++++++++++++
 ctdb/tests/src/ctdb_takeover_tests.c         |  8 ++-
 ctdb/tests/src/fake_ctdbd.c                  | 10 +--
 ctdb/tests/src/fetch_loop.c                  |  3 +
 ctdb/tests/src/fetch_loop_key.c              |  3 +
 ctdb/tests/src/fetch_readonly.c              |  3 +
 ctdb/tests/src/fetch_readonly_loop.c         |  3 +
 ctdb/tests/src/fetch_ring.c                  |  3 +
 ctdb/tests/src/g_lock_loop.c                 |  4 +-
 ctdb/tests/src/ipalloc_read_known_ips.c      |  4 +-
 ctdb/tests/src/message_ring.c                |  3 +
 ctdb/tests/src/transaction_loop.c            |  3 +
 ctdb/tests/src/tunnel_test.c                 |  3 +
 ctdb/tests/src/update_record.c               |  3 +
 ctdb/tests/src/update_record_persistent.c    |  3 +
 ctdb/tools/ctdb_killtcp.c                    |  6 +-
 ctdb/utils/pmda/pmda_ctdb.c                  | 30 ++++++---
 ctdb/wscript                                 |  3 +-
 lib/replace/wscript                          |  4 ++
 lib/tdb/tools/tdbtool.c                      |  8 +--
 source3/client/client.c                      |  9 ++-
 source3/script/tests/test_smbclient_s3.sh    | 34 ++++++++++
 third_party/nss_wrapper/wscript              |  2 +
 third_party/pam_wrapper/wscript              |  2 +
 third_party/resolv_wrapper/wscript           |  2 +
 third_party/socket_wrapper/wscript           |  4 +-
 third_party/uid_wrapper/wscript              |  4 +-
 45 files changed, 316 insertions(+), 82 deletions(-)
 create mode 100755 ctdb/tests/simple/79_volatile_db_traverse.sh


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index cc08e0d..1b1e88a 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -365,7 +365,7 @@ def CHECK_CODE(conf, code, define,
                headers=None, msg=None, cflags='', includes='# .',
                local_include=True, lib=None, link=True,
                define_ret=False, quote=False,
-               on_target=True):
+               on_target=True, strict=False):
     '''check if some code compiles and/or runs'''
 
     if CONFIG_SET(conf, define):
@@ -395,6 +395,16 @@ def CHECK_CODE(conf, code, define,
 
     cflags = TO_LIST(cflags)
 
+    # Be strict when relying on a compiler check
+    # Some compilers (e.g. xlc) ignore non-supported features as warnings
+    if strict:
+        extra_cflags = None
+        if conf.env["CC_NAME"] == "gcc":
+            extra_cflags = "-Werror"
+        elif conf.env["CC_NAME"] == "xlc":
+            extra_cflags = "-qhalt=w"
+        cflags.append(extra_cflags)
+
     if local_include:
         cflags.append('-I%s' % conf.curdir)
 
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index 3b36b57..1567c4b 100644
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -374,6 +374,7 @@ def configure(conf):
         conf.CHECK_CODE('''int main(void) { return 0; }
                            __attribute__((visibility("default"))) void vis_foo2(void) {}''',
                         cflags=conf.env.VISIBILITY_CFLAGS,
+                        strict=True,
                         define='HAVE_VISIBILITY_ATTR', addmain=False)
 
     # check HAVE_CONSTRUCTOR_ATTRIBUTE
@@ -391,6 +392,7 @@ def configure(conf):
             ''',
             'HAVE_CONSTRUCTOR_ATTRIBUTE',
             addmain=False,
+            strict=True,
             msg='Checking for library constructor support')
 
         # check HAVE_DESTRUCTOR_ATTRIBUTE
@@ -408,6 +410,7 @@ def configure(conf):
             ''',
             'HAVE_DESTRUCTOR_ATTRIBUTE',
             addmain=False,
+            strict=True,
             msg='Checking for library destructor support')
 
     conf.CHECK_CODE('''
@@ -424,6 +427,7 @@ def configure(conf):
             ''',
             'HAVE___ATTRIBUTE__',
             addmain=False,
+            strict=True,
             msg='Checking for __attribute__')
 
     if sys.platform.startswith('aix'):
diff --git a/ctdb/client/client_tunnel.c b/ctdb/client/client_tunnel.c
index 17b6546..f3b1a00 100644
--- a/ctdb/client/client_tunnel.c
+++ b/ctdb/client/client_tunnel.c
@@ -431,8 +431,8 @@ struct tevent_req *ctdb_tunnel_request_send(TALLOC_CTX *mem_ctx,
 	};
 
 	if (destnode == CTDB_BROADCAST_ALL ||
-	    destnode == CTDB_BROADCAST_VNNMAP ||
-	    destnode == CTDB_BROADCAST_ALL) {
+	    destnode == CTDB_BROADCAST_ACTIVE ||
+	    destnode == CTDB_BROADCAST_CONNECTED) {
 		state->wait_for_reply = false;
 	}
 	if (! state->wait_for_reply) {
diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c
index 82526b5..ffaa1a7 100644
--- a/ctdb/common/ctdb_util.c
+++ b/ctdb/common/ctdb_util.c
@@ -389,8 +389,8 @@ void ctdb_canonicalize_ip(const ctdb_sock_addr *ip, ctdb_sock_addr *cip)
 			       sizeof(cip->ip.sin_addr));
 		} else {
 			cip->ip6.sin6_family = AF_INET6;
-#ifdef HAVE_SOCK_SIN_LEN
-			cip->ip6.sin_len = sizeof(ctdb_sock_addr);
+#ifdef HAVE_SOCK_SIN6_LEN
+			cip->ip6.sin6_len = sizeof(ctdb_sock_addr);
 #endif
 			cip->ip6.sin6_port   = ip->ip6.sin6_port;
 			memcpy(&cip->ip6.sin6_addr,
diff --git a/ctdb/common/sock_io.c b/ctdb/common/sock_io.c
index 3f7138f..e9e2fa3 100644
--- a/ctdb/common/sock_io.c
+++ b/ctdb/common/sock_io.c
@@ -275,7 +275,7 @@ int sock_queue_write(struct sock_queue *queue, uint8_t *buf, size_t buflen)
 {
 	struct tevent_req *req;
 	struct sock_queue_write_state *state;
-	bool status;
+	struct tevent_queue_entry *qentry;
 
 	if (buflen >= INT32_MAX) {
 		return -1;
@@ -289,9 +289,9 @@ int sock_queue_write(struct sock_queue *queue, uint8_t *buf, size_t buflen)
 	state->pkt = buf;
 	state->pkt_size = (uint32_t)buflen;
 
-	status = tevent_queue_add_entry(queue->queue, queue->ev, req,
+	qentry = tevent_queue_add_entry(queue->queue, queue->ev, req,
 					sock_queue_trigger, queue);
-	if (! status) {
+	if (qentry == NULL) {
 		talloc_free(req);
 		return -1;
 	}
diff --git a/ctdb/common/system_util.c b/ctdb/common/system_util.c
index f27eed7..f1e9763 100644
--- a/ctdb/common/system_util.c
+++ b/ctdb/common/system_util.c
@@ -154,7 +154,7 @@ static bool parse_ipv6(const char *s, const char *ifaces, unsigned port, ctdb_so
 		saddr->ip6.sin6_scope_id = if_nametoindex(ifaces);
 	}
 
-#ifdef HAVE_SOCK_SIN_LEN
+#ifdef HAVE_SOCK_SIN6_LEN
 	saddr->ip6.sin6_len = sizeof(*saddr);
 #endif
 	return true;
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index 8dfca3b..b7362a4 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -292,10 +292,9 @@
 	<title>Virtual Node Number (VNN) map</title>
 	<para>
 	  Consists of the number of virtual nodes and mapping from
-	  virtual node numbers to physical node numbers.  Virtual
-	  nodes host CTDB databases.  Only nodes that are
-	  participating in the VNN map can become lmaster or dmaster
-	  for database records.
+	  virtual node numbers to physical node numbers.  Only nodes
+	  that are participating in the VNN map can become lmaster for
+	  database records.
 	</para>
       </refsect3>
 
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 23cb7dc..25d0047 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -726,9 +726,12 @@ int ctdb_set_db_readonly(struct ctdb_context *ctdb,
 
 int ctdb_process_deferred_attach(struct ctdb_context *ctdb);
 
-int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
+int32_t ctdb_control_db_attach(struct ctdb_context *ctdb,
+			       TDB_DATA indata,
 			       TDB_DATA *outdata,
-			       uint8_t db_flags, uint32_t client_id,
+			       uint8_t db_flags,
+			       uint32_t srcnode,
+			       uint32_t client_id,
 			       struct ctdb_req_control_old *c,
 			       bool *async_reply);
 int32_t ctdb_control_db_detach(struct ctdb_context *ctdb, TDB_DATA indata,
diff --git a/ctdb/protocol/protocol.h b/ctdb/protocol/protocol.h
index cb807e3..7189fab 100644
--- a/ctdb/protocol/protocol.h
+++ b/ctdb/protocol/protocol.h
@@ -44,7 +44,7 @@ enum ctdb_operation {
 /* send a broadcast to all nodes in the cluster, active or not */
 #define CTDB_BROADCAST_ALL    0xF0000002
 /* send a broadcast to all nodes in the current vnn map */
-#define CTDB_BROADCAST_VNNMAP 0xF0000003
+#define CTDB_BROADCAST_ACTIVE 0xF0000003
 /* send a broadcast to all connected nodes */
 #define CTDB_BROADCAST_CONNECTED 0xF0000004
 /* send a broadcast to selected connected nodes */
diff --git a/ctdb/protocol/protocol_debug.c b/ctdb/protocol/protocol_debug.c
index 4e15663..a34f5a8 100644
--- a/ctdb/protocol/protocol_debug.c
+++ b/ctdb/protocol/protocol_debug.c
@@ -264,8 +264,8 @@ static void ctdb_pnn_print(uint32_t pnn, FILE *fp)
 		fprintf(fp, "CURRENT");
 	} else if (pnn == CTDB_BROADCAST_ALL) {
 		fprintf(fp, "ALL");
-	} else if (pnn == CTDB_BROADCAST_VNNMAP) {
-		fprintf(fp, "VNNMAP");
+	} else if (pnn == CTDB_BROADCAST_ACTIVE) {
+		fprintf(fp, "ACTIVE");
 	} else  if (pnn == CTDB_BROADCAST_CONNECTED) {
 		fprintf(fp, "CONNECTED");
 	} else if (pnn == CTDB_MULTICAST) {
diff --git a/ctdb/protocol/protocol_util.c b/ctdb/protocol/protocol_util.c
index 73652e7..c75555f 100644
--- a/ctdb/protocol/protocol_util.c
+++ b/ctdb/protocol/protocol_util.c
@@ -206,7 +206,7 @@ static int ipv6_from_string(const char *str, struct sockaddr_in6 *ip6)
 		return EINVAL;
 	}
 
-#ifdef HAVE_SOCK_SIN_LEN
+#ifdef HAVE_SOCK_SIN6_LEN
 	ip6->sin6_len = sizeof(*ip6);
 #endif
 	return 0;
diff --git a/ctdb/server/ctdb_cluster_mutex.c b/ctdb/server/ctdb_cluster_mutex.c
index 9397746..804c6d5 100644
--- a/ctdb/server/ctdb_cluster_mutex.c
+++ b/ctdb/server/ctdb_cluster_mutex.c
@@ -19,11 +19,11 @@
    along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <tevent.h>
-
 #include "replace.h"
 #include "system/network.h"
 
+#include <tevent.h>
+
 #include "lib/util/debug.h"
 #include "lib/util/time.h"
 #include "lib/util/strv.h"
diff --git a/ctdb/server/ctdb_control.c b/ctdb/server/ctdb_control.c
index b537cd1..848010e 100644
--- a/ctdb/server/ctdb_control.c
+++ b/ctdb/server/ctdb_control.c
@@ -267,18 +267,34 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
 	}
 
 	case CTDB_CONTROL_DB_ATTACH:
-	  return ctdb_control_db_attach(ctdb, indata, outdata, 0, client_id,
-					c, async_reply);
+	  return ctdb_control_db_attach(ctdb,
+					indata,
+					outdata,
+					0,
+					srcnode,
+					client_id,
+					c,
+					async_reply);
 
 	case CTDB_CONTROL_DB_ATTACH_PERSISTENT:
-	  return ctdb_control_db_attach(ctdb, indata, outdata,
-					CTDB_DB_FLAGS_PERSISTENT, client_id,
-					c, async_reply);
+	  return ctdb_control_db_attach(ctdb,
+					indata,
+					outdata,
+					CTDB_DB_FLAGS_PERSISTENT,
+					srcnode,
+					client_id,
+					c,
+					async_reply);
 
 	case CTDB_CONTROL_DB_ATTACH_REPLICATED:
-	  return ctdb_control_db_attach(ctdb, indata, outdata,
-					CTDB_DB_FLAGS_REPLICATED, client_id,
-					c, async_reply);
+	  return ctdb_control_db_attach(ctdb,
+					indata,
+					outdata,
+					CTDB_DB_FLAGS_REPLICATED,
+					srcnode,
+					client_id,
+					c,
+					async_reply);
 
 	case CTDB_CONTROL_SET_CALL:
 		return control_not_implemented("SET_CALL", NULL);
@@ -860,7 +876,7 @@ int ctdb_daemon_send_control(struct ctdb_context *ctdb, uint32_t destnode,
 		return -1;
 	}
 
-	if (((destnode == CTDB_BROADCAST_VNNMAP) || 
+	if (((destnode == CTDB_BROADCAST_ACTIVE) ||
 	     (destnode == CTDB_BROADCAST_ALL) ||
 	     (destnode == CTDB_BROADCAST_CONNECTED)) && 
 	    !(flags & CTDB_CTRL_FLAG_NOREPLY)) {
@@ -868,7 +884,7 @@ int ctdb_daemon_send_control(struct ctdb_context *ctdb, uint32_t destnode,
 		return -1;
 	}
 
-	if (destnode != CTDB_BROADCAST_VNNMAP && 
+	if (destnode != CTDB_BROADCAST_ACTIVE &&
 	    destnode != CTDB_BROADCAST_ALL && 
 	    destnode != CTDB_BROADCAST_CONNECTED && 
 	    (!ctdb_validate_pnn(ctdb, destnode) || 
diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c
index c199aac..ca5bb12 100644
--- a/ctdb/server/ctdb_ltdb_server.c
+++ b/ctdb/server/ctdb_ltdb_server.c
@@ -1105,9 +1105,12 @@ int ctdb_process_deferred_attach(struct ctdb_context *ctdb)
 /*
   a client has asked to attach a new database
  */
-int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
+int32_t ctdb_control_db_attach(struct ctdb_context *ctdb,
+			       TDB_DATA indata,
 			       TDB_DATA *outdata,
-			       uint8_t db_flags, uint32_t client_id,
+			       uint8_t db_flags,
+			       uint32_t srcnode,
+			       uint32_t client_id,
 			       struct ctdb_req_control_old *c,
 			       bool *async_reply)
 {
@@ -1128,7 +1131,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
 	 * allow all attach from the network since these are always from remote
 	 * recovery daemons.
 	 */
-	if (client_id != 0) {
+	if (srcnode == ctdb->pnn && client_id != 0) {
 		client = reqid_find(ctdb->idr, client_id, struct ctdb_client);
 	}
 	if (client != NULL) {
@@ -1535,9 +1538,15 @@ static void ctdb_ltdb_seqnum_check(struct tevent_context *ev,
 		TDB_DATA data;
 		data.dptr = (uint8_t *)&ctdb_db->db_id;
 		data.dsize = sizeof(uint32_t);
-		ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_VNNMAP, 0,
-					 CTDB_CONTROL_UPDATE_SEQNUM, 0, CTDB_CTRL_FLAG_NOREPLY,
-					 data, NULL, NULL);		
+		ctdb_daemon_send_control(ctdb,
+					 CTDB_BROADCAST_ACTIVE,
+					 0,
+					 CTDB_CONTROL_UPDATE_SEQNUM,
+					 0,
+					 CTDB_CTRL_FLAG_NOREPLY,
+					 data,
+					 NULL,
+					 NULL);
 	}
 	ctdb_db->seqnum = new_seqnum;
 
diff --git a/ctdb/server/ctdb_server.c b/ctdb/server/ctdb_server.c
index 8e31038..c991b85 100644
--- a/ctdb/server/ctdb_server.c
+++ b/ctdb/server/ctdb_server.c
@@ -394,14 +394,18 @@ static void ctdb_broadcast_packet_all(struct ctdb_context *ctdb,
 }
 
 /*
-  broadcast a packet to all nodes in the current vnnmap
+  broadcast a packet to all active nodes
 */
-static void ctdb_broadcast_packet_vnnmap(struct ctdb_context *ctdb, 
+static void ctdb_broadcast_packet_active(struct ctdb_context *ctdb,
 					 struct ctdb_req_header *hdr)
 {
 	int i;
-	for (i=0;i<ctdb->vnn_map->size;i++) {
-		hdr->destnode = ctdb->vnn_map->map[i];
+	for (i = 0; i < ctdb->num_nodes; i++) {
+		if (ctdb->nodes[i]->flags & NODE_FLAGS_INACTIVE) {
+			continue;
+		}
+
+		hdr->destnode = ctdb->nodes[i]->pnn;
 		ctdb_queue_packet(ctdb, hdr);
 	}
 }
@@ -435,8 +439,8 @@ void ctdb_queue_packet(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
 	case CTDB_BROADCAST_ALL:
 		ctdb_broadcast_packet_all(ctdb, hdr);
 		return;
-	case CTDB_BROADCAST_VNNMAP:
-		ctdb_broadcast_packet_vnnmap(ctdb, hdr);
+	case CTDB_BROADCAST_ACTIVE:
+		ctdb_broadcast_packet_active(ctdb, hdr);
 		return;
 	case CTDB_BROADCAST_CONNECTED:
 		ctdb_broadcast_packet_connected(ctdb, hdr);
diff --git a/ctdb/server/ctdb_traverse.c b/ctdb/server/ctdb_traverse.c
index 04a4113..5ea1970 100644
--- a/ctdb/server/ctdb_traverse.c
+++ b/ctdb/server/ctdb_traverse.c
@@ -387,8 +387,8 @@ static struct ctdb_traverse_all_handle *ctdb_daemon_traverse_all(struct ctdb_db_
 	}
 
 	if (ctdb_db_volatile(ctdb_db)) {
-		/* normal database, traverse all nodes */	  
-		destination = CTDB_BROADCAST_VNNMAP;
+		/* volatile database, traverse all active nodes */
+		destination = CTDB_BROADCAST_ACTIVE;
 	} else {
 		int i;
 		/* persistent database, traverse one node, preferably
diff --git a/ctdb/server/ipalloc.c b/ctdb/server/ipalloc.c
index caa5022..a699c14 100644
--- a/ctdb/server/ipalloc.c
+++ b/ctdb/server/ipalloc.c
@@ -19,11 +19,11 @@
    along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <talloc.h>
-
 #include "replace.h"
 #include "system/network.h"
 
+#include <talloc.h>
+
 #include "lib/util/debug.h"
 
 #include "common/logging.h"
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash
index b627c3e..dd84204 100644
--- a/ctdb/tests/scripts/integration.bash
+++ b/ctdb/tests/scripts/integration.bash
@@ -336,6 +336,7 @@ node_has_status ()
 	(frozen)       fpat='^[[:space:]]+frozen[[:space:]]+1$' ;;
 	(unfrozen)     fpat='^[[:space:]]+frozen[[:space:]]+0$' ;;
 	(recovered)    rpat='^Recovery mode:RECOVERY \(1\)$' ;;
+	(notlmaster)   rpat="^hash:.* lmaster:${pnn}\$" ;;
 	*)
 	    echo "node_has_status: unknown status \"$status\""
 	    return 1
diff --git a/ctdb/tests/simple/79_volatile_db_traverse.sh b/ctdb/tests/simple/79_volatile_db_traverse.sh
new file mode 100755
index 0000000..50732ca
--- /dev/null
+++ b/ctdb/tests/simple/79_volatile_db_traverse.sh
@@ -0,0 +1,94 @@
+#!/bin/bash
+
+test_info()
+{
+    cat <<EOF
+Confirm that traverses of volatile databases work as expected
+
+This is a very simple example.  It writes a single record, updates it
+on another node and then confirms that the correct value is found when
+traversing.  It then repeats this after removing the LMASTER role from
+the node where the value is updated.
+
+Expected results:
+
+* The expected records should be found
+
+EOF
+}
+
+. "${TEST_SCRIPTS_DIR}/integration.bash"
+
+ctdb_test_init "$@"
+
+set -e
+
+cluster_is_healthy
+
+# Reset configuration
+ctdb_restart_when_done
+
+#
+# Main test
+#
+TESTDB="traverse_db.tdb"
+
+echo "create volatile test database $TESTDB"
+try_command_on_node 0 $CTDB attach "$TESTDB"
+
+echo "wipe test database $TESTDB"
+try_command_on_node 0 $CTDB wipedb "$TESTDB"
+
+echo "write foo=bar0 on node 0"
+try_command_on_node 0 $CTDB writekey "$TESTDB" "foo" "bar0"
+
+echo "write foo=bar1 on node 1"
+try_command_on_node 1 $CTDB writekey "$TESTDB" "foo" "bar1"
+
+echo "do traverse on node 0"
+try_command_on_node -v 0 $CTDB catdb "$TESTDB"
+
+echo "do traverse on node 1"
+try_command_on_node -v 1 $CTDB catdb "$TESTDB"
+
+cat <<EOF
+
+Again, this time with lmaster role off on node 1
+
+EOF
+
+echo "wipe test database $TESTDB"
+try_command_on_node 0 $CTDB wipedb "$TESTDB"
+
+echo "switching off lmaster role on node 1"
+try_command_on_node 1 $CTDB setlmasterrole off
+
+try_command_on_node -v 1 $CTDB getcapabilities
+
+wait_until_node_has_status 1 notlmaster 10 0
+# Wait for recovery and new VNN map to be pushed


-- 
Samba Shared Repository



More information about the samba-cvs mailing list