1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

620 Commits

Author SHA1 Message Date
Martin Schwenke
c5bcff6724 tools/ctdb: Remove duplicate command definition for "sync"
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 9e7b7cd04adc5e66e2ffa4edf463a682aaea379b)
2013-05-24 14:08:06 +10:00
Amitay Isaacs
a0cfc381d3 tools/ctdb: Fix racy ipreallocate code
This code tried to find the recovery master and send an ipreallocate
request to that node.  When a node is stopped, this code asked the
stopped node for recovery master.  Stopped node does not have up-to-date
information on the current recovery master.  So ipreallocate requests
were sent to the wrong node and ignored by that node which is not the
recovery master.

Send ipreallocate request to all active nodes.  That way we guarantee
that the current recovery master will see it and respond to it.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 0577ce3c68e4febf49a1ef5093e918db9d5ec636)
2013-05-23 16:19:20 +10:00
Amitay Isaacs
6d0c388e5c build: Rename version.h to ctdb_version.h
This avoids clash with version.h from Samba tree.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit d18fcfff674e876abde8d51afec92d9c4a090d2f)
2013-05-23 16:18:23 +10:00
Amitay Isaacs
e062555da0 tools/ltdbtool: Fix handling of -e option
Also, include description of -e option in usage.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 35264e42ade4676468cf7713fa339c784e932953)
2013-04-08 14:25:34 +10:00
Volker Lendecke
3ffd57f0c9 fix a typo
Reviewed-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 98abd344342a011a8599411deae79f94abc09541)
2013-03-12 14:02:08 +01:00
Martin Schwenke
8cd6a67b8b tools/ctdb: delip no longer fails if IP can not be moved
Moving the IP is an optimisation so should not cause failure.

Refactor and simplify the retry-move-IP into new function
try_moveip().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 5402f85dde045576cbaf64e01c68e28ed52204e8)
2013-02-27 16:01:55 +11:00
Martin Schwenke
fe130ca85b tools/ctdb: Fix a compiler warning
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit d1ec06d30148e6fd344625a2fbf1c22391bd908a)
2013-02-04 11:22:43 +11:00
Amitay Isaacs
d85e40fbdb tools/ctdb: Add setdbseqnum command to set __db_sequence_number__
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit efaac27a9ed52ed0f436c7e194013fd06e8b02b3)
2013-01-09 13:18:34 +11:00
Amitay Isaacs
4ca50c7243 tools/ctdb: Re-factor code to check if db exists given name or id
Most of the commands related to database operations can now use the
common code (db_exists()) to refer to database with either name or id.

In addition to return db_id for db_name, the function returns all the
flags set for the database.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ca6e7eccc90f2869c220231666bf284798342bce)
2013-01-09 13:18:33 +11:00
Amitay Isaacs
d8a3ec42c1 tools/ctdb: Add pdelete command to delete a record from persistent database
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit d23adec89b69e7c6f96c8e1417ef4ca4c9edc57e)
2013-01-09 13:18:33 +11:00
Amitay Isaacs
56ee668a51 tools/ctdb: Do not use function return value as pnn
This fixes the wrong code where same variable 'ret' is used to track the pnn
and the return value of a function call.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 718233c445cd6627ab3962b6565c2655f1f8efd0)
2012-11-14 11:00:21 +11:00
Amitay Isaacs
b0f90052cb tool/ctdb: Always support ctdb version command, don't make it optional
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit f8af7d8de76e68e5c4bde15f832a31ce9107e8c7)
2012-10-30 11:56:00 +11:00
Martin Schwenke
d78ac9c364 tools/ctdb: Merge recoverd log handling into getlog/clearlog
We don't need extra commands for these.

Also, allow a default value of NOTICE for the getlog level.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 7197e600f46f2d1638f6c45c0149f109ea25a47c)
2012-10-22 12:21:24 +11:00
Martin Schwenke
798b632e03 tools/ctdb: Add log ringbuffer handling for recoverd
This adds commands rdgetlog and rdclearlog

