samba.git
12 years agoREADONLY: document the command to activate readonly record support
Ronnie Sahlberg [Sun, 12 Feb 2012 23:34:41 +0000 (10:34 +1100)]
READONLY: document the command to activate readonly record support

(This used to be ctdb commit f0bc1760c36c8589f58354c50b23880946cb57c6)

12 years agoREADONLY: allow specifying the db name for setdbreadonly instead of just the hash
Ronnie Sahlberg [Sun, 12 Feb 2012 23:27:59 +0000 (10:27 +1100)]
READONLY:  allow specifying the db name for setdbreadonly instead of just the hash

(This used to be ctdb commit 3c2117e8e4156e0048fbd2c94546112f0c588522)

12 years agoLoad platform dependent objs instead of Linux one
Mathieu Parent [Sat, 4 Feb 2012 13:32:06 +0000 (14:32 +0100)]
Load platform dependent objs instead of Linux one

This fix compilation on Gnu/Hurd and kFreeBSD

See also:
https://buildd.debian.org/status/fetch.php?pkg=ctdb&arch=hurd-i386&ver=1.12%2Bgit20120201-1&stamp=1328211119
https://buildd.debian.org/status/fetch.php?pkg=ctdb&arch=kfreebsd-amd64&ver=1.12%2Bgit20120201-1&stamp=1328214761
https://buildd.debian.org/status/fetch.php?pkg=ctdb&arch=kfreebsd-i386&ver=1.12%2Bgit20120201-1&stamp=1328215875

(This used to be ctdb commit 496e8f8540f78606ef23ee8fa100eb2b2cf3f106)

12 years agoReadOnly: add per-database statistics to view how much delegations/revokes we have
Ronnie Sahlberg [Wed, 8 Feb 2012 04:29:27 +0000 (15:29 +1100)]
ReadOnly: add per-database statistics to view how much delegations/revokes we have

(This used to be ctdb commit 751ed46197661eb841042ab6a02855a51dd0b17c)

