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

Karolin Seeger kseeger at samba.org
Mon Mar 30 11:23:02 UTC 2020


The branch, v4-11-test has been updated
       via  8159513ac73 ctdb-recoverd: Avoid dereferencing NULL rec->nodemap
       via  10592fcd018 ctdb-daemon: Don't allow attach from recovery if recovery is not active
       via  938dd246786 ctdb-daemon: Remove more unused old client database functions
       via  5ef3effeaed ctdb-recovery: Remove old code for creating missing databases
       via  9beb8edf596 ctdb-recovery: Create database on nodes where it is missing
       via  44b330ad02f ctdb-recovery: Fetch database name from all nodes where it is attached
       via  678a5c33d69 ctdb-recovery: Pass db structure for each database recovery
       via  0d89960f18c ctdb-recovery: GET_DBMAP from all nodes
       via  62bb07b7b72 ctdb-recovery: Replace use of ctdb_dbid_map with local db_list
       via  92b0fcf3a4e ctdb-daemon: Respect CTDB_CTRL_FLAG_ATTACH_RECOVERY when attaching databases
       via  835f091f80a ctdb-recovery: Use CTDB_CTRL_FLAG_ATTACH_RECOVERY to attach during recovery
       via  c42aec419ff ctdb-protocol: Add control flag CTDB_CTRL_FLAG_ATTACH_RECOVERY
       via  eac703c1d31 ctdb-daemon: Remove unused old client database functions
       via  ac738d067ac ctdb-daemon: Fix database attach deferral logic
       via  436a746ed1a ctdb-recovery: Refactor banning a node into separate computation
       via  3640f428b13 ctdb-recovery: Don't trust nodemap obtained from local node
       via  3fa7d0c2ba4 ctdb-recovery: Consolidate node state
       via  1b703e591b6 ctdb-recovery: Fetched vnnmap is never used, so don't fetch it
       via  64d6c40bf1d ctdb-client: Factor out function client_db_tdb()
       via  9c3b0d389ce ctdb-daemon: Implement DB_VACUUM control
       via  b87b08a540f ctdb-vacuum: Only schedule next vacuum event if vacuuuming is scheduled
       via  c20ae7c8bc3 ctdb-daemon: Factor out code to create vacuuming child
       via  6a48db92ea7 ctdb-vacuum: Simplify recording of in-progress vacuuming child
       via  f0bd906afe7 ctdb-protocol: Add marshalling for control DB_VACUUM
       via  9a9dc4f05f4 ctdb-protocol: Add marshalling for struct ctdb_db_vacuum
       via  d036521725d ctdb-protocol: Add new control CTDB_CONTROL_DB_VACUUM
       via  bfdd98317b4 ctdb-vacuum: Avoid processing any more packets
       via  30d8a00c8e8 ctdb-daemon: Avoid memory leak when packet is deferred
       via  1d73ad17ec6 ctdb-recoverd: No need for database detach handler
       via  0a2428cf9f3 ctdb-recoverd: Drop VACUUM_FETCH message handling
       via  9aa7e66651d ctdb-vacuum: Replace VACUUM_FETCH message with control
       via  190b34ff2cf ctdb-vacuum: Add processing of fetch queue
       via  ee045a05acb ctdb-daemon: Add implementation of VACUUM_FETCH control
       via  8b81e9e93af ctdb-tests: Add marshalling tests for new control
       via  3eb8470086f ctdb-protocol: Add marshalling for new control VACUUM_FETCH
       via  08f7a43dda5 ctdb-protocol: Add new control VACUUM_FETCH
       via  3564e7c2940 ctdb-tests: Drop code releated to obsolete controls
       via  42e293f7e2e ctdb-protocol: Drop code related to obsolete controls
       via  e7a6abca56a ctdb-client: Fix some typos in debug messages
      from  45fab149767 selftest: test samba-tool group commands with groupnames with brackets and spaces

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


- Log -----------------------------------------------------------------
commit 8159513ac73839a249a8adb059be9dbea9a57681
Author: Martin Schwenke <martin at meltin.net>
Date:   Sun Mar 22 13:46:46 2020 +1100

    ctdb-recoverd: Avoid dereferencing NULL rec->nodemap
    
    Inside the nested event loop in ctdb_ctrl_getnodemap(), various
    asynchronous handlers may dereference rec->nodemap, which will be
    NULL.
    
    One example is lost_reclock_handler(), which causes rec->nodemap to be
    unconditionally dereferenced in list_of_nodes() via this call chain:
    
      list_of_nodes()
      list_of_active_nodes()
      set_recovery_mode()
      force_election()
      lost_reclock_handler()
    
    Instead of attempting to trace all of the cases, just avoid leaving
    rec->nodemap set to NULL.  Attempting to use an old value is generally
    harmless, especially since it will be the same as the new value in
    most cases.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14324
    
    Reported-by: Volker Lendecke <vl at samba.org>
    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): Tue Mar 24 01:22:45 UTC 2020 on sn-devel-184
    
    (cherry picked from commit 716f52f68b248ae7cfd66479b3fc678c4a0d8b38)
    
    Autobuild-User(v4-11-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-11-test): Mon Mar 30 11:22:26 UTC 2020 on sn-devel-184

commit 10592fcd018b770c6ff877b06bedfa7cdd0d88cd
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Feb 25 17:32:56 2020 +1100

    ctdb-daemon: Don't allow attach from recovery if recovery is not active
    
    Neither the recovery daemon nor the recovery helper should attach
    databases outside of the recovery process.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 147afe77de372ddb9c180228d6fe1b04cca4610f)