These are analogous to getlog and clearlog but operate on the logs for
the recovery daemon.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ef55e06192819d840c09b65741bab737223ac34c)
2012-10-22 11:15:36 +11:00
Amitay Isaacs
a00e50e503 ctdbd: Replace lockwait with locking API and remove ctdb_lockwait.c
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 2126795153dacb255e441abcb36ee05107b6282a)
2012-10-20 02:48:44 +11:00
Amitay Isaacs
8d7d9ac8ce tools/ctdb: Display the locking statistics
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit e24b5bf283736624b387b0364d7200212bb3054b)
2012-10-20 02:48:44 +11:00
Martin Schwenke
7bf693fc1b tools/ctdb_diagnostics: Add "ctdb listvars" output
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 2d75a04ba9a2e87a0dcb9bf778c58e335af1871c)
2012-10-18 20:05:43 +11:00
Martin Schwenke
c5e24b23cf tools/ctdb: Remove extra header from natgwlist -Y output
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 59520c9785d113ad5063eb5fbe42a9efc7e30076)
2012-10-18 20:05:42 +11:00
Martin Schwenke
1aaaf7e20e tools/ctdb: Free the event context
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit dc2a8c638bd74b9f1dd75339cd2ae2f32ffa18a8)
2012-10-02 17:37:53 +10:00
Martin Schwenke
82922ec305 tools/ctdb: Clean up control_natgw()
* Factor out repeated code into new function find_natgw()
* Support both machine and human readable output
* Use libctdb

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a56ec75edd1705b0539513d396d311f0e80a3bf5)
2012-09-28 17:05:34 +10:00
Martin Schwenke
a7ff393d42 tools/ctdb: Convert some commands over to libctdb
control_getcapabilities(), control_lvs(), control_lvsmaster() updated
to use ctdb_getcapabilities(), ctdb_getnodemap() as appropriate.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c30ec02615183ecf9b412ad415bf1abd859aec45)
2012-09-28 17:05:34 +10:00
Martin Schwenke
110cb67e2a tools/ctdb: Remove redundant filtering loop in control_natgwlist()
This used to catch trailing blank lines.  However, these are caught
just as effectively by the whitespace filtering in the loop below.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 7b75a3bb722dc86139b1a07a0100d08c34620b91)
2012-09-28 17:05:34 +10:00
Martin Schwenke
860d757475 tools/ctdb: natgwlist output is either human readable or machine readable
The first line is currently human readable and the rest is machine
readable.  This doesn't make sense.  Do one or the other...

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit b29d5bbaa7048291c4b3a39bf12e04f0436f67da)
2012-09-28 17:05:34 +10:00
Martin Schwenke
bd0e34a9fd tools/ctdb: Factor out printing of the machine readable status header
It is already in 2 places and we might use it in another.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 12a0a7a208d1c8fa8991894200d1dc133f3a2d1a)
2012-09-28 17:05:34 +10:00
Martin Schwenke
1fbeb106e0 tools/ctdb: NAT gateway code should use CTDB_NATGW_NODES
... not NATGW_NODES.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 2da7730dc06153173778ab14e228960e72ff8a86)
2012-09-28 17:05:34 +10:00
Martin Schwenke
e7c8e0d32d ctdb tool: recmaster command might as well be auto-all
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 076282622fcb2663d378e0c90ed0d9c19f73c005)
2012-07-30 15:43:32 +10:00
Martin Schwenke
f53b4f82f5 tools/onnode: Add -P option to push files to given nodes
A list of files is given rather than a command.  These files are
pushed to the specified nodes.

Quoting is fragile/broken so filenames with spaces won't work - you
win some, you lose some.  :-)

All of the other onnode options should work together with this option.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit aed9b98ddbbf3e81de4f7257a10676565f7d7507)
2012-07-30 15:34:41 +10:00
Amitay Isaacs
23a460602f Remove tevent_loop_allow_nesting()
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 538c68d0e83e14f0000981ee06408b8f0035be37)
2012-07-16 12:12:05 +10:00
Michael Adam
237d4c5c39 ctdb: use correct "persistent" state for ctdb_attach in "ctdb cattdb"
Originally, "ctdb cattdb" attached explicitly as non-persistent, which
is now forbidden for persistent databases by the server.

Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