12 years agoSTATISTICS: add total counts for number of delegations and number of revokes
Ronnie Sahlberg [Wed, 8 Feb 2012 02:42:30 +0000 (13:42 +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.

(This used to be ctdb commit b098bcf8007be63889aaed640a951b0eeaa9d191)

12 years agoTESTS: Add a test that verifies that RecoverPDBBySeqNum works as expected.
Ronnie Sahlberg [Tue, 7 Feb 2012 21:59:53 +0000 (08:59 +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

(This used to be ctdb commit 3e5d2b61fcb4d0062d2573d99724f630a4fc4622)

12 years agoAd test tool to store data and ctdb header into a local tdb file
Ronnie Sahlberg [Tue, 7 Feb 2012 01:14:57 +0000 (12:14 +1100)]
Ad test tool to store data and ctdb header into a local tdb file

(This used to be ctdb commit c6433e43ad2481d84e8d9a1ee1c6e29b90423a86)

12 years agoTFETCH add verbose flag to print also the record ltdb heaer
Ronnie Sahlberg [Mon, 6 Feb 2012 23:53:49 +0000 (10:53 +1100)]
TFETCH add verbose flag to print also the record ltdb heaer

(This used to be ctdb commit 25d797f61c3b5b7090fb662adde6ed9e434e8a61)

12 years agoCTDB: update tfetch so we can specify a hexadecimal string as key
Ronnie Sahlberg [Mon, 6 Feb 2012 23:21:12 +0000 (10:21 +1100)]
CTDB: update tfetch so we can specify a hexadecimal string as key

(This used to be ctdb commit 70d22efdf104db1fc951263cedfbdb95b0b44342)

12 years agoTESTS: ctdb_fetch needs to allow tevent nesting
Ronnie Sahlberg [Mon, 6 Feb 2012 06:32:34 +0000 (17:32 +1100)]
TESTS: ctdb_fetch needs to allow tevent nesting

(This used to be ctdb commit 4fa3f109b7ddc40e79c5fbb9688e0e830c0a655e)

12 years agoMerge remote branch 'martins/tests'
Ronnie Sahlberg [Mon, 6 Feb 2012 05:34:02 +0000 (16:34 +1100)]
Merge remote branch 'martins/tests'

(This used to be ctdb commit 5f660e5bf321ae5332bf1d32c8af36d6cc2569f4)

12 years agoMerge remote branch 'martins/takeover'
Ronnie Sahlberg [Mon, 6 Feb 2012 05:30:49 +0000 (16:30 +1100)]
Merge remote branch 'martins/takeover'

(This used to be ctdb commit 4948f34676d5bdaaf1ddf8879df618a76013ea1e)

12 years agoTest - IP allocation simulation - add -e option to run the daemon's algorithm
Martin Schwenke [Sun, 15 Jan 2012 04:03:02 +0000 (15:03 +1100)]
Test - IP allocation simulation - add -e option to run the daemon's algorithm

A recent change in the deamon's (i.e. real) IP allocation algorithm
uses qsort(3).  This makes it very difficult to get the same results
in Python, since qsort's behaviour on identical keys is undefined.

Add a -e option to run "../bin/ctdb_takeover_tests ctdb_takeover_run_core"
instead of the internal Python algorithm.  We pass the current cluster
state and read it back from the output of the test program.

This is currently a rough hack.  Perhaps it'll be improved later...
:-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit eed3f4988290bbe317a7aaa6f61826676dd8365a)

12 years agoTests - IP allocation simulation - LCP2 => non-deterministic
Martin Schwenke [Sun, 15 Jan 2012 04:01:27 +0000 (15:01 +1100)]
Tests - IP allocation simulation - LCP2 => non-deterministic

The default in this script is still deterministic IPs.  The LCP2
option should really turn off deterministic IPs.

Also fix a typo...

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit c378a059b35fcc9955215a0095826c919d42153c)

12 years agoTests: eventscripts - fix breakage in some NFS tests
Martin Schwenke [Mon, 21 Nov 2011 02:44:30 +0000 (13:44 +1100)]
Tests: eventscripts - fix breakage in some NFS tests

1341329f6125d491b82c873f793af819e677f714 either contains typos or
attempts to influence the test depending on the host system.  Whatever
the cause, a test system (e.g. my laptop) might not have
/etc/sysconfig/nfs, so that can't be used to cause the stub
etc/sysconfig/nfs to be loaded.

We make the tests work by default again, leaving in some flexibility
over configuration file location.

If the goal is to force a Debian-style test mode then:

* The tests are currently probably quite RHEL-centric anyway, so more
  work is probably needed.

* Use an environment variable to indicate the distro test mode and
  make functions like setup_nfs() remove all of the various
  configuration files and create one in the distro-specific location.

I won't do this now... ENOTIME...

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 4aa4a5790ea9ad20e4d25404760c449b358b5260)

12 years agoTests: eventscripts - make init test pass with recent change to 10.interface
Martin Schwenke [Mon, 21 Nov 2011 02:43:07 +0000 (13:43 +1100)]
Tests: eventscripts - make init test pass with recent change to 10.interface

e646142f4d28b5401235cd5edee325f7a29f8193 changes the output on the
init event.  This accommodates that change.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 48cb55aae47d11487bdf004a79df56779d1825a0)

12 years agoTests: new test to check that "ctdb delip" removes the IP from interface.
Martin Schwenke [Tue, 18 Oct 2011 03:48:55 +0000 (14:48 +1100)]
Tests: new test to check that "ctdb delip" removes the IP from interface.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a63e603cb7e21a7334c6a07bc4415ff089dab3c1)

12 years agoTests - ctdb tool - add verbose option and output filtering
Martin Schwenke [Mon, 6 Feb 2012 04:59:08 +0000 (15:59 +1100)]
Tests - ctdb tool - add verbose option and output filtering

Need to filter dates before comparing...

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 6127515ea62173ff1574d1217129ec05a8fbeb3f)

12 years agoTests - ctdb tool - fix "ctdb status" test
Martin Schwenke [Mon, 6 Feb 2012 04:58:15 +0000 (15:58 +1100)]
Tests - ctdb tool - fix "ctdb status" test

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 47e86c33d768816d03817124481bb6aa967bf2a6)

12 years agoTests - let run_tests.sh take a list of tests to run
Martin Schwenke [Mon, 6 Feb 2012 04:57:13 +0000 (15:57 +1100)]
Tests - let run_tests.sh take a list of tests to run

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit fa00bbf7d7378eecb5ba77684d01db90c9370bca)

12 years agoTests: initial ctdb tool testcases
Martin Schwenke [Sun, 15 Jan 2012 03:55:52 +0000 (14:55 +1100)]
Tests: initial ctdb tool testcases

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 47e9975fa75a7bb2628a751dc19d35e2c5c57ce3)

12 years agoTests: fix usage message in ctdb_tool_libctdb
Martin Schwenke [Sun, 15 Jan 2012 03:55:15 +0000 (14:55 +1100)]
Tests: fix usage message in ctdb_tool_libctdb

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit ca1d2bb62e61b7d723a648b3a9b146e258efcabb)