commit 938dd2467866538ff963c275e2abd4f650f48fa7
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Feb 25 06:20:32 2020 +1100

    ctdb-daemon: Remove more unused old client database functions
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 052f1bdb9cf78f53f584edd32f81ae8e01e8e86e)

commit 5ef3effeaedeb4b99eb1d9a8069bd5cded4c4493
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Feb 24 19:51:19 2020 +1100

    ctdb-recovery: Remove old code for creating missing databases
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 3a66d181b6f6199fca362fcb0aa06513645b589d)

commit 9beb8edf596445ccae85303b6f6695bd0e209db9
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Feb 24 11:31:33 2020 +1100

    ctdb-recovery: Create database on nodes where it is missing
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 76a8174279f42486b36cc41d5831d4e6613f172e)

commit 44b330ad02fb413ef12c3e39b385c907d2a3cb6f
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Feb 24 10:26:34 2020 +1100

    ctdb-recovery: Fetch database name from all nodes where it is attached
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit e6e63f8fb8194634135bf34cda18f6cc8ff69a7c)

commit 678a5c33d691a43aa57a7f0b4273b226f4f9daec
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Feb 21 16:51:10 2020 +1100

    ctdb-recovery: Pass db structure for each database recovery
    
    Instead of db_id and db_flags.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 1bdfeb3fdc06947a607957ab3d114f97bad5d7d7)

commit 0d89960f18c1b551a12a38766fdeb31ce7460a0a
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Feb 21 16:10:05 2020 +1100

    ctdb-recovery: GET_DBMAP from all nodes
    
    This builds a complete list of databases across the cluster so it can
    be used to create databases on the nodes where they are missing.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit c6f74e590f602e2ed38fe293468770a5e669aefa)

commit 62bb07b7b720538bef0e429dfac02cf250a6ee51
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Feb 21 12:24:39 2020 +1100

    ctdb-recovery: Replace use of ctdb_dbid_map with local db_list
    
    This will be used to build a merged list of databases from all nodes,
    allowing the recovery helper to create missing databases.
    
    It would be possible to also include the db_name field in this
    structure but that would cause a lot of churn.  This field is used
    locally in the recovery of each database so can continue to live in
    the relevant state structure(s).
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 4c0b9c36050a0ed8a180d4ac1853224089528e8e)

commit 92b0fcf3a4ef1eab39c12ed289af0a8fddaf8165
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Feb 26 11:50:09 2020 +1100

    ctdb-daemon: Respect CTDB_CTRL_FLAG_ATTACH_RECOVERY when attaching databases
    
    This is currently only set by the recovery daemon when it attaches
    missing databases, so there is no obvious behaviour change.  However,
    attaching missing databases can now be moved to the recovery helper as
    long as it sets this flag.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 7e5a8a4884ea87bb985fe0e2b65ff130fc2ba8aa)

commit 835f091f80af8d4264b5b9d008f809c845f48bd6
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Feb 21 11:13:05 2020 +1100

    ctdb-recovery: Use CTDB_CTRL_FLAG_ATTACH_RECOVERY to attach during recovery
    
    ctdb_ctrl_createdb() is only called by the recovery daemon, so this is
    a safe, temporary change.  This is temporary because
    ctdb_ctrl_createdb(), create_missing_remote_databases() and
    create_missing_local_databases() will all go away soon.
    
    Note that this doesn't cause a change in behaviour.  The main daemon
    will still only defer attaches from non-recoverd processes during
    recovery.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 98e3d0db2bc5f33217e26fab1dfb4bb91eae534f)

commit c42aec419ff97a842fe580c2e9c91eeb333b1828
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Feb 21 11:04:14 2020 +1100

    ctdb-protocol: Add control flag CTDB_CTRL_FLAG_ATTACH_RECOVERY
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 17ed0425904a98624284d351ab7617b3e02c0f7b)

commit eac703c1d31b973b824ae794b52f4e107f4c6741
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Feb 26 17:03:49 2020 +1100

    ctdb-daemon: Remove unused old client database functions
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit fc23cd1b9cdd1d70067491614b16e616291e8ff2)

commit ac738d067ac65596ff37bd8fb8b64e49f7548591
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Feb 20 13:48:13 2020 +1100

    ctdb-daemon: Fix database attach deferral logic
    
    Commit 3cc230b5eeca749ab68d19cfda969f72c269f1f6 says:
    
      Dont allow clients to connect to databases untile we are well past
      and through the initial recovery phase
    
    It is unclear what this commit was attempting to do.  The commit
    message implies that more attaches should be deferred but the code
    change adds a conjunction that causes less attaches to be deferred.
    In particular, no attaches will be deferred after startup is complete.
    This seems wrong.
    
    To implement what seems to be stated in the commit message an "or"
    needs to be used so that non-recovery daemon attaches are deferred
    either when in recovery or before startup is complete.  Making this
    change highlights that attaches need to be allowed during the
    "startup" event because this is when smbd is started.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit c6c89495fbe9b6f238d10a538eccc92b937a69de)

commit 436a746ed1ac1269348066800e54511d08b0df9e
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Mar 2 16:16:26 2020 +1100

    ctdb-recovery: Refactor banning a node into separate computation
    
    If a node is marked for banning, confirm that it's not become inactive
    during the recovery.  If yes, then don't ban the node.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 1c56d6413f86cc15ebac232f39ef1e2a53ae4297)