(This used to be ctdb commit 85a367005bd669309bb7e532b60d27621110180d)
2012-07-03 14:30:24 +02:00
Ronnie Sahlberg
d21337a0fb Add new command to find which interface is located on
(This used to be ctdb commit f07376309e70f5ccdb7de8453caacc71b451ab48)
2012-06-20 15:11:49 +10:00
Ronnie Sahlberg
59565c05cf STATISTICS: Add tracking of the 10 hottest keys per database measured in hopcount
and add mechanisms to dump it using the ctdb dbstatistics command

(This used to be ctdb commit 8307c70ed98996b430c470e9641a09fdeeb81bd8)
2012-06-13 16:19:18 +10:00
Ronnie Sahlberg
7a1aa560e7 Add new control to reload the public ip address file on a node
Also add a method to use the recovery master/daemon to reload the public ips on all nodes in the cluster.
Reloading the public ips on all node sin the cluster is only suported if all nodes in the cluster are available and healthy.

(This used to be ctdb commit 05603e914f8c12618d7e06943c0f7df207f645b0)
2012-05-01 10:48:08 +10:00
Amitay Isaacs
4392591555 Remove explicit include of lib/tevent/tevent.h.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 0681014ca5ed2a9b56f63fdace7f894beccf8a9a)
2012-04-13 17:28:14 +10:00
Ronnie Sahlberg
0cc3127beb CTDB: add back the "rebalanceip" command
(This used to be ctdb commit 83aea6488002aa75dd25752fa0d164afb8b4f300)
2012-04-03 13:43:21 +10:00
Ronnie Sahlberg
fa3a06246a STICKY: add prototype code to make records stick to a node to "calm" down if they are found to be very hot and accessed by a lot of clients.
This can improve performance and stop clients from having to chase a rapidly migrating/bouncing record

(This used to be ctdb commit d0d98f7e45e5084b81335b004d50bddc80cdc219)
2012-03-20 17:12:19 +11:00
Ronnie Sahlberg
6a493a0b08 STATISTICS: add per-db hop count statistics
(This used to be ctdb commit 1c976d83b1d7dac6f0ef81306774998e4c8b56a1)
2012-03-20 12:11:55 +11:00
Ronnie Sahlberg
c9f7c981e2 CTDB: change how the hop count buckets are displayed in ctdb statistics
(This used to be ctdb commit 05923a14bc8ae8e3c5cda28ff4e0fb0d473d5f7d)
2012-03-20 11:43:09 +11:00
Ronnie Sahlberg
038c946e80 add max hop count buckets to see how bad hopcounts are
(This used to be ctdb commit 7d3931298e6477d92f43652c3006b0c426cb1307)
2012-03-20 11:20:53 +11:00
Ronnie Sahlberg
b3ddf6901d Merge remote branch 'martins/master'
(This used to be ctdb commit af72f8bc05f78983f9624d81788f9d89af474b11)
2012-03-15 16:09:41 +11:00
Ronnie Sahlberg
ef2bd0b016 When adding ips to nodes, set up a deferred rebalance for the whole node to trigger after 60 seconds in case the normal ipreallocated is not sufficient to trigger rebalance.
(This used to be ctdb commit 4340263b219d75c39f8de22abe3f6f1c1ee63ea2)
2012-02-28 06:56:04 +11:00
Volker Lendecke
5e3b13a32a FreeBSD does not define s6_addr32, only s6_addr
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit d657af4fb68ce3f7c462856f2934f6bf169e120b)
2012-02-13 16:20:12 +01:00
Martin Schwenke
629553667e ctdb tool: fix thinko in nodestatus command output
If used with -n <nodes> the "current" node needs to change.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a0340a50c2acd9ccc281faef032a364254f7f95a)
2012-02-13 13:31:18 +11:00
Ronnie Sahlberg
68245eee4e READONLY: allow specifying the db name for setdbreadonly instead of just the hash
(This used to be ctdb commit 3c2117e8e4156e0048fbd2c94546112f0c588522)
2012-02-13 10:27:59 +11:00
Ronnie Sahlberg
73f8be16c6 ReadOnly: add per-database statistics to view how much delegations/revokes we have
(This used to be ctdb commit 751ed46197661eb841042ab6a02855a51dd0b17c)
2012-02-08 15:29:27 +11:00
Ronnie Sahlberg
1eafa68f0f 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.