12 years agoTests: libctdb stubs should fail when current node disconnected
Martin Schwenke [Sun, 15 Jan 2012 03:54:14 +0000 (14:54 +1100)]
Tests: libctdb stubs should fail when current node disconnected

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit f96954b42b03f810f7b1732b5fe00c5dab2d8cb8)

12 years agoTests - add a version of the ctdb tool that compiles against libctdb stubs
Martin Schwenke [Thu, 15 Dec 2011 00:26:57 +0000 (11:26 +1100)]
Tests - add a version of the ctdb tool that compiles against libctdb stubs

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 6c79b951c3ae68238f8dbd836ceca6c1187eaabe)

12 years agoctdb tool - free some memory used by popt
Martin Schwenke [Thu, 15 Dec 2011 00:26:09 +0000 (11:26 +1100)]
ctdb tool - free some memory used by popt

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 7339e87019c0ab44522bf160234307472c05dc14)

12 years agoTests - allow tools/ctdb.c:main() to be used
Martin Schwenke [Thu, 15 Dec 2011 00:21:34 +0000 (11:21 +1100)]
Tests - allow tools/ctdb.c:main() to be used

We'll need stubs somewhere else...

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 6f29c39d666485fddef60e9d87bf94082d179ebb)

12 years agoTests - more libctdb stub test infrastructure
Martin Schwenke [Tue, 13 Dec 2011 05:48:10 +0000 (16:48 +1100)]
Tests - more libctdb stub test infrastructure

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 25a0136bd773e7ed8dfda635471f0498d4a7afe9)

12 years agoTests - more libctdb stubs and supporting state faking functions
Martin Schwenke [Tue, 13 Dec 2011 04:44:22 +0000 (15:44 +1100)]
Tests - more libctdb stubs and supporting state faking functions

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 9bfc3b04ffeca056d8507d1cc8bc20f56c8e1572)

12 years agoctdb tool - convert control_status() over to use just libctdb()
Martin Schwenke [Mon, 12 Dec 2011 06:19:00 +0000 (17:19 +1100)]
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)

12 years agolibctdb - add ctdb_getvnnmap()
Martin Schwenke [Mon, 12 Dec 2011 05:48:10 +0000 (16:48 +1100)]
libctdb - add ctdb_getvnnmap()

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit f6039eaece4224b866a98dd49010f278a7b3f015)

12 years agoTests - update test code for ctdb tool code and libctdb stubs
Martin Schwenke [Wed, 7 Dec 2011 03:04:54 +0000 (14:04 +1100)]
Tests - update test code for ctdb tool code and libctdb stubs

Rename ctdb_parse_nodestring.c to ctdb_tool_libctdb.c.  It can contain
many tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit d597020af01dfcdf0d39e1cf579bf33f43f87dda)

12 years agoctdb tool - Fix parse_nodestring() related issues
Martin Schwenke [Tue, 6 Dec 2011 08:50:40 +0000 (19:50 +1100)]
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)

12 years agoAdd a hoook to the ctdb initscript that we can call out to for applications that...
Ronnie Sahlberg [Mon, 6 Feb 2012 01:07:08 +0000 (12:07 +1100)]
Add a hoook to the ctdb initscript that we can call out to for applications that want to
track and produce audit logs when someone runs "service ctdb <something>"

S1033891

(This used to be ctdb commit 4f4fbd4080a3a7226d3b82637f803c4b71217d39)

12 years agoReadOnly update documentation
Ronnie Sahlberg [Wed, 1 Feb 2012 02:47:49 +0000 (13:47 +1100)]
ReadOnly  update documentation

(This used to be ctdb commit e1da34874f22ec3de0c4abe50b703dd637f1fa98)

12 years agoReadOnly: update the loop test tool to print number of fetches per second
Ronnie Sahlberg [Tue, 31 Jan 2012 22:32:02 +0000 (09:32 +1100)]
ReadOnly: update the loop test tool to print number of fetches per second

(This used to be ctdb commit f53c66a5e0dc5351b86b81dc5b1faea757981d4c)

12 years agoNiceify the readonlyrecord API. Dont force clients to be exposed to the featch_with_h...
Ronnie Sahlberg [Tue, 31 Jan 2012 06:20:35 +0000 (17:20 +1100)]
Niceify the readonlyrecord API. Dont force clients to be exposed to the featch_with_header function

We dont strictly need to force clients to use CTDB_FETCH_WITH_HEADER instead of CTDB_FETCH when they ask for readonly records.
Have ctdbd internally remap this internally to FETCH_WITH_HEADER and map the reply back to CTDB_FETCH_FUNC or CTDB_FETCH_WITH_HEADER_FUNC based on what the client initially asked for.