commit 3640f428b133d2fe25a153607c842e473add19c8
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Feb 18 16:17:00 2020 +1100

    ctdb-recovery: Don't trust nodemap obtained from local node
    
    It's possible to have a node stopped, but recovery master not yet
    updated flags on the local ctdb daemon when recovery is started.  So do
    not trust the list of active nodes obtained from the local node.  Query
    the connected nodes to calculate the list of active nodes.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit c6a0ff1bed0265e44fd6135d16bfc41919fe5bf5)

commit 3fa7d0c2ba40a0f2ba1248c611187870c7af8ffb
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Mar 2 15:07:21 2020 +1100

    ctdb-recovery: Consolidate node state
    
    This avoids passing multiple arguments to async computation.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 6e2f8756f1bce4dfc7fdc435e082f400116e29ec)

commit 1b703e591b656cfd86ba9539c37e417d66024b3c
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Mar 2 13:59:42 2020 +1100

    ctdb-recovery: Fetched vnnmap is never used, so don't fetch it
    
    New vnnmap is constructed using the information from all the connected
    nodes.  So there is no need to fetch the vnnmap from recovery master.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 072ff4d12b8f34766120ddae888d772e97bca491)

commit 64d6c40bf1da6c5e754bb208cf8c7eb2aa193022
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Sep 27 16:49:01 2019 +1000

    ctdb-client: Factor out function client_db_tdb()
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 439ef65d290357e513103530183091a9a6fed197)

commit 9c3b0d389ce9828e6681e3bf52804ed34df5b25c
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jul 30 14:17:11 2019 +1000

    ctdb-daemon: Implement DB_VACUUM control
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 41a41d5f3e2b8e16e25221e14939dc5962997ac7)

commit b87b08a540f20a42f9425e18a82f82cb8d9329bd
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Oct 15 16:36:44 2019 +1100

    ctdb-vacuum: Only schedule next vacuum event if vacuuuming is scheduled
    
    At the moment vacuuming is always scheduled.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit d462d64cdf001fd5d1cbf2a109df62e087ad0c49)

commit c20ae7c8bc32860b31fda943cde55319634d4971
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jul 30 14:16:13 2019 +1000

    ctdb-daemon: Factor out code to create vacuuming child
    
    This changes the behaviour for some failures from exiting to simply
    attempting to schedule the next run.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 13cedaf0195c6bda3a3820aedb1ee65f36dfc23e)

commit 6a48db92ea77c93acf2bad49f0e2541b7c8707e5
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Oct 4 12:06:21 2019 +1000

    ctdb-vacuum: Simplify recording of in-progress vacuuming child
    
    There can only be one, so simplify the logic.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 5539edfdbe69d1d5f084d06753cce8ed6e524999)

commit f0bd906afe75844262d716cdf6ec364e1c9e25a2
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jul 30 10:52:05 2019 +1000

    ctdb-protocol: Add marshalling for control DB_VACUUM
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 496204feb0e2b6eb2f3d9a74e45596a3e74ad9b1)

commit 9a9dc4f05f4fdaf3eb0253628e5d6ffa5b029151
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jul 30 16:59:37 2019 +1000

    ctdb-protocol: Add marshalling for struct ctdb_db_vacuum
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit a896486b62bbcf9915727ba7bfc768fb5383f0c7)

commit d036521725dbec030233e4e787accf0db6b134e6
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jul 30 10:34:03 2019 +1000

    ctdb-protocol: Add new control CTDB_CONTROL_DB_VACUUM
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit b314835341e4028f0770fa7f9a37d2d21448ddfd)

commit bfdd98317b40391d1733bcca39b66bf40c66814d
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Oct 1 15:05:10 2019 +1000

    ctdb-vacuum: Avoid processing any more packets
    
    All the vacuum operations if required have an event loop to ensure
    completion of pending operations.  Once all the steps are complete,
    there is no reason to process any more packets.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit d0cc9edc05b6218a8e20a0a8009cbb9918ff4d02)

commit 30d8a00c8e8a1536b043ddecb0cdd46cbc523bbe
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jun 6 15:47:13 2018 +0200

    ctdb-daemon: Avoid memory leak when packet is deferred
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 680df07630a94b3e76edefe98ee0986e7e5e1f12)

commit 1d73ad17ec60bb585816f9915497b00134e1b85a
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Feb 16 17:17:38 2018 +1100

    ctdb-recoverd: No need for database detach handler
    
    The only reason for recoverd attaching to databases was to migrate
    records to the local node as part of vacuuming.  Recovery daemon does
    not take part in database vacuuming any more.
    
    The actual database recovery is handled via the recovery_helper and
    recovery daemon should not need to attach to the databases any more.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit c6427dddf5425b267d8c09e8df18653a48679646)

commit 0a2428cf9f34bde07e700f56ddeb5767a180973f
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Feb 16 17:13:35 2018 +1100

    ctdb-recoverd: Drop VACUUM_FETCH message handling
    
    This is now implemented in the ctdb daemon using VACUMM_FETCH control.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit fc81729dd2d8eddea1e60e22b183894d6541c7dc)

commit 9aa7e66651d4549a73dc5761a3ff55b2e2d4d373
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Feb 16 17:01:21 2018 +1100

    ctdb-vacuum: Replace VACUUM_FETCH message with control
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 498932c0e8e8614bd52f3270c4d63e2b5f9e26a4)