(This used to be ctdb commit b098bcf8007be63889aaed640a951b0eeaa9d191)
2012-02-08 13:42:30 +11:00
Ronnie Sahlberg
b6de9d3d19 Ad test tool to store data and ctdb header into a local tdb file
(This used to be ctdb commit c6433e43ad2481d84e8d9a1ee1c6e29b90423a86)
2012-02-07 12:14:57 +11:00
Ronnie Sahlberg
c3bab541c9 TFETCH add verbose flag to print also the record ltdb heaer
(This used to be ctdb commit 25d797f61c3b5b7090fb662adde6ed9e434e8a61)
2012-02-07 10:53:49 +11:00
Ronnie Sahlberg
daf28e095e CTDB: update tfetch so we can specify a hexadecimal string as key
(This used to be ctdb commit 70d22efdf104db1fc951263cedfbdb95b0b44342)
2012-02-07 10:21:12 +11:00
Martin Schwenke
e2ceae48e3 ctdb tool - free some memory used by popt
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 7339e87019c0ab44522bf160234307472c05dc14)
2012-02-06 16:00:24 +11:00
Martin Schwenke
7a04587e88 ctdb tool - convert control_status() over to use just libctdb()
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit abe9985e503d998cf597933a594b445de8d3cec6)
2012-02-06 16:00:23 +11:00
Martin Schwenke
bfab62dd41 ctdb tool - Fix parse_nodestring() related issues
An old, buggy version of this code was merged.  This fixes it.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit bc4d5d5f0048487776f9f5d9f04a0af2e5d45aac)
2012-02-06 16:00:23 +11:00
Ronnie Sahlberg
e648045499 Merge branch 'master' of ssh://git.samba.org/data/git/ctdb
(This used to be ctdb commit 15d8ae8b0f80f95d7839528b8ac60aa0e2485c77)
2012-01-03 12:40:15 +11:00
Michael Adam
5fdd7fefb8 ctdb-tool: adapt formatting of "listvars" output to lenght of longest name
(This used to be ctdb commit 295168d99183d2d21f27a8ac6825d421fa866b28)
2011-12-23 17:39:10 +01:00
Michael Adam
491c63c2a8 tools/ctdb: allow the "ctdb vacuum" stub to be run without the daemon running.
(This used to be ctdb commit e71afbf731f06a3b89b64220c7fd1b1ea5492d4a)
2011-12-23 17:39:05 +01:00
Michael Adam
d7611212c3 tools/ctdb: remove functionality of "ctdb vacuum", just keeping a stub.
(This used to be ctdb commit 8fc4d5018ee6eee8856634095694d3ad0de5b4ae)
2011-12-23 17:39:05 +01:00
Martin Schwenke
89b01c8e7b Rename struct traverse_state to allow tools C files to be #included.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 54377ef8b992f92d3a4ece42ee72e37d22cd2de6)
2011-12-08 17:21:24 +11:00
Martin Schwenke
a2095caf91 ctdb tool - remove verify_node() function
parse_nodestring() checks what this used to check.  parse_nodestring()
already has the nodemap.

It was a 50-50 decision to decide whether to update verify_node() to
check against a nodemap that is passed in or to delete it.

Signed-off-by: Martin Schwenke <martin@meltin.net>