This removes the need for the client to know about the CTDB_FETCH_WITH_HEADER_FUNC function and simplifies the client code.
Clients that do not care what the header after the request is can just continue using the old CTDB_FETCH_FUNC call and ctdbd will do all the difficult stuff.

(This used to be ctdb commit 444a7bac4e9a854b06c1ad4cb36c2b58a72001fa)

12 years agoDefine ETIME on non-supporting platforms
Mathieu Parent [Tue, 6 Dec 2011 21:24:26 +0000 (22:24 +0100)]
Define ETIME on non-supporting platforms

e.g. kFreeBSD, NetBSD, ...

(This used to be ctdb commit ee3ef9004be8feeefa6e450eb5bb084cc6812370)

12 years agoAdd kFreeBSD support
Mathieu Parent [Tue, 6 Dec 2011 21:26:42 +0000 (22:26 +0100)]
Add kFreeBSD support

(This used to be ctdb commit c75e4ad9b566e47dec66d25988da4cee861c2357)

12 years agoFix a cut&paste error
Volker Lendecke [Wed, 18 Jan 2012 11:06:01 +0000 (12:06 +0100)]
Fix a cut&paste error

Signed-off-by: Michael Adam <obnox@samba.org>
(This used to be ctdb commit 488de939b78125ac38822760102e05298a5e70c5)

12 years agoserver: fix a comment typo
Michael Adam [Tue, 10 Jan 2012 09:30:22 +0000 (10:30 +0100)]
server: fix a comment typo

(This used to be ctdb commit 85879edd09ffa26f87c566954cbd2c14f1e331ed)

12 years agoexplain why we use FIONREAD
Ronnie Sahlberg [Wed, 4 Jan 2012 10:41:12 +0000 (21:41 +1100)]
explain why we use FIONREAD

(This used to be ctdb commit d0f85478c37828eb8a24315d4326eb4eaedb9afc)

12 years agoMerge branch 'master' of ssh://git.samba.org/data/git/ctdb
Ronnie Sahlberg [Tue, 3 Jan 2012 01:40:15 +0000 (12:40 +1100)]
Merge branch 'master' of ssh://git.samba.org/data/git/ctdb

(This used to be ctdb commit 15d8ae8b0f80f95d7839528b8ac60aa0e2485c77)

12 years agoMerge remote branch 'martins/nodestatus'
Ronnie Sahlberg [Tue, 3 Jan 2012 01:31:37 +0000 (12:31 +1100)]
Merge remote branch 'martins/nodestatus'

(This used to be ctdb commit adcb076612c56f92cfb6f3ba90721981a067a494)

12 years agovacuum: improve logging in remove_record_from_delete_queue()
Michael Adam [Fri, 23 Dec 2011 16:23:07 +0000 (17:23 +0100)]
vacuum: improve logging in remove_record_from_delete_queue()

(This used to be ctdb commit 809d1f3b8a9232fce0376cb47e4f633b49237529)

12 years agovacuum: improve logging in delete_record_traverse()
Michael Adam [Fri, 23 Dec 2011 16:22:46 +0000 (17:22 +0100)]
vacuum: improve logging in delete_record_traverse()

(This used to be ctdb commit 40ca781b3305d9f0bfee5b109d4eefde461a3f13)

12 years agovacuum: improve logging in insert_record_into_delete_queue()
Michael Adam [Fri, 23 Dec 2011 16:10:20 +0000 (17:10 +0100)]
vacuum: improve logging in insert_record_into_delete_queue()

(This used to be ctdb commit db59ac2ee6a9f5f7f088ebbc5e2800d9e57aae17)

12 years agovacuum: improve debugging in delete_queue_traverse()
Michael Adam [Fri, 23 Dec 2011 16:08:28 +0000 (17:08 +0100)]
vacuum: improve debugging in delete_queue_traverse()

(This used to be ctdb commit 2c44c6dc583872c603a399afb01936abcbb05158)

12 years agovacuum: add debug message to insert_record_into_delete_queue() for failed insert
Michael Adam [Fri, 23 Dec 2011 14:14:06 +0000 (15:14 +0100)]
vacuum: add debug message to insert_record_into_delete_queue() for failed insert

(This used to be ctdb commit ae78e8d991636a3a79dd9fbcefc15032afb08f55)

