[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via e32ad9b s3-waf: Link tdbsam against needed libraries. via d03ef6a s3-waf: Link against tdb_compat instead of tdb. from f2903e0 provision: Make sure target directory is created early. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit e32ad9b58648878e65c665797ab10dbadce16c14 Author: Andreas Schneider a...@samba.org Date: Tue Feb 7 11:11:15 2012 +0100 s3-waf: Link tdbsam against needed libraries. Autobuild-User: Andreas Schneider a...@cryptomilk.org Autobuild-Date: Tue Feb 7 12:49:59 CET 2012 on sn-devel-104 commit d03ef6ad91c3be0179191e9c7bf73747acf928ba Author: Andreas Schneider a...@samba.org Date: Mon Feb 6 12:47:16 2012 +0100 s3-waf: Link against tdb_compat instead of tdb. --- Summary of changes: source3/passdb/wscript_build |4 ++-- source3/wscript_build| 10 +- 2 files changed, 7 insertions(+), 7 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/passdb/wscript_build b/source3/passdb/wscript_build index a8b79fd..82c9634 100644 --- a/source3/passdb/wscript_build +++ b/source3/passdb/wscript_build @@ -9,7 +9,7 @@ PDB_WBC_SAM_SRC = 'pdb_wbc_sam.c' bld.SAMBA3_MODULE('pdb_tdbsam', subsystem='pdb', source=PDB_TDBSAM_SRC, - deps='samba-util tdb', + deps='samba-util tdb_compat dbwrap tdb-wrap3', init_function='', internal_module=bld.SAMBA3_IS_STATIC_MODULE('pdb_tdbsam'), enabled=bld.SAMBA3_IS_ENABLED_MODULE('pdb_tdbsam')) @@ -57,6 +57,6 @@ bld.SAMBA3_MODULE('pdb_samba4', bld.SAMBA3_PYTHON('pypassdb', source='py_passdb.c', deps='pdb', - public_deps='samba-util tdb talloc pyrpc_util', + public_deps='samba-util tdb_compat talloc pyrpc_util', realname='samba/samba3/passdb.so' ) diff --git a/source3/wscript_build b/source3/wscript_build index b6ceb18..cb16ef2 100755 --- a/source3/wscript_build +++ b/source3/wscript_build @@ -983,12 +983,12 @@ bld.SAMBA3_SUBSYSTEM('PROFILE', bld.SAMBA3_SUBSYSTEM('PRINTBASE', source=PRINTBASE_SRC, -deps='samba-util tdb', +deps='samba-util tdb_compat', vars=locals()) bld.SAMBA3_SUBSYSTEM('PRINTBACKEND', source=PRINTBACKEND_SRC, -deps='PRINTBASE LIBADS_PRINTER tdb printing_migrate', +deps='PRINTBASE LIBADS_PRINTER tdb_compat printing_migrate', vars=locals()) bld.SAMBA3_LIBRARY('printing_migrate', @@ -999,7 +999,7 @@ bld.SAMBA3_LIBRARY('printing_migrate', bld.SAMBA3_SUBSYSTEM('PRINTING', source=PRINTING_SRC, -deps='NDR_PRINTCAP tdb cups', +deps='NDR_PRINTCAP tdb_compat cups', vars=locals()) bld.SAMBA3_SUBSYSTEM('PASSWD_UTIL', @@ -1036,7 +1036,7 @@ bld.SAMBA3_SUBSYSTEM('LIBNET_SAMSYNC', bld.SAMBA3_SUBSYSTEM('LIBEVENTLOG', source=LIB_EVENTLOG_SRC, -deps='NDR_EVENTLOG tdb', +deps='NDR_EVENTLOG tdb_compat', vars=locals()) bld.SAMBA3_SUBSYSTEM('LIBNMB', @@ -1068,7 +1068,7 @@ bld.SAMBA3_SUBSYSTEM('SAMBA_VERSION', bld.SAMBA3_SUBSYSTEM('SLCACHE', source=SLCACHE_SRC, -deps='samba-util tdb', +deps='samba-util tdb_compat', vars=locals()) bld.SAMBA3_SUBSYSTEM('DCUTIL', -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 27f6421 s3: Increase debug level of basic ctdb packet handling from e32ad9b s3-waf: Link tdbsam against needed libraries. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 27f6421fa6caecf832ec544e4d4115301e76 Author: Volker Lendecke v...@samba.org Date: Tue Feb 7 16:41:25 2012 +0100 s3: Increase debug level of basic ctdb packet handling This clutters the debug level 10 output significantly without much value Autobuild-User: Volker Lendecke v...@samba.org Autobuild-Date: Tue Feb 7 18:19:08 CET 2012 on sn-devel-104 --- Summary of changes: source3/lib/ctdbd_conn.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 95dda52..12b736d 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -95,10 +95,10 @@ static void cluster_fatal(const char *why) */ static void ctdb_packet_dump(struct ctdb_req_header *hdr) { - if (DEBUGLEVEL 10) { + if (DEBUGLEVEL 11) { return; } - DEBUGADD(10, (len=%d, magic=%x, vers=%d, gen=%d, op=%d, reqid=%d\n, + DEBUGADD(11, (len=%d, magic=%x, vers=%d, gen=%d, op=%d, reqid=%d\n, (int)hdr-length, (int)hdr-ctdb_magic, (int)hdr-ctdb_version, (int)hdr-generation, (int)hdr-operation, (int)hdr-reqid)); @@ -249,7 +249,7 @@ static bool ctdb_req_complete(const uint8_t *buf, size_t available, msglen = *((uint32 *)buf); - DEBUG(10, (msglen = %d\n, msglen)); + DEBUG(11, (msglen = %d\n, msglen)); if (msglen sizeof(struct ctdb_req_header)) { DEBUG(0, (Got invalid msglen: %d, expected at least %d for @@ -349,8 +349,8 @@ static struct messaging_rec *ctdb_pull_messaging_rec(TALLOC_CTX *mem_ctx, return NULL; } - if (DEBUGLEVEL = 10) { - DEBUG(10, (ctdb_pull_messaging_rec:\n)); + if (DEBUGLEVEL = 11) { + DEBUG(11, (ctdb_pull_messaging_rec:\n)); NDR_PRINT_DEBUG(messaging_rec, result); } @@ -411,7 +411,7 @@ static NTSTATUS ctdb_read_req(struct ctdbd_connection *conn, uint32 reqid, hdr = (struct ctdb_req_header *)state.req.data; - DEBUG(10, (Received ctdb packet\n)); + DEBUG(11, (Received ctdb packet\n)); ctdb_packet_dump(hdr); if (hdr-operation == CTDB_REQ_MESSAGE) { -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 502186f Remove unused get_file_size() function. from 27f6421 s3: Increase debug level of basic ctdb packet handling http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 502186fe0ce4378e7eaf52bf33c38210cd0146cf Author: Jeremy Allison j...@samba.org Date: Tue Feb 7 10:20:36 2012 -0800 Remove unused get_file_size() function. Autobuild-User: Jeremy Allison j...@samba.org Autobuild-Date: Tue Feb 7 20:56:28 CET 2012 on sn-devel-104 --- Summary of changes: source3/include/proto.h |1 - source3/lib/util.c | 13 - 2 files changed, 0 insertions(+), 14 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/proto.h b/source3/include/proto.h index 3cfb93f..a94f6c4 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -490,7 +490,6 @@ bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf, bool fake_dir_create_times); bool socket_exist(const char *fname); uint64_t get_file_size_stat(const SMB_STRUCT_STAT *sbuf); -SMB_OFF_T get_file_size(char *file_name); void show_msg(const char *buf); int set_message_bcc(char *buf,int num_bytes); ssize_t message_push_blob(uint8 **outbuf, DATA_BLOB blob); diff --git a/source3/lib/util.c b/source3/lib/util.c index 2e432ab..b783c7e 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -127,19 +127,6 @@ uint64_t get_file_size_stat(const SMB_STRUCT_STAT *sbuf) } /*** - Returns the size in bytes of the named file. -/ - -SMB_OFF_T get_file_size(char *file_name) -{ - SMB_STRUCT_STAT buf; - buf.st_ex_size = 0; - if (sys_stat(file_name, buf, false) != 0) - return (SMB_OFF_T)-1; - return get_file_size_stat(buf); -} - -/*** Show a smb message structure. / -- Samba Shared Repository
[SCM] CTDB repository - branch master updated - ctdb-1.12-190-g3e5d2b6
The branch, master has been updated via 3e5d2b61fcb4d0062d2573d99724f630a4fc4622 (commit) via c6433e43ad2481d84e8d9a1ee1c6e29b90423a86 (commit) via 25d797f61c3b5b7090fb662adde6ed9e434e8a61 (commit) from 70d22efdf104db1fc951263cedfbdb95b0b44342 (commit) http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=master - Log - commit 3e5d2b61fcb4d0062d2573d99724f630a4fc4622 Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Wed Feb 8 08:59:53 2012 +1100 TESTS: Add a test that verifies that RecoverPDBBySeqNum works as expected. If this tunable is set to 1 AND the persistent database contains a record __db_sequence_number__ then we will recover the whole database as-is instead of doing the record by record recovery commit c6433e43ad2481d84e8d9a1ee1c6e29b90423a86 Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Tue Feb 7 12:14:57 2012 +1100 Ad test tool to store data and ctdb header into a local tdb file commit 25d797f61c3b5b7090fb662adde6ed9e434e8a61 Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Tue Feb 7 10:53:49 2012 +1100 TFETCH add verbose flag to print also the record ltdb heaer --- Summary of changes: tests/simple/70_recoverpdbbyseqnum.sh | 232 + tools/ctdb.c | 83 +++- 2 files changed, 309 insertions(+), 6 deletions(-) create mode 100755 tests/simple/70_recoverpdbbyseqnum.sh Changeset truncated at 500 lines: diff --git a/tests/simple/70_recoverpdbbyseqnum.sh b/tests/simple/70_recoverpdbbyseqnum.sh new file mode 100755 index 000..4b46cbb --- /dev/null +++ b/tests/simple/70_recoverpdbbyseqnum.sh @@ -0,0 +1,232 @@ +#!/bin/bash + +test_info() +{ +cat EOF +The tunable RecoverPDBBySeqNum controls how we perform recovery +on persistent databases. +The default is that persistent databases are recovered exactly the same +way as normal databases. That is that we recover record by record. + +If RecoverPDBBySeqNum is set to 1 AND if a record with the key +__db_sequence_number__ can be found in the database, then instead we will +perform the recovery by picking the copy of the database from the node +that has the highest sequence number and ignore the content on all other +nodes. + + +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. create a persistent test database +3. test that RecoveryPDBBySeqNum==0 and no seqnum record blends the database + during recovery +4. test that RecoveryPDBBySeqNum==0 and seqnum record blends the database + during recovery +5. test that RecoveryPDBBySeqNum==1 and no seqnum record blends the database + during recovery +6. test that RecoveryPDBBySeqNum==1 and seqnum record does not blend the database + during recovery + +Expected results: + +* that 3,4,5 will blend the databases and that 6 will recovery the highest seqnum + database + +EOF +} + +. ctdb_test_functions.bash + +ctdb_test_init $@ + +set -e + +cluster_is_healthy + +try_command_on_node 0 $CTDB listnodes +num_nodes=$(echo $out | wc -l) + +# create a temporary persistent database to test with +echo create persistent test database persistent_test.tdb +try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb attach persistent_test.tdb persistent + + +# set RecoverPDBBySeqNum=0 +echo setting RecoverPDBBySeqNum to 0 +try_command_on_node -q all $CTDB_TEST_WRAPPER ctdb setvar RecoverPDBBySeqNum 0 + + + +# 3, +# If RecoverPDBBySeqNum==0 and no __db_sequence_number__ +# recover record by record +# +# wipe database +echo +echo test that RecoverPDBBySeqNum==0 and no __db_sequence_number__ blends the database during recovery +echo wipe the test database +try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb wipedb persistent_test.tdb + +# add one record to node 0 key==ABC data==ABC +TDB=`try_command_on_node -v -q 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e s/.*path:// -e s/ .*//` +echo store key(ABC) data(ABC) on node 0 +try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x414243 0x0700414243 +# +# add one record to node 1 key==DEF data==DEF +TDB=`try_command_on_node -v -q 1 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e s/.*path:// -e s/ .*//` +echo store key(DEF) data(DEF) on node 1 +try_command_on_node -q 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x444546 0x0700444546 + +# force a recovery +echo force a recovery +try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb recover + +# check that we now have both records on node 0 +num_records=$(try_command_on_node -v -pq 0 $CTDB_TEST_WRAPPER ctdb cattdb persistent_test.tdb | grep key | egrep ABC|DEF | wc -l) +[ $num_records != 2 ] { +echo BAD: we did not
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via f8ef240 samba-tool sites: Re-add support for option groups via 8613bc7 samba-tool dns: Re-add support for option groups from 502186f Remove unused get_file_size() function. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f8ef24083193ee2dade7884178f583ecb204684c Author: Amitay Isaacs ami...@gmail.com Date: Tue Feb 7 17:30:22 2012 +1100 samba-tool sites: Re-add support for option groups Autobuild-User: Amitay Isaacs ami...@samba.org Autobuild-Date: Wed Feb 8 02:27:28 CET 2012 on sn-devel-104 commit 8613bc7ea1bbeec7c5b2c511fe7e601eea10c41e Author: Amitay Isaacs ami...@gmail.com Date: Tue Feb 7 17:27:18 2012 +1100 samba-tool dns: Re-add support for option groups --- Summary of changes: source4/scripting/python/samba/netcmd/dns.py | 60 source4/scripting/python/samba/netcmd/sites.py | 13 + 2 files changed, 73 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/scripting/python/samba/netcmd/dns.py b/source4/scripting/python/samba/netcmd/dns.py index 2ab4129..6d07db4 100644 --- a/source4/scripting/python/samba/netcmd/dns.py +++ b/source4/scripting/python/samba/netcmd/dns.py @@ -513,6 +513,12 @@ class cmd_serverinfo(Command): takes_args = [ 'server' ] +takes_optiongroups = { +sambaopts: options.SambaOptions, +versionopts: options.VersionOptions, +credopts: options.CredentialsOptions, +} + takes_options = [ Option('--client-version', help='Client Version', default='longhorn', metavar='w2k|dotnet|longhorn', @@ -541,6 +547,12 @@ class cmd_zoneinfo(Command): takes_args = [ 'server', 'zone' ] +takes_optiongroups = { +sambaopts: options.SambaOptions, +versionopts: options.VersionOptions, +credopts: options.CredentialsOptions, +} + takes_options = [ Option('--client-version', help='Client Version', default='longhorn', metavar='w2k|dotnet|longhorn', @@ -569,6 +581,12 @@ class cmd_zonelist(Command): takes_args = [ 'server' ] +takes_optiongroups = { +sambaopts: options.SambaOptions, +versionopts: options.VersionOptions, +credopts: options.CredentialsOptions, +} + takes_options = [ Option('--client-version', help='Client Version', default='longhorn', metavar='w2k|dotnet|longhorn', @@ -644,6 +662,12 @@ class cmd_zonecreate(Command): takes_args = [ 'server', 'zone' ] +takes_optiongroups = { +sambaopts: options.SambaOptions, +versionopts: options.VersionOptions, +credopts: options.CredentialsOptions, +} + takes_options = [ Option('--client-version', help='Client Version', default='longhorn', metavar='w2k|dotnet|longhorn', @@ -702,6 +726,12 @@ class cmd_zonedelete(Command): takes_args = [ 'server', 'zone' ] +takes_optiongroups = { +sambaopts: options.SambaOptions, +versionopts: options.VersionOptions, +credopts: options.CredentialsOptions, +} + def run(self, server, zone, sambaopts=None, credopts=None, versionopts=None): self.lp = sambaopts.get_loadparm() @@ -727,6 +757,12 @@ class cmd_query(Command): takes_args = [ 'server', 'zone', 'name', 'rtype' ] +takes_optiongroups = { +sambaopts: options.SambaOptions, +versionopts: options.VersionOptions, +credopts: options.CredentialsOptions, +} + takes_options = [ Option('--authority', help='Search authoritative records (default)', action='store_true', dest='authority'), @@ -797,6 +833,12 @@ class cmd_roothints(Command): takes_args = [ 'server', 'name?' ] +takes_optiongroups = { +sambaopts: options.SambaOptions, +versionopts: options.VersionOptions, +credopts: options.CredentialsOptions, +} + def run(self, server, name='.', sambaopts=None, credopts=None, versionopts=None): record_type = dnsp.DNS_TYPE_NS select_flags = (dnsserver.DNS_RPC_VIEW_ROOT_HINT_DATA | @@ -826,6 +868,12 @@ class cmd_add_record(Command): takes_args = [ 'server', 'zone', 'name', 'rtype', 'data' ] +takes_optiongroups = { +sambaopts: options.SambaOptions, +versionopts: options.VersionOptions, +credopts: options.CredentialsOptions, +} + def run(self, server, zone, name, rtype, data, sambaopts=None, credopts=None, versionopts=None): record_type = dns_type_flag(rtype) @@ -871,6 +919,12 @@ class cmd_update_record(Command): takes_args = [ 'server', 'zone', 'name', 'rtype', 'olddata', 'newdata' ] +takes_optiongroups = { +sambaopts:
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 75628e6 pidl: add more mapped types via a9e2b62 idl: wmi and dcom don't need python bindings from f8ef240 samba-tool sites: Re-add support for option groups http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 75628e693aa6fad6d247d6ac774de03c52c33d90 Author: Andrew Tridgell tri...@samba.org Date: Wed Feb 8 13:01:32 2012 +1100 pidl: add more mapped types when we #define one type to another, we need special handling in the python generator Autobuild-User: Andrew Tridgell tri...@samba.org Autobuild-Date: Wed Feb 8 04:50:06 CET 2012 on sn-devel-104 commit a9e2b620ca5f00c1cb1d4274ed57a5f6c93b7102 Author: Andrew Tridgell tri...@samba.org Date: Wed Feb 8 13:00:29 2012 +1100 idl: wmi and dcom don't need python bindings the python generation for these IDL files is currently broken --- Summary of changes: librpc/idl/wscript_build |2 +- pidl/lib/Parse/Pidl/Samba4/Python.pm |8 +++- 2 files changed, 8 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/librpc/idl/wscript_build b/librpc/idl/wscript_build index d2112b4..c90edf1 100644 --- a/librpc/idl/wscript_build +++ b/librpc/idl/wscript_build @@ -18,7 +18,7 @@ bld.SAMBA_PIDL_LIST('PIDL', bld.SAMBA_PIDL_LIST('PIDL', 'wmi.idl dcom.idl', -options='--header --ndr-parser --server --client --python --dcom-proxy --com-header', +options='--header --ndr-parser --server --client --dcom-proxy --com-header', output_dir='../gen_ndr') bld.SAMBA_PIDL_LIST('PIDL', diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 63f41a1..39884ab 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -826,9 +826,15 @@ sub use_type_variable($$) my ($self, $orig_ctype) = @_; # FIXME: Have a global lookup table for types that look different on the # wire than they are named in C? - if ($orig_ctype-{NAME} eq dom_sid2 or $orig_ctype-{NAME} eq dom_sid28) { + if ($orig_ctype-{NAME} eq dom_sid2 or + $orig_ctype-{NAME} eq dom_sid28 or + $orig_ctype-{NAME} eq dom_sid0) { $orig_ctype-{NAME} = dom_sid; } + if ($orig_ctype-{NAME} eq spoolss_security_descriptor) { + $orig_ctype-{NAME} = security_descriptor; + } + my $ctype = resolveType($orig_ctype); unless (defined($ctype-{BASEFILE})) { return undef; -- Samba Shared Repository
[SCM] CTDB repository - branch master updated - ctdb-1.12-192-g751ed46
The branch, master has been updated via 751ed46197661eb841042ab6a02855a51dd0b17c (commit) via b098bcf8007be63889aaed640a951b0eeaa9d191 (commit) from 3e5d2b61fcb4d0062d2573d99724f630a4fc4622 (commit) http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=master - Log - commit 751ed46197661eb841042ab6a02855a51dd0b17c Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Wed Feb 8 15:29:27 2012 +1100 ReadOnly: add per-database statistics to view how much delegations/revokes we have commit b098bcf8007be63889aaed640a951b0eeaa9d191 Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Wed Feb 8 13:42:30 2012 +1100 STATISTICS: add total counts for number of delegations and number of revokes Everytime we give a delegation to another node we count this as one delegation. If the same record is delegated to several nodes we count one for each node. Everytime a record has all its delegations revoked we count this as one revoke. --- Summary of changes: include/ctdb.h| 57 + include/ctdb_private.h| 11 include/ctdb_protocol.h | 11 libctdb/control.c | 51 libctdb/sync.c| 18 ++ server/ctdb_call.c|4 +++ server/ctdb_control.c |4 +++ server/ctdb_daemon.c |2 + server/ctdb_ltdb_server.c | 17 + tests/src/libctdb_test.c | 17 + tools/ctdb.c | 52 + 11 files changed, 244 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/include/ctdb.h b/include/ctdb.h index 8dbdd47..93224cb 100644 --- a/include/ctdb.h +++ b/include/ctdb.h @@ -510,6 +510,39 @@ bool ctdb_getpnn_recv(struct ctdb_connection *ctdb, /** + * ctdb_getdbstat_send - read statistics for a db + * @ctdb: the ctdb_connection from ctdb_connect. + * @destnode: the destination node (see below) + * @db_id:the database to collect the statistics from + * @callback: the callback when ctdb replies to our message (typesafe) + * @cbdata: the argument to callback() + * + * There are several special values for destnode, detailed in + * ctdb_protocol.h, particularly CTDB_CURRENT_NODE which means the + * local ctdbd. + */ +struct ctdb_request * +ctdb_getdbstat_send(struct ctdb_connection *ctdb, +uint32_t destnode, +uint32_t db_id, +ctdb_callback_t callback, +void *cbdata); +/** + * ctdb_getdbstat_recv - read an ctdb_getdbstat reply from ctdbd + * @ctdb: the ctdb_connection from ctdb_connect. + * @req: the completed request. + * @stat: a pointer to the *stat to fill in + * + * This returns false if something went wrong, or otherwise fills in **stats + * stats must be freed later by calling ctdb_free_dbstat(); + */ +bool ctdb_getdbstat_recv(struct ctdb_connection *ctdb, +struct ctdb_request *req, +struct ctdb_db_statistics **stat); + +void ctdb_free_dbstat(struct ctdb_db_statistics *stat); + +/** * ctdb_check_message_handlers_send - check a list of message_handlers * if they are registered * message_handlers are registered on the daemon using the @@ -876,6 +909,26 @@ bool ctdb_getpnn(struct ctdb_connection *ctdb, uint32_t *pnn); /** + * ctdb_getdbstat - read the db stat of a node (synchronous) + * @ctdb: the ctdb_connection from ctdb_connect. + * @destnode: the destination node (see below) + * @db_id:the database to collect the statistics from + * @stat: a pointer to the *stat to fill in + * + * There are several special values for destnode, detailed in + * ctdb_protocol.h, particularly CTDB_CURRENT_NODE which means the + * local ctdbd. + * + * This returns false if something went wrong, or otherwise fills in **stat + * stat must be freed later by calling ctdb_free_dbstat(); + */ +bool ctdb_getdbstat(struct ctdb_connection *ctdb, + uint32_t destnode, + uint32_t db_id, + struct ctdb_db_statistics **stat); + + +/** * ctdb_check_message_handlers - check a list of message_handlers (synchronous) * @ctdb: the ctdb_connection from ctdb_connect. * @destnode: the destination node (see below) @@ -1092,6 +1145,10 @@ void ctdb_free_vnnmap(struct ctdb_vnn_map *vnnmap); ctdb_getpnn_send((ctdb), (destnode),\ ctdb_sendcb((cb), (cbdata)), (cbdata)) +#define ctdb_getdbstat_send(ctdb, destnode, db_id, cb, cbdata) \ + ctdb_getdbstat_send((ctdb), (destnode), (db_id),\ + ctdb_sendcb((cb), (cbdata)), (cbdata)) + #define ctdb_check_message_handlers_send(ctdb, destnode, num,