Conflicts:

	tools/ctdb.c

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 2c1baf5ddd3c2cdd2a3f98b8e208d3a48530d1d1)
2011-12-08 17:21:24 +11:00
Martin Schwenke
d5b1a6a9c6 ctdb tool - new command "ctdb nodestatus [nodestring]"
This is very much like "ctdb status" but actually returns the status
for use in scripts.

This can be used in 2 modes:

* An optional nodestring is passed directly to the command without
  using -n.  In this mode the current node is asked for the status of
  all listed nodes.

* The nodestring is passed via -n.  In this mode the designated nodes
  will be asked for their status.  This is like "ctdb status".

These modes can be mixed.  For example:

  ctdb nodestatus 1,2,3 -n 0

asks node 0 for the status of nodes 1, 2 and 3, returning the bitwise
OR of their statuses.

This version uses the auto_all functionality, so the output isn't
necessarily pretty.  An improved version that does its own -n
processing may appear soon.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 355685a14be17bf4648788f8a72c54790fe03502)
2011-12-08 17:21:17 +11:00
Martin Schwenke
b646815567 ctdb tool - factor out status printing functions
Create 2 new functions: control_status_1_machine() and
control_status_1_human() that contain chunks of code from
control_status().  We're about to find another purpose for these
functions.

This should be a no-op.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit fade71539482e8276f57ba3c003fe004d8666ce7)
2011-12-08 17:18:19 +11:00
Martin Schwenke
8b74037633 ctdb tool - generalise nodestring parsing for -n
Centralise -n nodestring parsing and add the ability to pass a
comma-separated list of node numbers.  Listing a node that is
disconnected or deleted results in failure, similar to the way passing
a single node currently works.  All of the auto_all commands inherit
this functionality.  For now, the non-auto_all commands do not inherit
this - they need to be individually tweaked.  Therefore, we haven't
updated the documentation to advertise this feature.

Implemented via a new function parse_nodestring() that parses an
optional (pass NULL when not available to indicate "current node")
comma-separated list of node numbers or "all".  parse_nodestring() can
be told to be non-fatal for disconnected/deleted nodes so it can also
be used in other contexts (yes, coming soon).  main() is changed to
call this function.

A new magic PNN value CTDB_MULTICAST is added and along with a
corresponding option.nodes structure member (a talloc-ed array of
PNNs).  This is also populated for "all" as well.

control_status() has new function pretty_print_flags() factored out so
pretty-printed flags can be used in error/debug messages.  New
function is_partially_online() is also factored out - this simplifies
some of the logic.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 920e3a732eb9e09004edde6cfb3c7db8a004016f)
2011-12-08 17:00:17 +11:00
Martin Schwenke
7f25864db0 ctdb tool - move parsing of nodestring to where it is needed
This puts the parsing and checking logic close together.  This makes
it easy to change the parsing code.  Changed parsing code can now
easily use both old client code and libctdb since both are guaranteed
to be setup.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 57fb074a65dc56168fc3813b79a5bab4b3727cf3)
2011-12-06 13:59:32 +11:00
Martin Schwenke
dbd452c801 ctdb tool - replace fprintf with DEBUG
It's the only one in the file.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit bf1174ef699b06485b36ee8ae70412be0759e142)
2011-12-06 13:59:32 +11:00
Martin Schwenke
ba6e6f689c ctdb tool - short circuit most of the logic in main for non-daemon commands
This allows all that logic to be hacked a little more easily.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f93ffeee7b9e9ca5dd116655bdc7f89fc987ed8a)
2011-12-06 13:59:32 +11:00
Martin Schwenke
7e9f998745 ctdb tool - commands that don't use the daemon can't take -n/--node
It just doesn't make sense!

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c4b72683eb046007fbc2e60b4a54bc91faf4cf7e)
2011-12-06 13:59:32 +11:00
Martin Schwenke
5f69ad3c0a ctdb tool - simplify main() by taking most code out of a loop
Most of the action in main() happens inside a for loop and an if
statement.  This causes 2 levels of extra indent for the code and
makes it harder to read.