12 years agovacuum: improve debugging in insert_record_into_delete_queue()
Michael Adam [Fri, 23 Dec 2011 09:37:25 +0000 (10:37 +0100)]
vacuum: improve debugging in insert_record_into_delete_queue()

(This used to be ctdb commit 6e6aaba28ac560d51d7450ebcf99babf868d0aea)

12 years agovacuum: initialize (to zero) the vacuum fetch list in ctdb_vacuum_init_vacuum_data()
Michael Adam [Thu, 22 Dec 2011 23:14:18 +0000 (00:14 +0100)]
vacuum: initialize (to zero) the vacuum fetch list in ctdb_vacuum_init_vacuum_data()

(This used to be ctdb commit 772e08c29ef70a4cc73f7887939e5071a90a98cb)

12 years agovacuum: add statistics output for processing of the delete list
Michael Adam [Thu, 22 Dec 2011 14:46:49 +0000 (15:46 +0100)]
vacuum: add statistics output for processing of the delete list

(This used to be ctdb commit bec2ff46402b6d90521c75e8d46b9f6f2f47239a)

12 years agodoc:ctdb.1: add generated files after update
Michael Adam [Tue, 13 Dec 2011 13:48:38 +0000 (14:48 +0100)]
doc:ctdb.1: add generated files after update

(This used to be ctdb commit 4f23976fad3de63a47cf81d26dff1973d025e262)

12 years agodoc:ctdb.1: explain that "ctdb listvars" does not list obsolete tunables any more
Michael Adam [Thu, 22 Dec 2011 12:05:26 +0000 (13:05 +0100)]
doc:ctdb.1: explain that "ctdb listvars" does not list obsolete tunables any more

(This used to be ctdb commit 4ed94279f243729d521d365a44607fd086ae7c41)

12 years agodoc:ctdb.1: adapt example output of "ctdb listvars" to current state
Michael Adam [Tue, 13 Dec 2011 13:47:42 +0000 (14:47 +0100)]
doc:ctdb.1: adapt example output of "ctdb listvars" to current state

(This used to be ctdb commit 583cbf1bf8f6b1a805d77a2a1d521015868c7828)

12 years agoctdb-tool: adapt formatting of "listvars" output to lenght of longest name
Michael Adam [Thu, 22 Dec 2011 11:13:10 +0000 (12:13 +0100)]
ctdb-tool: adapt formatting of "listvars" output to lenght of longest name

(This used to be ctdb commit 295168d99183d2d21f27a8ac6825d421fa866b28)

12 years agotunables: don't list obsolete tunables in the list_tunables control
Michael Adam [Thu, 22 Dec 2011 11:52:55 +0000 (12:52 +0100)]
tunables: don't list obsolete tunables in the list_tunables control

(This used to be ctdb commit d8ab86f0eb11437e50d18183858dd3177a8f61e6)

12 years agotunables: add a bool obsolete flag to the tunable_map list
Michael Adam [Thu, 22 Dec 2011 11:46:04 +0000 (12:46 +0100)]
tunables: add a bool obsolete flag to the tunable_map list

(This used to be ctdb commit 1a7d9b25fdcf7b59598618d406c2a681c90d9163)

12 years agovacuum: add a comment explaining a race in the vacuum code.
Michael Adam [Tue, 20 Dec 2011 14:58:34 +0000 (15:58 +0100)]
vacuum: add a comment explaining a race in the vacuum code.

(This used to be ctdb commit 07f1ba54b1617fadd6fe83826dd8e76f37cea071)

12 years agovacuum: factor out initialization of the vacuum data from ctdb_vacuum_db()
Michael Adam [Tue, 20 Dec 2011 14:50:51 +0000 (15:50 +0100)]
vacuum: factor out initialization of the vacuum data from ctdb_vacuum_db()

for readability

(This used to be ctdb commit 1963e33859e9dc51e9e88664c6d95e62c7c8b8be)

12 years agovacuum: streamline ctdb_process_delete_list()
Michael Adam [Fri, 16 Dec 2011 22:16:27 +0000 (23:16 +0100)]
vacuum: streamline ctdb_process_delete_list()

Reducing indentiation and improving use of talloc.

(This used to be ctdb commit 11f52ba18370f1dda983f2263f9af82045b4fdea)

12 years agovacuum: factor processing of the delete list out of ctdb_vacuum_db()
Michael Adam [Fri, 16 Dec 2011 22:15:51 +0000 (23:15 +0100)]
vacuum: factor processing of the delete list out of ctdb_vacuum_db()

(This used to be ctdb commit cf68b762432a18e4a3cda137591b3f005c196906)