commit 190b34ff2cfa4f529d1e37bbc995359fc4abac7d
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Feb 16 17:00:40 2018 +1100

    ctdb-vacuum: Add processing of fetch queue
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 86521837b684df3b7c5a0a1e3b7e606c8b91f63e)

commit ee045a05acb5a2024a280469ea95c860bff8a5c9
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Feb 16 15:30:13 2018 +1100

    ctdb-daemon: Add implementation of VACUUM_FETCH control
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit da617f90d90151f955ee354c57bdc4bc6f6498f2)

commit 8b81e9e93afe8be7a55b41c90372e523fa6fd6b1
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Feb 16 17:28:49 2018 +1100

    ctdb-tests: Add marshalling tests for new control
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 36f9b4953a8def40681a6f02f6576795a1ba5fbe)

commit 3eb8470086f0e88c628c6e498fbde6d5200cd87d
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Feb 15 11:57:44 2018 +1100

    ctdb-protocol: Add marshalling for new control VACUUM_FETCH
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit b71d8cd80f84169bacf2dd1e753e468a305c50ce)

commit 08f7a43dda5ce2dc8ed7ede1168de80f27cd0d23
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Feb 15 11:57:24 2018 +1100

    ctdb-protocol: Add new control VACUUM_FETCH
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 0872c52ef0497f96f53318cf7e4d31be0854adde)

commit 3564e7c2940329ba5617ed89c6e382976142f4e1
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Feb 15 12:28:11 2018 +1100

    ctdb-tests: Drop code releated to obsolete controls
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 913bd331f65e9fe3d7cb16e041cd37b01987841f)

commit 42e293f7e2e919285964e50bbcc5a04e7fbb170a
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Feb 15 12:13:53 2018 +1100

    ctdb-protocol: Drop code related to obsolete controls
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 688567f080156892270cbfb2907cd712cb77cb7a)

commit e7a6abca56a471af66e142931ac513caf7d2660d
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Sep 4 14:14:22 2019 +1000

    ctdb-client: Fix some typos in debug messages
    
      tdb_sore -> tdb_store
      SCHDULE_FOR_DELETION -> SCHEDULE_FOR_DELETION
    
    Switch to modern debug macros while touching the lines.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Tue Sep 17 05:52:15 UTC 2019 on sn-devel-184
    
    (cherry picked from commit 84f544b55f235e2f08596bf4b7854460af008f88)

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

Summary of changes:
 ctdb/client/client_db.c               |   47 +-
 ctdb/client/client_private.h          |    4 +
 ctdb/include/ctdb_client.h            |   34 -
 ctdb/include/ctdb_private.h           |   12 +-
 ctdb/protocol/protocol.h              |   10 +
 ctdb/protocol/protocol_api.h          |    8 +
 ctdb/protocol/protocol_client.c       |   57 +-
 ctdb/protocol/protocol_control.c      |  107 ++-
 ctdb/protocol/protocol_debug.c        |    2 +
 ctdb/protocol/protocol_private.h      |   10 +
 ctdb/protocol/protocol_types.c        |   63 ++
 ctdb/server/ctdb_client.c             |  242 ------
 ctdb/server/ctdb_control.c            |   12 +
 ctdb/server/ctdb_freeze.c             |    9 +-
 ctdb/server/ctdb_ltdb_server.c        |   27 +-
 ctdb/server/ctdb_recoverd.c           |  353 +-------
 ctdb/server/ctdb_recovery_helper.c    | 1478 ++++++++++++++++++++++++---------
 ctdb/server/ctdb_server.c             |    3 +-
 ctdb/server/ctdb_vacuum.c             |  535 ++++++++++--
 ctdb/tests/cunit/protocol_test_101.sh |    2 +-
 ctdb/tests/src/protocol_common.c      |   13 +
 ctdb/tests/src/protocol_common.h      |    4 +
 ctdb/tests/src/protocol_common_ctdb.c |  108 +--
 ctdb/tests/src/protocol_ctdb_test.c   |    2 +-
 ctdb/tests/src/protocol_types_test.c  |    2 +
 25 files changed, 1887 insertions(+), 1257 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/client/client_db.c b/ctdb/client/client_db.c
index dfa8d970de5..0b06d6e5e52 100644
--- a/ctdb/client/client_db.c
+++ b/ctdb/client/client_db.c
@@ -37,6 +37,11 @@
 #include "client/client_private.h"
 #include "client/client.h"
 
+struct tdb_context *client_db_tdb(struct ctdb_db_context *db)
+{
+	return db->ltdb->tdb;
+}
+
 static struct ctdb_db_context *client_db_handle(
 					struct ctdb_client_context *client,
 					const char *db_name)