Instead, the current body of the loop is put below the loop and its
corresponding failure check.

To see how small this change really is, view with "diff -w".  ;-)

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 8527396b7290cfc8378779631e91d2ae09e2a106)
2011-12-06 13:59:32 +11:00
Ronnie Sahlberg
609149bdc8 LibCTDB: Add support for the 'get interfaces' control and update the ctdb tool to use this interface
(This used to be ctdb commit 77dc0c7351071243d9096d3607d7499c82f46ec0)
2011-12-06 13:12:18 +11:00
Ronnie Sahlberg
7d31c64c1c ctdb: use libctdb version of check-srvids call
(This used to be ctdb commit 36105b7283df729946e0a2ed61a696a14221efa6)
2011-11-30 10:00:27 +11:00
Ronnie Sahlberg
5a1e8df451 check_srvids: remove the <pnn> from the commandline so that we only specify the list of <srvids>
Specifying the pnn can be done via '-n <pnn>'

(This used to be ctdb commit e9250775f5a1234f27a1a62caa902d7b86194285)
2011-11-30 09:50:12 +11:00
Volker Lendecke
6f657dadd3 Add "ctdb check_srvid"
(This used to be ctdb commit 92a391a81d0697956b96e96e39bb1b9d13e18097)
2011-11-30 09:02:26 +11:00
Ronnie Sahlberg
3cbff2edd8 LibCTDB: add get persistent db seqnum control
(This used to be ctdb commit 6e96a62494bbb2c7b0682ebf0c2115dd2f44f7af)
2011-11-30 08:48:14 +11:00
Michael Adam
31d62794fe ctdb: add an option --print-recordflags to trigger printing record flags in catdb and dumpdbbackup
This changes the default behaviour to not print record flags.

(This used to be ctdb commit 2d2ce07c51055d9400b22cd3c1fd682597cb921c)
2011-11-29 13:43:35 +01:00
Michael Adam
e6923904e8 ctdb: add an option --print-hash to enable printing of record hashes when dumping dbs
(This used to be ctdb commit efc033c28ade97f9884794256d59a4553e052d5f)
2011-11-29 13:43:34 +01:00
Michael Adam
86cd78efee ctdb: add an option --print-lmaster to enable printing of lmaster in "ctdb catdb"
(This used to be ctdb commit 326f88ef622620cb9e0569c4497bc0e86124beaa)
2011-11-29 13:43:33 +01:00
Michael Adam
dc98c12ac9 ctdb: add an option --print-datasize to only print datasize instead of dumping data in db dumps
Used in catdb, cattdb and dumpdbbackup.

(This used to be ctdb commit dd866116041e71cbf91e7fd91edcc9501634051d)
2011-11-29 13:43:32 +01:00
Michael Adam
1fcc7651f4 ctdb: add an option --print-emptyrecords to enable printing of empty records in dumping databases
this option is used with the commands catdb, cattdb and dumpdbbackup.

(This used to be ctdb commit 6ec68a2e667f66d2b194fe48cb75229a2777842e)
2011-11-29 10:30:24 +01:00
Martin Schwenke
08ebcf6e6a Fix ctdb scriptstatus -n all
This didn't have auto_all set as true.  However, there's no special
code to handle "-n all" and it just fails.  If auto_all works for
status then it might as well work for scriptstatus.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3084220e2aac3664511969f10cad206e505150a0)
2011-11-10 15:41:03 +11:00
Mathieu Parent
fa197073cd config can be in /etc/default/ instead of /etc/sysconfig/ (ctdb_gnostics part)
(This used to be ctdb commit b6a9dacefd8f031677702f0fbf6b321beb4c4d54)
2011-11-08 16:32:03 +11:00
Ronnie Sahlberg
afd0b63273 Merge branch 'master' of 10.1.1.27:/shared/ctdb/ctdb-master
(This used to be ctdb commit d772743e9a4d4d40eb95cd8d5178708e77057b79)
2011-11-08 14:01:22 +11:00
Ronnie Sahlberg
0f92fa224c RB_TREE: Add mechanism to abort a traverse
This patch changes the callback signature for traversal
functions to allow a client to abort a traverse before it finishes.
Updates to all callers and examples as well as rb-test tool.