12 years agovacuum: factor processing of vacuum fetch lists out of ctdb_vacuum_db()
Michael Adam [Fri, 16 Dec 2011 16:00:07 +0000 (17:00 +0100)]
vacuum: factor processing of vacuum fetch lists out of ctdb_vacuum_db()

(This used to be ctdb commit 905fc9cd7126ab84c23d4a803c59e32b9c54e6f0)

12 years agovacuum: factor out full vacuum run out of ctdb_vacuum_db() as ctdb_vacuum_db_full()
Michael Adam [Fri, 16 Dec 2011 10:04:13 +0000 (11:04 +0100)]
vacuum: factor out full vacuum run out of ctdb_vacuum_db() as ctdb_vacuum_db_full()

(This used to be ctdb commit e31594e0c13899e88013ce7eb7e3dc434c2f0723)

12 years agovacuum: factor out the fast vacuuming run into ctdb_vacuum_db_fast()
Michael Adam [Fri, 16 Dec 2011 09:59:26 +0000 (10:59 +0100)]
vacuum: factor out the fast vacuuming run into ctdb_vacuum_db_fast()

for readability

(This used to be ctdb commit 6596f2c4a6b4783b6498502fbbf50f87d4f59085)

12 years agovacuum: rename delete_tree to delete_list
Michael Adam [Fri, 16 Dec 2011 09:53:26 +0000 (10:53 +0100)]
vacuum: rename delete_tree to delete_list

It is not important for the user that this is implemented as a tree.

(This used to be ctdb commit f686bc440560074c1ce866f2037ae3671f182185)

12 years agovacuum: appropriately rename vdata.list to vdata.vacuum_fetch_list
Michael Adam [Fri, 16 Dec 2011 09:49:41 +0000 (10:49 +0100)]
vacuum: appropriately rename vdata.list to vdata.vacuum_fetch_list

(This used to be ctdb commit 09c55b76c96c4ab3fe812763007b81cf0a2ac86c)

12 years agovacuum: introduce a helper variable for the vacuum fetch list in ctdb_vacuum_db()
Michael Adam [Fri, 16 Dec 2011 09:46:54 +0000 (10:46 +0100)]
vacuum: introduce a helper variable for the vacuum fetch list in ctdb_vacuum_db()

(This used to be ctdb commit 019106e035520e6b3e5702b6e76d910626c3df13)

12 years agovacuum: introduce a helper variable in add_record_to_vacuum_fetch_list() to reduce...
Michael Adam [Fri, 16 Dec 2011 09:43:06 +0000 (10:43 +0100)]
vacuum: introduce a helper variable in add_record_to_vacuum_fetch_list() to reduce verbosity

(This used to be ctdb commit 48fe56ea27e3649ae7a67257fdce54f973e7c3c5)

12 years agotools/ctdb: allow the "ctdb vacuum" stub to be run without the daemon running.
Michael Adam [Tue, 13 Dec 2011 16:43:58 +0000 (17:43 +0100)]
tools/ctdb: allow the "ctdb vacuum" stub to be run without the daemon running.

(This used to be ctdb commit e71afbf731f06a3b89b64220c7fd1b1ea5492d4a)

12 years agotools/ctdb: remove functionality of "ctdb vacuum", just keeping a stub.
Michael Adam [Tue, 13 Dec 2011 16:43:10 +0000 (17:43 +0100)]
tools/ctdb: remove functionality of "ctdb vacuum", just keeping a stub.

(This used to be ctdb commit 8fc4d5018ee6eee8856634095694d3ad0de5b4ae)

12 years agovacuum: locally delete the records in the delete_tree that have be deleted remotely
Michael Adam [Tue, 13 Dec 2011 16:32:45 +0000 (17:32 +0100)]
vacuum: locally delete the records in the delete_tree that have be deleted remotely

This way, especially records added in the fast vacuuming runs
are deleted direclty instead of being handed back to the
repack run which will probably not hit because of the vacuum limit.

(This used to be ctdb commit ea3e640a28178ddcb85285f4efec62ccba2483d9)

12 years agovacuum: improve vacuuming statistics for handling the delete_tree.
Michael Adam [Tue, 13 Dec 2011 16:30:39 +0000 (17:30 +0100)]
vacuum: improve vacuuming statistics for handling the delete_tree.

Track the number of records failed to delete remotely with the
TRY_DELETE_RECORDS control.
And add a number of records left to delete locally.

(This used to be ctdb commit 536aad024d52f2c32dd397fc86294c963b91341b)

12 years agovacuum: fix and improve a comment
Michael Adam [Tue, 13 Dec 2011 15:05:05 +0000 (16:05 +0100)]
vacuum: fix and improve a comment