@@ -835,11 +840,11 @@ int ctdb_db_traverse_local(struct ctdb_db_context *db, bool readonly,
 	state.error = 0;
 
 	if (readonly) {
-		ret = tdb_traverse_read(db->ltdb->tdb,
+		ret = tdb_traverse_read(client_db_tdb(db),
 					ctdb_db_traverse_local_handler,
 					&state);
 	} else {
-		ret = tdb_traverse(db->ltdb->tdb,
+		ret = tdb_traverse(client_db_tdb(db),
 				   ctdb_db_traverse_local_handler, &state);
 	}
 
@@ -1105,14 +1110,14 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *db, TDB_DATA key,
 	size_t np;
 	int ret;
 
-	rec = tdb_fetch(db->ltdb->tdb, key);
+	rec = tdb_fetch(client_db_tdb(db), key);
 	if (rec.dsize < sizeof(struct ctdb_ltdb_header)) {
 		/* No record present */
 		if (rec.dptr != NULL) {
 			free(rec.dptr);
 		}
 
-		if (tdb_error(db->ltdb->tdb) != TDB_ERR_NOEXIST) {
+		if (tdb_error(client_db_tdb(db)) != TDB_ERR_NOEXIST) {
 			return EIO;
 		}
 
@@ -1235,18 +1240,18 @@ static int ctdb_fetch_lock_check(struct tevent_req *req)
 	int ret, err = 0;
 	bool do_migrate = false;
 
-	ret = tdb_chainlock(h->db->ltdb->tdb, h->key);
+	ret = tdb_chainlock(client_db_tdb(h->db), h->key);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,
 		      ("fetch_lock: %s tdb_chainlock failed, %s\n",
-		       h->db->db_name, tdb_errorstr(h->db->ltdb->tdb)));
+		       h->db->db_name, tdb_errorstr(client_db_tdb(h->db))));
 		err = EIO;
 		goto failed;
 	}
 
-	data = tdb_fetch(h->db->ltdb->tdb, h->key);
+	data = tdb_fetch(client_db_tdb(h->db), h->key);
 	if (data.dptr == NULL) {
-		if (tdb_error(h->db->ltdb->tdb) == TDB_ERR_NOEXIST) {
+		if (tdb_error(client_db_tdb(h->db)) == TDB_ERR_NOEXIST) {
 			goto migrate;
 		} else {
 			err = EIO;
@@ -1297,11 +1302,11 @@ failed:
 	if (data.dptr != NULL) {
 		free(data.dptr);
 	}
-	ret = tdb_chainunlock(h->db->ltdb->tdb, h->key);
+	ret = tdb_chainunlock(client_db_tdb(h->db), h->key);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,
 		      ("fetch_lock: %s tdb_chainunlock failed, %s\n",
-		       h->db->db_name, tdb_errorstr(h->db->ltdb->tdb)));
+		       h->db->db_name, tdb_errorstr(client_db_tdb(h->db))));
 		return EIO;
 	}
 
@@ -1377,11 +1382,11 @@ static int ctdb_record_handle_destructor(struct ctdb_record_handle *h)
 {
 	int ret;
 
-	ret = tdb_chainunlock(h->db->ltdb->tdb, h->key);
+	ret = tdb_chainunlock(client_db_tdb(h->db), h->key);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,
 		      ("fetch_lock: %s tdb_chainunlock failed, %s\n",
-		       h->db->db_name, tdb_errorstr(h->db->ltdb->tdb)));
+		       h->db->db_name, tdb_errorstr(client_db_tdb(h->db))));
 	}
 	free(h->data.dptr);
 	return 0;
@@ -1487,11 +1492,11 @@ int ctdb_store_record(struct ctdb_record_handle *h, TDB_DATA data)
 	rec[1].dsize = data.dsize;
 	rec[1].dptr = data.dptr;
 
-	ret = tdb_storev(h->db->ltdb->tdb, h->key, rec, 2, TDB_REPLACE);
+	ret = tdb_storev(client_db_tdb(h->db), h->key, rec, 2, TDB_REPLACE);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,
 		      ("store_record: %s tdb_storev failed, %s\n",
-		       h->db->db_name, tdb_errorstr(h->db->ltdb->tdb)));
+		       h->db->db_name, tdb_errorstr(client_db_tdb(h->db))));
 		return EIO;
 	}
 