(This used to be ctdb commit 8ab0c63ad36cfbbb1e5fed46a1f4c47b1fdb581f)
2011-11-08 13:40:28 +11:00
Martin Schwenke
2e3febe283 onnode: unset EXTRA_SSH_OPTS when using fakessh
This case was never tested and fakessh obviously won't handle the
extra arguments.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 02184bd5b9ab94cdf2b9ff92e56a509f92f9e4aa)
2011-10-18 11:51:06 +11:00
Ronnie Sahlberg
24b56c62b1 Merge branch 'master' of ssh://git.samba.org/data/git/ctdb
(This used to be ctdb commit dd9f82dbe2346c7143b0229e3611c402ee8c4025)
2011-10-17 15:08:39 +11:00
Martin Schwenke
71b8015ccf Make ctdb_diagnostics more resilient to uncontactable nodes.
Current behaviour is for onnode to timeout (for about 20s) for each
attempted ssh to a down node.  With 40 or 50 invocations of onnode
this takes a long time.

2 changes to work around this:

* If EXTRA_SSH_OPTS (which is passed to ssh by onnode) does not
  contains a ConnectTimeout= setting then add a setting for a 5 second
  timeout.

* Filter the nodes before starting any diagnosis, taking out any "bad
  nodes" that are uncontactable via onnode.

  In the nodes summary at the beginning of the output, print
  information about any "bad nodes".

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 8c3b6427dbaade87e1a0f5590f0894c2e69b31a3)
2011-10-13 14:27:34 +11:00
Gregor Beck
28a434051c ltdbtool: ignore empty (deleted) records per default.
Add option -e to get the old behaviour and process empty records too.

Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit d9859540c2000864bc6c58be5afe19aa3b1064b2)
2011-10-12 22:38:02 +02:00
Ronnie Sahlberg
8a104331e8 Change the 'This Node' column of the machinereadable output for 'ctdb status -Y' to Y/N instead of 1/0
1/0 is unsuitable since it can be useful to check 'if a column is "1" there is something wrong with that node'

(This used to be ctdb commit b963f5e40b1e73a60363568da88557cad9e58a28)
2011-09-21 15:41:28 +10:00
Ronnie Sahlberg
a46d94bca2 Document 'cattdb' more clearly that it dumps the content of the local TDB and not the CTDB database
(This used to be ctdb commit 71bf1260b1cac5ce83a92b4b944096b631ca87d8)
2011-09-13 18:44:13 +10:00
Michael Adam
f5a3119dc0 Fix a typo in a message in ctdb backupdb.
(This used to be ctdb commit f6a47197dbb64cc7705fc564fa8dc78e958226c4)
2011-09-12 17:05:19 +02:00
Ronnie Sahlberg
0dc5584101 Merge branch 'master-readonly-records' into foo
Conflicts:

	Makefile.in
	tools/ctdb.c

(This used to be ctdb commit 0fedef0ffba4178126eee9544c5e2db52f5db893)
2011-09-12 09:34:34 +10:00
David Disseldorp
941ba90126 client: flag local node in ctdb -Y status output
Regular "ctdb status" output flags which node is the local node, do the
same for machine readable output.

(This used to be ctdb commit 3885141f37724b3dea61b45fbac38489ec356588)
2011-09-06 13:57:04 +02:00
David Disseldorp
5296da5609 client: add timeout argument to ctdb_attach
Rather than using a fixed 2 second CTDB_CONTROL_GETDBPATH timeout.

(This used to be ctdb commit 9e178671560cb95121e11d718a76b05380ecd6c5)
2011-09-06 13:57:04 +02:00
David Disseldorp
0628d1c0e6 client: add req timeout argument to ctdb_cmdline_client
Following connection to the local ctdbd, ctdb_cmdline_client() currently
issues a CTDB_CONTROL_GET_PNN request with a fixed 3 second timeout.