(This used to be ctdb commit 0ed349c24c7399b3b440c1f5d573db77ddb988b3)

12 years agovacuum: appropriately rename delete_traverse() to delete_marshall_traverse()
Michael Adam [Tue, 13 Dec 2011 14:59:38 +0000 (15:59 +0100)]
vacuum: appropriately rename delete_traverse()  to delete_marshall_traverse()

(This used to be ctdb commit 7c5b27bc8dce9e30f2aff05297113da981f7b9a3)

12 years agovacuum: initialize the delete_count in the vacuum data
Michael Adam [Tue, 13 Dec 2011 14:58:52 +0000 (15:58 +0100)]
vacuum: initialize the delete_count in the vacuum data

(This used to be ctdb commit 970b8fc60857ad2f18f45312d355c571fb2f0246)

12 years agovacuum: fix the VacuumInterval tunable's type to uint32_t in get_vacuum_interval()
Michael Adam [Tue, 13 Dec 2011 13:21:04 +0000 (14:21 +0100)]
vacuum: fix the VacuumInterval tunable's type to uint32_t in get_vacuum_interval()

(This used to be ctdb commit a5a29bf92b23e9b5a1523b06461eced422b22ffe)

12 years agovacuum: add new tunable VacuumInterval and mark Vacuum{Default,Min,Max}Interval obsolete
Michael Adam [Tue, 13 Dec 2011 13:33:08 +0000 (14:33 +0100)]
vacuum: add new tunable VacuumInterval and mark Vacuum{Default,Min,Max}Interval obsolete

And use VacuumInterval instead of VacuumDefaultInterval in the code.

(This used to be ctdb commit 78530f40338f511a7cd1d33ada450905742bfa8f)

12 years agovacuum: remove struct vacuum_tuning_data (unused)
Michael Adam [Tue, 13 Dec 2011 13:36:35 +0000 (14:36 +0100)]
vacuum: remove struct vacuum_tuning_data (unused)

(This used to be ctdb commit 1f62afbe1ae0b3e7dbad4081d1b51e3ab6ee5c39)

12 years agovacuum: use get_vacuum_interval() in ctdb_vacuum_event()
Michael Adam [Tue, 13 Dec 2011 13:32:12 +0000 (14:32 +0100)]
vacuum: use get_vacuum_interval() in ctdb_vacuum_event()

(instead of using the tunable directly)

(This used to be ctdb commit e40fa9efd1c77aa35c917aba6e6e4d21d9c5cdea)

12 years agovacuum: change get_vacuum_interval() to simply return the VacuumDefaultInterval tunable
Michael Adam [Tue, 13 Dec 2011 13:16:23 +0000 (14:16 +0100)]
vacuum: change get_vacuum_interval() to simply return the VacuumDefaultInterval tunable

(This used to be ctdb commit 621c3ce957cb946ca05a2d527c037746ae2f01d3)

12 years agovacuum: remove update_tuning_db()
Michael Adam [Tue, 13 Dec 2011 13:06:09 +0000 (14:06 +0100)]
vacuum: remove update_tuning_db()

(This used to be ctdb commit d93750ea3f5cb854e5893e53795fd08656e7c12c)

12 years agoctdb_ltdb_store_server: when storing a record that is not to be scheduled for deletio...
Michael Adam [Thu, 7 Apr 2011 10:17:42 +0000 (12:17 +0200)]
ctdb_ltdb_store_server: when storing a record that is not to be scheduled for deletion, remove it from the delete queue

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 489148e465e2b8aed87ea836e3518f43490671ca)

12 years agovacuum: add ctdb_local_remove_from_delete_queue()
Michael Adam [Thu, 7 Apr 2011 10:17:16 +0000 (12:17 +0200)]
vacuum: add ctdb_local_remove_from_delete_queue()

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit a5065b42a98c709173503e02d217f97792878625)

12 years agorb_tree: fix possible access-after-free-error in trbt_traversearray32_node
Michael Adam [Thu, 22 Dec 2011 17:09:36 +0000 (18:09 +0100)]
rb_tree: fix possible access-after-free-error in trbt_traversearray32_node

When the traverse callback frees the current node, the traverse of the
rbtree can fail (the next node->right fails since node is not there any more...).
This is fixed by introducing variables to store the right (and left)
pointers before the callback is called.

(This used to be ctdb commit 8b0caaeed154d26c67a73659d3bbbdd63b21be11)