@@ -1538,11 +1543,11 @@ struct tevent_req *ctdb_delete_record_send(TALLOC_CTX *mem_ctx,
 	rec.dsize = np;
 	rec.dptr = header;
 
-	ret = tdb_store(h->db->ltdb->tdb, h->key, rec, TDB_REPLACE);
+	ret = tdb_store(client_db_tdb(h->db), h->key, rec, TDB_REPLACE);
 	if (ret != 0) {
-		DEBUG(DEBUG_ERR,
-		      ("fetch_lock delete: %s tdb_sore failed, %s\n",
-		       h->db->db_name, tdb_errorstr(h->db->ltdb->tdb)));
+		D_ERR("fetch_lock delete: %s tdb_store failed, %s\n",
+		      h->db->db_name,
+		      tdb_errorstr(client_db_tdb(h->db)));
 		tevent_req_error(req, EIO);
 		return tevent_req_post(req, ev);
 	}
@@ -1576,9 +1581,9 @@ static void ctdb_delete_record_done(struct tevent_req *subreq)
 	status = ctdb_client_control_recv(subreq, &ret, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (! status) {
-		DEBUG(DEBUG_ERR,
-		      ("delete_record: %s SCHDULE_FOR_DELETION failed, "
-		       "ret=%d\n", state->h->db->db_name, ret));
+		D_ERR("delete_record: %s SCHEDULE_FOR_DELETION failed, ret=%d\n",
+		      state->h->db->db_name,
+		      ret);
 		tevent_req_error(req, ret);
 		return;
 	}
diff --git a/ctdb/client/client_private.h b/ctdb/client/client_private.h
index bb1705534e6..0bb2ad590ea 100644
--- a/ctdb/client/client_private.h
+++ b/ctdb/client/client_private.h
@@ -77,6 +77,10 @@ struct ctdb_tunnel_context {
 void ctdb_client_reply_call(struct ctdb_client_context *client,
 			    uint8_t *buf, size_t buflen, uint32_t reqid);
 
+/* From client_db.c */
+
+struct tdb_context *client_db_tdb(struct ctdb_db_context *db);
+
 /* From client_message.c */
 
 void ctdb_client_req_message(struct ctdb_client_context *client,
diff --git a/ctdb/include/ctdb_client.h b/ctdb/include/ctdb_client.h
index ef4950ab533..198a8a38dbb 100644
--- a/ctdb/include/ctdb_client.h
+++ b/ctdb/include/ctdb_client.h
@@ -165,10 +165,6 @@ int ctdb_ctrl_getrecmaster(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx,
 int ctdb_ctrl_setrecmaster(struct ctdb_context *ctdb, struct timeval timeout,
 			   uint32_t destnode, uint32_t recmaster);
 
-int ctdb_ctrl_getdbmap(struct ctdb_context *ctdb, struct timeval timeout,
-		       uint32_t destnode, TALLOC_CTX *mem_ctx,
-		       struct ctdb_dbid_map_old **dbmap);
-
 int ctdb_ctrl_getnodemap(struct ctdb_context *ctdb, struct timeval timeout,
 			 uint32_t destnode, TALLOC_CTX *mem_ctx,
 			 struct ctdb_node_map_old **nodemap);
@@ -176,39 +172,9 @@ int ctdb_ctrl_getnodemap(struct ctdb_context *ctdb, struct timeval timeout,
 int ctdb_ctrl_get_runstate(struct ctdb_context *ctdb, struct timeval timeout,
 			   uint32_t destnode, uint32_t *runstate);
 
-int ctdb_ctrl_getdbpath(struct ctdb_context *ctdb, struct timeval timeout,
-			uint32_t destnode, uint32_t dbid,
-			TALLOC_CTX *mem_ctx, const char **path);
-int ctdb_ctrl_getdbname(struct ctdb_context *ctdb, struct timeval timeout,
-			uint32_t destnode, uint32_t dbid,
-			TALLOC_CTX *mem_ctx, const char **name);
-
-int ctdb_ctrl_createdb(struct ctdb_context *ctdb, struct timeval timeout,
-		       uint32_t destnode, TALLOC_CTX *mem_ctx,
-		       const char *name, uint8_t db_flags, uint32_t *db_id);
-
 int ctdb_ctrl_get_debuglevel(struct ctdb_context *ctdb, uint32_t destnode,
 			     int32_t *level);
 
-/*
-  attach to a ctdb database
-*/
-int ctdb_ctrl_db_open_flags(struct ctdb_context *ctdb, uint32_t db_id,
-			    int *tdb_flags);
-
-struct ctdb_db_context *ctdb_attach(struct ctdb_context *ctdb,
-				    struct timeval timeout,
-				    const char *name,
-				    uint8_t db_flags);
-
-/* a ctdb call function */
-typedef int (*ctdb_fn_t)(struct ctdb_call_info *);
-
-/*
-  setup a ctdb call function
-*/
-int ctdb_set_call(struct ctdb_db_context *ctdb_db, ctdb_fn_t fn, uint32_t id);
-
 int ctdb_ctrl_freeze(struct ctdb_context *ctdb, struct timeval timeout,
 		     uint32_t destnode);
 
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 7f160c0c9db..2f37db36e0c 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -36,6 +36,8 @@ struct ctdb_tcp_array {
 /*
   an installed ctdb remote call
 */
+typedef int (*ctdb_fn_t)(struct ctdb_call_info *);
+
 struct ctdb_registered_call {
 	struct ctdb_registered_call *next, *prev;
 	uint32_t id;
@@ -318,7 +320,7 @@ struct ctdb_context {
 
 	TALLOC_CTX *banning_ctx;
 
-	struct ctdb_vacuum_child_context *vacuumers;
+	struct ctdb_vacuum_child_context *vacuumer;
 
 	/* mapping from pid to ctdb_client * */
 	struct ctdb_client_pid_list *client_pids;
@@ -359,6 +361,7 @@ struct ctdb_db_context {
 	struct revokechild_handle *revokechild_active;
 	struct ctdb_persistent_state *persistent_state;
 	struct trbt_tree *delete_queue;
+	struct trbt_tree *fetch_queue;
 	struct trbt_tree *sticky_records; 
 	int (*ctdb_ltdb_store_fn)(struct ctdb_db_context *ctdb_db,
 				  TDB_DATA key,
@@ -985,6 +988,11 @@ int32_t ctdb_control_uptime(struct ctdb_context *ctdb, TDB_DATA *outdata);
 
 /* from ctdb_vacuum.c */
 
+int32_t ctdb_control_db_vacuum(struct ctdb_context *ctdb,
+			       struct ctdb_req_control_old *c,
+			       TDB_DATA indata,
+			       bool *async_reply);
+
 void ctdb_stop_vacuuming(struct ctdb_context *ctdb);
 int ctdb_vacuum_init(struct ctdb_db_context *ctdb_db);
 
@@ -998,6 +1006,8 @@ void ctdb_local_remove_from_delete_queue(struct ctdb_db_context *ctdb_db,
 					 const struct ctdb_ltdb_header *hdr,
 					 const TDB_DATA key);
 
+int32_t ctdb_control_vacuum_fetch(struct ctdb_context *ctdb, TDB_DATA indata);
+
 /* from eventscript.c */
 
 int ctdb_start_eventd(struct ctdb_context *ctdb);
diff --git a/ctdb/protocol/protocol.h b/ctdb/protocol/protocol.h
index b868553f6e8..04a651018be 100644
--- a/ctdb/protocol/protocol.h
+++ b/ctdb/protocol/protocol.h
@@ -373,6 +373,8 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
 		    CTDB_CONTROL_CHECK_PID_SRVID         = 151,
 		    CTDB_CONTROL_TUNNEL_REGISTER         = 152,
 		    CTDB_CONTROL_TUNNEL_DEREGISTER       = 153,
+		    CTDB_CONTROL_VACUUM_FETCH            = 154,
+		    CTDB_CONTROL_DB_VACUUM               = 155,
 };
 
 #define MAX_COUNT_BUCKETS 16
@@ -851,6 +853,12 @@ struct ctdb_pid_srvid {
 	uint64_t srvid;
 };
 
+struct ctdb_db_vacuum {
+	uint32_t db_id;
+	bool full_vacuum_run;
+
+};
+
 struct ctdb_req_control_data {
 	uint32_t opcode;
 	union {
@@ -888,6 +896,7 @@ struct ctdb_req_control_data {
 		struct ctdb_traverse_start_ext *traverse_start_ext;
 		struct ctdb_traverse_all_ext *traverse_all_ext;
 		struct ctdb_pid_srvid *pid_srvid;
+		struct ctdb_db_vacuum *db_vacuum;
 	} data;
 };
 
@@ -935,6 +944,7 @@ struct ctdb_req_control {
 #define CTDB_CTRL_FLAG_OPCODE_SPECIFIC   0xFFFF0000
 /* Ugly overloading of this field... */
 #define CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE 0x00010000
+#define CTDB_CTRL_FLAG_ATTACH_RECOVERY      0x00020000
 	uint32_t flags;
 	struct ctdb_req_control_data rdata;
 };
diff --git a/ctdb/protocol/protocol_api.h b/ctdb/protocol/protocol_api.h
index 6104c10e7b5..c2cd4a76289 100644
--- a/ctdb/protocol/protocol_api.h
+++ b/ctdb/protocol/protocol_api.h
@@ -603,6 +603,14 @@ void ctdb_req_control_tunnel_deregister(struct ctdb_req_control *request,
 					uint64_t tunnel_id);
 int ctdb_reply_control_tunnel_deregister(struct ctdb_reply_control *reply);
 
+void ctdb_req_control_vacuum_fetch(struct ctdb_req_control *request,
+				   struct ctdb_rec_buffer *recbuf);
+int ctdb_reply_control_vacuum_fetch(struct ctdb_reply_control *reply);
+
+void ctdb_req_control_db_vacuum(struct ctdb_req_control *request,
+				struct ctdb_db_vacuum *db_vacuum);
+int ctdb_reply_control_db_vacuum(struct ctdb_reply_control *reply);
+
 /* From protocol/protocol_debug.c */
 
 void ctdb_packet_print(uint8_t *buf, size_t buflen, FILE *fp);
diff --git a/ctdb/protocol/protocol_client.c b/ctdb/protocol/protocol_client.c
index 9aa32a9bba7..84dc55a34a3 100644
--- a/ctdb/protocol/protocol_client.c
+++ b/ctdb/protocol/protocol_client.c
@@ -424,8 +424,6 @@ int ctdb_reply_control_db_attach(struct ctdb_reply_control *reply,
 	return reply->status;
 }
 
-/* CTDB_CONTROL_SET_CALL */
-
 /* CTDB_CONTROL_TRAVERSE_START */
 
 void ctdb_req_control_traverse_start(struct ctdb_req_control *request,
@@ -718,8 +716,6 @@ int ctdb_reply_control_shutdown(struct ctdb_reply_control *reply)
 	return ctdb_reply_control_generic(reply, CTDB_CONTROL_SHUTDOWN);
 }
 
-/* CTDB_CONTROL_GET_MONMODE */
-
 /* CTDB_CONTROL_TCP_CLIENT */
 
 void ctdb_req_control_tcp_client(struct ctdb_req_control *request,
@@ -1170,9 +1166,6 @@ int ctdb_reply_control_try_delete_records(struct ctdb_reply_control *reply,
 	return reply->status;
 }
 
-/* CTDB_CONTROL_ENABLE_MONITOR */
-/* CTDB_CONTROL_DISABLE_MONITOR */
-
 /* CTDB_CONTROL_ADD_PUBLIC_IP */
 
 void ctdb_req_control_add_public_ip(struct ctdb_req_control *request,
@@ -1855,8 +1848,6 @@ int ctdb_reply_control_set_db_readonly(struct ctdb_reply_control *reply)
 	return ctdb_reply_control_generic(reply, CTDB_CONTROL_SET_DB_READONLY);
 }
 
-/* CTDB_CONTROL_CHECK_SRVIDS */
-
 /* CTDB_CONTROL_TRAVERSE_START_EXT */
 
 void ctdb_req_control_traverse_start_ext(struct ctdb_req_control *request,
@@ -2342,3 +2333,51 @@ int ctdb_reply_control_tunnel_deregister(struct ctdb_reply_control *reply)
 
 	return reply->status;
 }
+
+/* CTDB_CONTROL_VACUUM_FETCH */
+
+void ctdb_req_control_vacuum_fetch(struct ctdb_req_control *request,
+				   struct ctdb_rec_buffer *recbuf)
+{
+	request->opcode = CTDB_CONTROL_VACUUM_FETCH;
+	request->pad = 0;
+	request->srvid = 0;
+	request->client_id = 0;
+	request->flags = 0;
+
+	request->rdata.opcode = CTDB_CONTROL_VACUUM_FETCH;
+	request->rdata.data.recbuf = recbuf;
+}
+
+int ctdb_reply_control_vacuum_fetch(struct ctdb_reply_control *reply)
+{
+	if (reply->rdata.opcode != CTDB_CONTROL_VACUUM_FETCH) {
+		return EPROTO;
+	}
+
+	return reply->status;
+}
+
+/* CTDB_CONTROL_DB_VACUUM */
+
+void ctdb_req_control_db_vacuum(struct ctdb_req_control *request,
+				struct ctdb_db_vacuum *db_vacuum)
+{
+	request->opcode = CTDB_CONTROL_DB_VACUUM;
+	request->pad = 0;
+	request->srvid = 0;
+	request->client_id = 0;
+	request->flags = 0;
+
+	request->rdata.opcode = CTDB_CONTROL_DB_VACUUM;
+	request->rdata.data.db_vacuum = db_vacuum;
+}
+
+int ctdb_reply_control_db_vacuum(struct ctdb_reply_control *reply)
+{
+	if (reply->rdata.opcode != CTDB_CONTROL_DB_VACUUM) {
+		return EPROTO;
+	}
+
+	return reply->status;
+}
diff --git a/ctdb/protocol/protocol_control.c b/ctdb/protocol/protocol_control.c
index 0b88b5c8b5a..a25c9b1cfe0 100644
--- a/ctdb/protocol/protocol_control.c
+++ b/ctdb/protocol/protocol_control.c
@@ -90,9 +90,6 @@ static size_t ctdb_req_control_data_len(struct ctdb_req_control_data *cd)
 		len = ctdb_string_len(&cd->data.db_name);
 		break;
 
-	case CTDB_CONTROL_SET_CALL:
-		break;
-
 	case CTDB_CONTROL_TRAVERSE_START:
 		len = ctdb_traverse_start_len(cd->data.traverse_start);
 		break;
@@ -145,9 +142,6 @@ static size_t ctdb_req_control_data_len(struct ctdb_req_control_data *cd)
 	case CTDB_CONTROL_SHUTDOWN:
 		break;
 
-	case CTDB_CONTROL_GET_MONMODE:
-		break;
-
 	case CTDB_CONTROL_TCP_CLIENT:
 		len = ctdb_connection_len(cd->data.conn);
 		break;
@@ -221,12 +215,6 @@ static size_t ctdb_req_control_data_len(struct ctdb_req_control_data *cd)
 		len = ctdb_rec_buffer_len(cd->data.recbuf);
 		break;
 
-	case CTDB_CONTROL_ENABLE_MONITOR:
-		break;
-
-	case CTDB_CONTROL_DISABLE_MONITOR:
-		break;
-
 	case CTDB_CONTROL_ADD_PUBLIC_IP:
 		len = ctdb_addr_info_len(cd->data.addr_info);
 		break;
@@ -338,9 +326,6 @@ static size_t ctdb_req_control_data_len(struct ctdb_req_control_data *cd)
 		len = ctdb_uint32_len(&cd->data.db_id);
 		break;
 
-	case CTDB_CONTROL_CHECK_SRVIDS:
-		break;
-
 	case CTDB_CONTROL_TRAVERSE_START_EXT:
 		len = ctdb_traverse_start_ext_len(cd->data.traverse_start_ext);
 		break;
@@ -422,6 +407,14 @@ static size_t ctdb_req_control_data_len(struct ctdb_req_control_data *cd)
 
 	case CTDB_CONTROL_TUNNEL_DEREGISTER:
 		break;
+
+	case CTDB_CONTROL_VACUUM_FETCH:
+		len = ctdb_rec_buffer_len(cd->data.recbuf);
+		break;
+
+	case CTDB_CONTROL_DB_VACUUM:
+		len = ctdb_db_vacuum_len(cd->data.db_vacuum);
+		break;
 	}
 
 	return len;
@@ -466,9 +459,6 @@ static void ctdb_req_control_data_push(struct ctdb_req_control_data *cd,
 		ctdb_string_push(&cd->data.db_name, buf, &np);
 		break;
 
-	case CTDB_CONTROL_SET_CALL:
-		break;
-
 	case CTDB_CONTROL_TRAVERSE_START:
 		ctdb_traverse_start_push(cd->data.traverse_start, buf, &np);
 		break;
@@ -635,9 +625,6 @@ static void ctdb_req_control_data_push(struct ctdb_req_control_data *cd,
 		ctdb_uint32_push(&cd->data.db_id, buf, &np);
 		break;
 
-	case CTDB_CONTROL_CHECK_SRVIDS:
-		break;
-
 	case CTDB_CONTROL_TRAVERSE_START_EXT:
 		ctdb_traverse_start_ext_push(cd->data.traverse_start_ext, buf,
 					     &np);
@@ -703,6 +690,14 @@ static void ctdb_req_control_data_push(struct ctdb_req_control_data *cd,
 	case CTDB_CONTROL_CHECK_PID_SRVID:


-- 
Samba Shared Repository



More information about the samba-cvs mailing list