The ctdb cmd line client accepts a --timelimit argument for specifying
a per request timeout, pass this value through to ctdb_cmdline_client()
for use as a CTDB_CONTROL_GET_PNN request timeout.

(This used to be ctdb commit 0634d0305f42f17048b6830733767e8dc300e11c)
2011-09-06 13:56:54 +02:00
Michael Adam
a74f352271 tools/ctdb: fix a typo in a debug message
(This used to be ctdb commit 9bded1832179fbadc8bc94c5328ffa6c45a6d2ab)
2011-09-02 16:23:48 +02:00
Ronnie Sahlberg
206a3c0c66 ReadOnly: add a new control to activate readonly lock capability for a database.
let all databases default to not support this  until enabled through this control

(This used to be ctdb commit 908a07c42e5135a3ba30a625fc4f4e4916de197a)
2011-09-01 11:08:18 +10:00
Ronnie Sahlberg
a0d4d240c3 ReadOnly: add a readonly flag to the getdbmap control and show the readonly setting in ctdb getdbmap output
(This used to be ctdb commit 4cac9ad7d9c9ca657a247a6c215476399c7d2210)
2011-09-01 10:28:15 +10:00
Ronnie Sahlberg
63dc96cdb2 ReadOnly: Change the ctdb_db structure to keep a uint8_t for flags instead of a boolean for
the persistent flag.
This is the same size as the original boolean but allows ut to add additional flags for the database

(This used to be ctdb commit 7462761638d25880ad46024ad4ef21667eb99a98)
2011-09-01 10:21:55 +10:00
Martin Schwenke
f9eb60ba0b Tools - fix "ctdb scriptstatus -Y" output
Lines in machine readable output always start with a colon (':').

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a779d83a6213e2ba21621f7e090964428f89422d)
2011-08-30 16:37:04 +10:00
Ronnie Sahlberg
6692512299 LibCTDB : update the ctdb tool to use libctdb to read the recovery mode
(This used to be ctdb commit 750a31cf95c356a0ee071967537eb615dce35845)
2011-08-23 16:35:08 +10:00
Ronnie Sahlberg
75afbee956 LibCTDB : uptade the ctdb tool to use libctdb to query for the recmaster
(This used to be ctdb commit 81c14c8625a6d5670b8795a655d7a3f3318009e5)
2011-08-23 16:32:38 +10:00
Ronnie Sahlberg
49923d4fdc Add the missing "persistent" argument to db_exist()
The API for this function has changed since the 1.2 branch where readonly locks are being merged from

(This used to be ctdb commit d01b9716d3e50f4c6d102e8411f0401b0f499699)
2011-08-23 10:23:18 +10:00
Ronnie Sahlberg
b77142ccc0 ReadOnly: Add a new command 'ctdb cattdb'. This fucntion differs from 'ctdb catdb' in that 'cattdb' will always traverse the local tdb file only, while 'catdb' does a cluster traverse.
Since some record flags may differ between nodes in the cluster when read only delegations are in use, cattdb is needed when you need to know the exact flag settings on the current node itself.

(This used to be ctdb commit d2342b680a3a8160d903d12550b86ee21c8b277d)
2011-08-23 10:22:41 +10:00
Ronnie Sahlberg
9d0a5b167c Add a new command 'ctdb checktcpport <port>'
that tries to bind to the specified port on INADDR_ANY.

This can be used for testing if a service is listening to that port or not.

Errors are printed to stdout and the returned status code is either 0 : if we managed to bind to the port (in which case the service is NOT listening on that bort) or the value of errno that stopped us from binding to a port.

errno for EADDRINUSE is 98 so a script using this command should check the status code against the value 98.
If this command returns 98 it means the service is listening to the specified port.

(This used to be ctdb commit 04cbb490c5a075080923fde58af7082572c55c43)
2011-08-17 10:20:19 +10:00