12 years agofix zero-initialization of header in _ctdbd_allocate_pkt to the correct size
Michael Adam [Thu, 22 Dec 2011 16:18:38 +0000 (17:18 +0100)]
fix zero-initialization of header in _ctdbd_allocate_pkt to the correct size

(This used to be ctdb commit 6c4d1b768ccade344a7462ecad7cf5cbbf3873d4)

12 years agoTests: eventscripts - add tests for CTDB_DELETE_UNEXPECTED_IPS="yes"
Martin Schwenke [Mon, 21 Nov 2011 03:15:01 +0000 (14:15 +1100)]
Tests: eventscripts - add tests for CTDB_DELETE_UNEXPECTED_IPS="yes"

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 00373958a5d5fb8c9b99548d5b9f327e78669162)

12 years agoDOC: Update the manpage to describe all relevant tunables
Ronnie Sahlberg [Wed, 14 Dec 2011 03:23:53 +0000 (14:23 +1100)]
DOC: Update the manpage to describe all relevant tunables

(This used to be ctdb commit 3f471da605b9c43d5e1206452f238c2a91dc02f7)

12 years agotypo
Ronnie Sahlberg [Wed, 14 Dec 2011 01:52:35 +0000 (12:52 +1100)]
typo

(This used to be ctdb commit 8fc71ad4da746e28406c06a95928052b29803062)

12 years agoTests - make a comment more accurate
Martin Schwenke [Wed, 7 Dec 2011 07:40:55 +0000 (18:40 +1100)]
Tests - make a comment more accurate

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 726b598076132a5a73f9259d6b65ee2a4012099f)

12 years agoTests - test code for parse_nodestring() function
Martin Schwenke [Wed, 7 Dec 2011 03:04:54 +0000 (14:04 +1100)]
Tests - test code for parse_nodestring() function

This function is fairly complex so here is some test code.

This reworks Makefile a bit and also provides test stubs for some
libctdb functions.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 5b11f990404c26c279c9ae389483e560f1c01a81)

12 years agoRename struct traverse_state to allow tools C files to be #included.
Martin Schwenke [Wed, 7 Dec 2011 02:40:24 +0000 (13:40 +1100)]
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)

12 years agoctdb tool - remove verify_node() function
Martin Schwenke [Wed, 7 Dec 2011 02:35:49 +0000 (13:35 +1100)]
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)

12 years agoctdb tool - new command "ctdb nodestatus [nodestring]"
Martin Schwenke [Tue, 6 Dec 2011 09:17:02 +0000 (20:17 +1100)]
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)

12 years agoctdb tool - factor out status printing functions
Martin Schwenke [Tue, 6 Dec 2011 09:10:34 +0000 (20:10 +1100)]
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)

12 years agoctdb tool - generalise nodestring parsing for -n
Martin Schwenke [Tue, 6 Dec 2011 08:50:40 +0000 (19:50 +1100)]
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)

12 years agolibctdb: fix libctdb's traverse after changes in the core
Michael Adam [Tue, 6 Dec 2011 09:38:04 +0000 (10:38 +0100)]
libctdb: fix libctdb's traverse after changes in the core

In 8281bb210858ed04992eacea7f6d02261e0fc1b1, I forgot to change
this hunk back when hiding the wire changes done in commit
ddc5da3a0df7701934404192a0a0aa659a806acb behind a new control
CTDB_CONTROL_TRAVERSE_START_EXT.

(This used to be ctdb commit faf25e8a2fdf80a016048e1f698a014ceb5e604f)

12 years agoRevert "Fix the build that broke in 8281bb210858ed04992eacea7f6d02261e0fc1b1"
Michael Adam [Tue, 6 Dec 2011 09:42:43 +0000 (10:42 +0100)]
Revert "Fix the build that broke in 8281bb210858ed04992eacea7f6d02261e0fc1b1"

This reverts commit 08e06176feab1ec244496e62a916fbb77817239f.

I wanted to fix this differently, not using the extended traverse_start
control...

(This used to be ctdb commit f60de23e0a8307b5baaa9c4b8406b2b223487a48)

12 years agoctdb tool - move parsing of nodestring to where it is needed
Martin Schwenke [Tue, 29 Nov 2011 04:18:45 +0000 (15:18 +1100)]
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)

12 years agoctdb tool - replace fprintf with DEBUG
Martin Schwenke [Tue, 29 Nov 2011 04:17:09 +0000 (15:17 +1100)]
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)

12 years agoctdb tool - short circuit most of the logic in main for non-daemon commands
Martin Schwenke [Tue, 29 Nov 2011 03:38:39 +0000 (14:38 +1100)]
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)