ctdb.git
12 years agoReadOnly: clear out the tracking record once a revoke is completed 1.2-readonly-delegations-test
Ronnie Sahlberg [Wed, 17 Aug 2011 06:14:57 +0000 (16:14 +1000)]
ReadOnly: clear out the tracking record once a revoke is completed

12 years agoReadOnly: When the client wants a readwrite lock but the local node is the dmaster...
Ronnie Sahlberg [Thu, 21 Jul 2011 05:59:37 +0000 (15:59 +1000)]
ReadOnly: When the client wants a readwrite lock but the local node is the dmaster and also have delegations active we must send a CALL to the local daemon to trigger it to revoke the delegations

12 years agoReadOnly: Change the update_record test tool to use the new fetchlock routine that...
Ronnie Sahlberg [Thu, 21 Jul 2011 05:58:56 +0000 (15:58 +1000)]
ReadOnly: Change the update_record test tool to use the new fetchlock routine that can do either normal or readonly fetchlock

12 years agoReadOnly: Add a test tool that requests a readonly delegation in a loop
Ronnie Sahlberg [Wed, 20 Jul 2011 05:47:15 +0000 (15:47 +1000)]
ReadOnly: Add a test tool that requests a readonly delegation in a loop

12 years agoReadOnly: Add a test tool to fetch a record, requesting a readonly delegation and...
Ronnie Sahlberg [Wed, 20 Jul 2011 05:43:55 +0000 (15:43 +1000)]
ReadOnly: Add a test tool to fetch a record, requesting a readonly delegation and lock the record once

12 years agoReadOnly: Add clientside code to fetch readonly records
Ronnie Sahlberg [Wed, 20 Jul 2011 05:37:37 +0000 (15:37 +1000)]
ReadOnly: Add clientside code to fetch readonly records

12 years agoReadOnly: Add a ctdb_ltdb_fetch_readonly() helper function
Ronnie Sahlberg [Wed, 20 Jul 2011 05:31:44 +0000 (15:31 +1000)]
ReadOnly: Add a ctdb_ltdb_fetch_readonly() helper function

12 years agoReadOnly: Add handlign of readonly requests readwrite requests, delegations and revok...
Ronnie Sahlberg [Wed, 20 Jul 2011 05:17:29 +0000 (15:17 +1000)]
ReadOnly: Add handlign of readonly requests readwrite requests, delegations and revoking of delegation to the processing loop for CALL requests coming in from a local client via domain socket

12 years agoReadOnly: Add processing for ReadOnly delegation requests and revoke requests to...
Ronnie Sahlberg [Wed, 20 Jul 2011 05:13:47 +0000 (15:13 +1000)]
ReadOnly: Add processing for ReadOnly delegation requests and revoke requests to the processing loop for CALL packets we receive from different nodes.

This implements the ReadOnly and ReadWrite request processing, delegation and revoking of delegations for all requests coming in across the network from a remote node.

12 years agoReadOnly: Once recovery has finished, make sure to free all revoke child processes...
Ronnie Sahlberg [Wed, 20 Jul 2011 04:25:29 +0000 (14:25 +1000)]
ReadOnly: Once recovery has finished, make sure to free all revoke child processes and trigger the destructors for all deferred calls to re-queue the original packets to the input packet processing function

12 years agoReadOnly: When releasing all deferred calls that blocked during revoke of all previou...
Ronnie Sahlberg [Wed, 20 Jul 2011 04:23:05 +0000 (14:23 +1000)]
ReadOnly: When releasing all deferred calls that blocked during revoke of all previous delegations, add a 1 second grace/delay for any new readonly delegation requests so that the read-write fetch-lock porcess has a chance to make progress

12 years agoReadOnly: Add a new flag to call request packet to indicate that the client wants...
Ronnie Sahlberg [Wed, 20 Jul 2011 04:21:04 +0000 (14:21 +1000)]
ReadOnly: Add a new flag to call request packet to indicate that the client wants a readonly delegation

12 years agoReadOnly: Add a function to start a revoke of all delegations for a record.
Ronnie Sahlberg [Wed, 20 Jul 2011 04:18:43 +0000 (14:18 +1000)]
ReadOnly: Add a function to start a revoke of all delegations for a record.
This triggers a child process to be created to perform the actual potentially blocking calls that are required.

12 years agoReadOnly: Add functions to register CALLs to a context used to handle deferal of...
Ronnie Sahlberg [Wed, 20 Jul 2011 03:49:17 +0000 (13:49 +1000)]
ReadOnly: Add functions to register CALLs to a context used to handle deferal of processing of CALL commands.
Once the contexts are freed, the deferred calls are re-issued to the input packet processing functions again.
This is needed when/if a CALL can not currently be processed by the main engine due to the record being locked down for revoking of all delegations.

The data is passed through several layers of callbacks, and finally a timed event callback to ensure that the processing of the packet will be restarted again at the topmost eventloop, avoinding event loop nesting.

12 years agoReadOnly: Add an extra flag to ctdb_call_local to specify whether we want to write...
Ronnie Sahlberg [Wed, 20 Jul 2011 03:30:12 +0000 (13:30 +1000)]
ReadOnly: Add an extra flag to ctdb_call_local to specify whether we want to write the record and header back to the tdb (for example we do when performing dmaster migrations)

12 years agoReadOnly: After recovering all databases, make sure to clear out the tracking databas...
Ronnie Sahlberg [Wed, 20 Jul 2011 03:20:32 +0000 (13:20 +1000)]
ReadOnly: After recovering all databases, make sure to clear out the tracking database used to track delegations and revoke. This is because the recovery will implicitely result in a revoke of all delegations.

12 years agoReadOnly: Add "readonly" flag to the ctdb_db_context to indicate if this database...
Ronnie Sahlberg [Wed, 20 Jul 2011 03:15:48 +0000 (13:15 +1000)]
ReadOnly: Add "readonly" flag to the ctdb_db_context to indicate if this database supports readonly operations or not. Add a private lock-less tdb file to the ctdb_db_context to use for tracking delegarions for records

Assume all databases will support readonly mode for now and se thte flag for all databases. At later stage we will add support to control on a per database level whether delegations will be supported or not.

12 years agoReadOnly: After performing a recovery, clear out all flags related to readonly delega...
Ronnie Sahlberg [Wed, 20 Jul 2011 03:08:21 +0000 (13:08 +1000)]
ReadOnly: After performing a recovery, clear out all flags related to readonly delegations and revoke

12 years agoReadOnly: Add a new command 'ctdb cattdb'. This fucntion differs from 'ctdb catdb...
Ronnie Sahlberg [Wed, 20 Jul 2011 02:30:33 +0000 (12:30 +1000)]
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.

12 years agoReadOnly: Add printing of the record flags when we are traversing a database to print...
Ronnie Sahlberg [Wed, 20 Jul 2011 02:21:33 +0000 (12:21 +1000)]
ReadOnly: Add printing of the record flags when we are traversing a database to print its content.

12 years agoReadOnly: Add 4 new record flags to handle read only delegation and revoking of deleg...
Ronnie Sahlberg [Wed, 20 Jul 2011 02:17:27 +0000 (12:17 +1000)]
ReadOnly: Add 4 new record flags to handle read only delegation and revoking of delegations

12 years agoReadOnly: add a new test tool that does a fetchlock on a record, then bunps the RSN...
Ronnie Sahlberg [Wed, 20 Jul 2011 02:13:53 +0000 (12:13 +1000)]
ReadOnly: add a new test tool that does a fetchlock on a record, then bunps the RSN by 10 and writes the new content to the record as sprintf("%d", rsn)

12 years agoReadOnly: Add clientside functions to send the UPDATE_RECORD control
Ronnie Sahlberg [Wed, 20 Jul 2011 02:06:37 +0000 (12:06 +1000)]
ReadOnly: Add clientside functions to send the UPDATE_RECORD control

12 years agoReadOnly: Add test tool to validate the functions to manipulate and enumerate the...
Ronnie Sahlberg [Wed, 20 Jul 2011 01:50:14 +0000 (11:50 +1000)]
ReadOnly: Add test tool to validate the functions to manipulate and enumerate the bitmap of nodes to where we have readonly delegations

12 years agoReadOnly: Add helper functions to manipulate a TDB_DATA as a bitmap for nodes that...
Ronnie Sahlberg [Wed, 20 Jul 2011 01:39:50 +0000 (11:39 +1000)]
ReadOnly: Add helper functions to manipulate a TDB_DATA as a bitmap for nodes that we are tracking as having a readonly delegation

12 years agoReadOnly records: Add a new RPC function FETCH_WITH_HEADER.
Ronnie Sahlberg [Wed, 20 Jul 2011 01:27:05 +0000 (11:27 +1000)]
ReadOnly records: Add a new RPC function FETCH_WITH_HEADER.
This function differs from the old FETCH in that this function will also fetch the record header and not just the record data

12 years agonew version 1.2.31
Ronnie Sahlberg [Mon, 11 Jul 2011 07:41:12 +0000 (17:41 +1000)]
new version 1.2.31

12 years agoEventscript functions: optimise ctdb_check_tcp_ports() and add debug.
Martin Schwenke [Tue, 5 Jul 2011 01:32:06 +0000 (11:32 +1000)]
Eventscript functions: optimise ctdb_check_tcp_ports() and add debug.

ctdb_check_tcp_ports() runs "netstat -a -t -n" in a loop for each
port.  There are 2 problems with this:

* Netstat is run on each loop iteration when it need only be run once.

* The -a option is used to list all connections but the function only
  cares about the listening ports.  There may be many thousands of
  non-listening ports to grep through.

This changes ctdb_check_tcp_ports() to run netstat with the -l option
instead of the -a option.  It also only runs netstat once before the
main loop.

When a port is found to not be listening the output of the netstat
command is now dumped to help with debugging.

Signed-off-by: Martin Schwenke <martin@meltin.net>
12 years agoAdd log output to wipedb and backupdb
Ronnie Sahlberg [Mon, 4 Jul 2011 20:29:00 +0000 (06:29 +1000)]
Add log output to wipedb and backupdb
CQ S1025379

12 years agoWhen trying to re-balance the ip assignment and shuffle ips from
Ronnie Sahlberg [Tue, 3 Aug 2010 03:34:27 +0000 (13:34 +1000)]
When trying to re-balance the ip assignment and shuffle ips from
nodes with many addresses to nodes with few addresses,
loop up to num_ips+5 times instead of only 5 times.

When we have very many public ips per node, we might need to loop more than
5 times or else we will exit without reaching optimal balance.

12 years agochange the name for the key for the record where we stoire the public address config...
Ronnie Sahlberg [Tue, 28 Jun 2011 05:39:38 +0000 (15:39 +1000)]
change the name for the key for the record where we stoire the public address config from public-addresses... to public_addresses...

CQ1019030

12 years agoRemove a benign by annoying log message that will be logged after an interface that...
Ronnie Sahlberg [Sat, 18 Jun 2011 00:47:25 +0000 (10:47 +1000)]
Remove a benign by annoying log message that will be logged after an interface that has been in use has later been removed and is no longer referenced by any public addresses.

CQ S1024495

12 years agoonnode: fix natgwlist nodespec
Martin Schwenke [Mon, 23 May 2011 05:33:12 +0000 (15:33 +1000)]
onnode: fix natgwlist nodespec

This hasn't worked for a while if ever.

We treat this case specially because the output has 2 works on the 1st
line.  We also handle the error case where /etc/ctdb_natgw_nodes
exists but none of the other $NATGW_* configuration is done.

Signed-off-by: Martin Schwenke <martin@meltin.net>
12 years agoonnode: fix get_nodes_with_status()
Martin Schwenke [Mon, 23 May 2011 05:24:52 +0000 (15:24 +1000)]
onnode: fix get_nodes_with_status()

Setting IFS and looping though items with colons in them doesn't work.
Change this to read through the output line by line.  The header line
needs to be thrown away by throwing away everything up to the 1st
newline.

Keep stderr from the "ctdb status" command, otherwise debugging is
impossible.

On error, append any output from ctdb to onnode's error message.

Signed-off-by: Martin Schwenke <martin@meltin.net>
12 years agoonnode: Remove an unnecessary comment.
Martin Schwenke [Tue, 17 May 2011 04:26:55 +0000 (14:26 +1000)]
onnode: Remove an unnecessary comment.

The comment about $CTDB_NODES_SOCKETS is meaningless.  The code ti
refers to works just find with $CTDB_NODES_SOCKETS.

Signed-off-by: Martin Schwenke <martin@meltin.net>
12 years agoonnode: Future-proof get_nodes_with_status().
Martin Schwenke [Tue, 17 May 2011 04:24:30 +0000 (14:24 +1000)]
onnode: Future-proof get_nodes_with_status().

The current code requires knowledge of the number of status bits
output by "ctdb status -Y".

This changes the code to be completely general.

Signed-off-by: Martin Schwenke <martin@meltin.net>
12 years agoonnode: Exit with error for unknown command-line flags.
Martin Schwenke [Tue, 17 May 2011 03:25:08 +0000 (13:25 +1000)]
onnode: Exit with error for unknown command-line flags.

Use of "local" was masking errors in command-line processing.

Signed-off-by: Martin Schwenke <martin@meltin.net>
12 years agoonnode: Be defensive when listing IPs of nodes with designated status.
Martin Schwenke [Tue, 17 May 2011 03:20:51 +0000 (13:20 +1000)]
onnode: Be defensive when listing IPs of nodes with designated status.

The current version gives the last item left after stripping the known
fields.  If an insufficent number of status fields is stripped then
this would return a residual status field value, which turned out to
be a valid IP address for localhost...  so no error occurs.

This change means that the node number is stripped and any residual
status field value will stay appended, causing an error the first time
this command is tested.

Signed-off-by: Martin Schwenke <martin@meltin.net>
12 years agoonnode - Fix long standing bug in onnode healthy/ok/connected/con.
Martin Schwenke [Tue, 17 May 2011 03:18:11 +0000 (13:18 +1000)]
onnode - Fix long standing bug in onnode healthy/ok/connected/con.

When the output of "ctdb status -Y" changed to add an extra status
column we didn't fix onnode.

This adds a match for the extra column.

Signed-off-by: Martin Schwenke <martin@meltin.net>
12 years agoNew version 1.2.30
Ronnie Sahlberg [Mon, 30 May 2011 04:41:12 +0000 (14:41 +1000)]
New version 1.2.30

12 years agopackaging: add ltdbtool and its manpage to the RPM
Michael Adam [Wed, 4 May 2011 12:28:26 +0000 (14:28 +0200)]
packaging: add ltdbtool and its manpage to the RPM

12 years agoinstall the ltdbtool manpage with "make install"
Michael Adam [Wed, 4 May 2011 12:25:48 +0000 (14:25 +0200)]
install the ltdbtool manpage with "make install"

12 years agoinstall ltdbtool with "make install"
Michael Adam [Wed, 4 May 2011 11:44:59 +0000 (13:44 +0200)]
install ltdbtool with "make install"

12 years agobuild "ltdbtool" in "make all"
Michael Adam [Wed, 4 May 2011 11:44:10 +0000 (13:44 +0200)]
build "ltdbtool" in "make all"

12 years agoltdbtool: add manpage html + roff
Gregor Beck [Wed, 4 May 2011 12:17:04 +0000 (14:17 +0200)]
ltdbtool: add manpage html + roff

Signed-off-by: Michael Adam <obnox@samba.org>
12 years agoltdbtool: add manpage
Gregor Beck [Wed, 4 May 2011 12:14:54 +0000 (14:14 +0200)]
ltdbtool: add manpage

Signed-off-by: Michael Adam <obnox@samba.org>
12 years agoadd ltdbtool - a standalone ltdb tool
Gregor Beck [Thu, 14 Apr 2011 10:51:59 +0000 (12:51 +0200)]
add ltdbtool - a standalone ltdb tool

This this is a tool to handle (dump and convert) ctdb's local tdb
copies (ltdbs) without connecting to a ctdb daemon.

It can be used to

* dump the contents of a ltdb, printing
  the ctdb record header information

* dump a non-clustered tdb database (like tdbdump)

* convert between an ltdb and a non-clustered tdb
  (adding or removing ctdb headers)

* convert between 64 and 32 bit ltdbs
  (the ctdb record headers differ by 4 bytes of padding)

usage: bin/ltdbtool dump [-p] [-s{0|32|64}] <idb>
       bin/ltdbtool convert [-s{0|32|64}] [-o{0|32|64}] <idb> <odb>

Pair-Programmed-With: Michael Adam <obnox@samba.org>

12 years agoctdb catdb: fix escaping of '"' and '\'
Gregor Beck [Thu, 14 Apr 2011 10:55:57 +0000 (12:55 +0200)]
ctdb catdb: fix escaping of '"' and '\'

Signed-off-by: Michael Adam <obnox@samba.org>
12 years agoWhen using multiple VLANs, some funky stuff can sometimes happen when
Ronnie Sahlberg [Thu, 12 May 2011 00:24:46 +0000 (10:24 +1000)]
When using multiple VLANs, some funky stuff can sometimes happen when
adding/removing IP addresses causing routes might be dropped by the system.

The easiest workaround for this is to unconditionally try to reapply
all static routes for all interfaces once ipreallocation has finished,
not just adding them back on the affected interface.

This worksaround a funky issue in
CQ S1023538

12 years agoRemove all checking of GPFS from ctdb_diagnostics
Ronnie Sahlberg [Wed, 11 May 2011 09:50:09 +0000 (19:50 +1000)]
Remove all checking of GPFS from ctdb_diagnostics

CQ S1023524

12 years agoNew version 1.2.29
Ronnie Sahlberg [Tue, 10 May 2011 00:51:37 +0000 (10:51 +1000)]
New version 1.2.29

12 years agoIf samba fails to start for some reason, make this cause the startup event to fail...
Ronnie Sahlberg [Mon, 9 May 2011 22:25:27 +0000 (08:25 +1000)]
If samba fails to start for some reason, make this cause the startup event to fail too,   so that ctdbd will re-try the startup event later.
Or else this will leave samba not running.

CQ S1023394

12 years agoDont exit from checking interfaces once we have found one interface that is not
Ronnie Sahlberg [Mon, 9 May 2011 20:19:34 +0000 (06:19 +1000)]
Dont exit from checking interfaces once we have found one interface that is not
in use by public addresses.   this can happen when we have removed existing interfaces/ip addresses and prevents us from verifying the status of other interfaces

12 years agoRemove logging of spam/errors from the 10.interfrace
Ronnie Sahlberg [Sun, 8 May 2011 20:35:33 +0000 (06:35 +1000)]
Remove logging of spam/errors from the 10.interfrace
script if/when we have for example NATGW configured but no public addresses defined on that interface

CQ S1023378

13 years agoDont call the UPDATE event if both old and new interface is the same.
Ronnie Sahlberg [Wed, 4 May 2011 01:34:17 +0000 (11:34 +1000)]
Dont call the UPDATE event if both old and new interface is the same.

CQ S1018175

13 years agoCleanup of logging messages/spamming
Ronnie Sahlberg [Tue, 3 May 2011 22:54:02 +0000 (08:54 +1000)]
Cleanup of logging messages/spamming

Reduce an infomational message about not performing ip reallocation
from NOTICE(the default) to INFO.
These messages are normal during startup or when stopped/banned when
we will be in recovery mode for a while.

Remove a messager in the loop waiting for initial startup to complete about
the generation being invalid. It is always invalid at this stage before we have
finished initial recovery.

Rate-limit the informational messages for CTDB_WAIT_UNTIL_RECOVERED
so that we only print them once per second for the first 60 seconds and after that only once per 10 minutes.
These messages are normal during startup, but we should not be logging them every second for cases where we will remain in recovery mode during startup for an extended period of time.
Such as if suspended or permabanned.

CQ S1023302

13 years agobonding mode 4 monitoring:
Ronnie Sahlberg [Tue, 12 Apr 2011 21:51:36 +0000 (07:51 +1000)]
bonding mode 4 monitoring:
we can not just check if MII Status is up for bonding mode 4, since the kernel will always report the bond device as UP
even if all cables are disconneccted.

For mode 4, ignore the status of the bond device and instead chek if at least one slave interface is up
when determining if the device is good or bad

13 years agoIf the eventscript is finished but state->ctdb is NULL,
Ronnie Sahlberg [Mon, 11 Apr 2011 19:24:43 +0000 (05:24 +1000)]
If the eventscript is finished but state->ctdb is NULL,
log an error and return.

(Need to find root cause for this is soo too.)

13 years agoNew version 1.2.28
Ronnie Sahlberg [Sun, 10 Apr 2011 21:43:52 +0000 (07:43 +1000)]
New version 1.2.28

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
13 years agoIFACE handling. Assume links are always good on nstartup (they almost always
Ronnie Sahlberg [Sun, 10 Apr 2011 19:56:14 +0000 (05:56 +1000)]
IFACE handling. Assume links are always good on nstartup (they almost always

Simplify the handling of setting the links in the 10.interface eventscript
and remove the optimization to only call setifacelink on state change
to make the code simpler to read.

If a take ip event fails, flag the node as unhealthy.

Add a check to the interface script to check if the interface exists
or if it has been deleted.
So that we can capture and become UNHELTHY if someone deletes an interface
we are using to host public addresses.

13 years agoNATGW: dont set arp_ignore in 11.natgw anymore since we no longer
Ronnie Sahlberg [Wed, 6 Apr 2011 00:26:27 +0000 (10:26 +1000)]
NATGW: dont set arp_ignore in 11.natgw anymore since we no longer
need this for the natgw functionality

13 years agopackaging: remove the dependency to tdbtool and tdbdump from the spec file
Michael Adam [Tue, 5 Apr 2011 11:58:09 +0000 (13:58 +0200)]
packaging: remove the dependency to tdbtool and tdbdump from the spec file

The init script does now check for the availability of tdbdump
and "tdbtool check" and issues warnings if they are not available.
This can remove a dependency loop with building samba RPMs.

13 years agoctdb.init: print a warning when tdbdump is found but tdbtoo or "tdbtool check" is...
Michael Adam [Tue, 5 Apr 2011 11:50:00 +0000 (13:50 +0200)]
ctdb.init: print a warning when tdbdump is found but tdbtoo or "tdbtool check" is not available

13 years agoctdb.init: check for availability of "tdbtool check" and "tdbdump"
Michael Adam [Tue, 5 Apr 2011 11:43:56 +0000 (13:43 +0200)]
ctdb.init: check for availability of "tdbtool check" and "tdbdump"

Print a warning if neither is available.

13 years agoMerge branches '1.2' and '1.2' of 10.1.1.27:/shared/ctdb/ctdb-master into 1.2
Ronnie Sahlberg [Tue, 5 Apr 2011 00:32:02 +0000 (10:32 +1000)]
Merge branches '1.2' and '1.2' of 10.1.1.27:/shared/ctdb/ctdb-master into 1.2

13 years agoctdbd_pid : dont assign the ctdbd_pid until we have finished startup and thus dont...
root [Mon, 4 Apr 2011 23:20:10 +0000 (09:20 +1000)]
ctdbd_pid : dont assign the ctdbd_pid until we have finished startup and thus dont log warnings about 'Handling event ...' until startup has finished.

During startup there are some initial setup and commands done synchronous which means it is semi-normal to have the eventsystem blocked for some situations.

Once startup has finished, all handling should be asynchronous so activate the monitoring of the eventsystems at that stage.

CQ S1021936

13 years agoThis needs more testing first
Ronnie Sahlberg [Mon, 21 Mar 2011 03:28:22 +0000 (14:28 +1100)]
This needs more testing first

Revert "ctdbd: call tdb_reopen_all() in freeze child."

This reverts commit 1e30004f0c63572d721a2c2f53d8a6bccdb5ec45.

13 years agoNew version 1.2.27
Ronnie Sahlberg [Mon, 21 Mar 2011 02:02:31 +0000 (13:02 +1100)]
New version 1.2.27

13 years agoctdbd: call tdb_reopen_all() in freeze child.
Rusty Russell [Mon, 21 Mar 2011 02:37:17 +0000 (13:07 +1030)]
ctdbd: call tdb_reopen_all() in freeze child.

In theory, the ctdbd parent shouldn't be holding any locks, but it's a good
idea to always call tdb_reopen_all() after a fork().

13 years agoctdbd: fix lock held on error ("ctdb_req_dmaster from non-master.")
Rusty Russell [Mon, 21 Mar 2011 02:33:01 +0000 (13:03 +1030)]
ctdbd: fix lock held on error ("ctdb_req_dmaster from non-")

We should release the lock on the record before returning; otherwise the
recovery (which tries to freeze the database) will fail.  Symptoms are as
follows:

ctdbd: pnn 15 dmaster request for new-dmaster 19 from non-master 1 real-dmaster=5 key f049c3c8 dbid 0x6cf2837d gen=1148812532 curgen=1148812532 c->rsn=2 header.rsn=15 reqid=2147483585 keyval=0x4f464e49
ctdbd: ctdb_req_dmaster from non-master. Force a recovery.
...
ctdbd: freeze_lock-1:server/ctdb_freeze.c:55 Failed to lock database registry.tdb

CQ:1022545

13 years agonew version 1.2.26
Ronnie Sahlberg [Sun, 20 Mar 2011 21:51:20 +0000 (08:51 +1100)]
new version 1.2.26

13 years agoDeferred attach: create the timed event as a child context of the da context we want...
Ronnie Sahlberg [Wed, 16 Mar 2011 03:55:58 +0000 (14:55 +1100)]
Deferred attach: create the timed event as a child context of the da context we want to delete.
Othwervise the da context can be timed out and talloc_free()d
but the event for this already freed object will still trigger,
causing a talloc error and shutdown.

CQ S1022515

13 years agoNew version 1.2.25
Ronnie Sahlberg [Sun, 13 Mar 2011 23:12:37 +0000 (10:12 +1100)]
New version 1.2.25

13 years agoIP reallocation. If a public address is already hosted on the node when we startup...
Ronnie Sahlberg [Sun, 13 Mar 2011 22:55:28 +0000 (09:55 +1100)]
IP reallocation. If a public address is already hosted on the node when we startup, log a warning message but do not cause the recovery to fail.

CQ S1022356

13 years agoVacuuming: initialize a variable to avoid a harmless valgrind hit
Ronnie Sahlberg [Sun, 13 Mar 2011 00:30:52 +0000 (11:30 +1100)]
Vacuuming: initialize a variable to avoid a harmless valgrind hit

13 years agoDont allow clients to connect to databases untile we are well past and through
Ronnie Sahlberg [Fri, 11 Mar 2011 22:42:07 +0000 (09:42 +1100)]
Dont allow clients to connect to databases untile we are well past and through
the initial recovery phase

CQ S1022412

13 years agoNew version 1.2.24.
Michael Adam [Mon, 21 Feb 2011 04:55:16 +0000 (15:55 +1100)]
New version 1.2.24.

13 years agovacuum: fix a comment typo
Michael Adam [Fri, 11 Mar 2011 15:05:44 +0000 (16:05 +0100)]
vacuum: fix a comment typo

13 years agovacuum: use insert_record_into_delete_queue in ctdb_local_schedule_for_deletion.
Michael Adam [Fri, 11 Mar 2011 14:57:45 +0000 (15:57 +0100)]
vacuum: use insert_record_into_delete_queue in ctdb_local_schedule_for_deletion.

This is to take advantage of the hash collision handling and logging
also in ctdb_local_schedule_for_deletion.

13 years agovacuum: refactor insert_record_into_delete_queue out of ctdb_control_schedule_for_del...
Michael Adam [Fri, 11 Mar 2011 14:55:52 +0000 (15:55 +0100)]
vacuum: refactor insert_record_into_delete_queue out of ctdb_control_schedule_for_deletion

13 years agovacuum: raise a debug level from INFO to DEBUG
Michael Adam [Fri, 11 Mar 2011 13:57:15 +0000 (14:57 +0100)]
vacuum: raise a debug level from INFO to DEBUG

when overwriting an existing entry in the delete_queue.

13 years agoserver: add a comment explaining the call redirect logic in ctdb_call_send_redirect().
Michael Adam [Wed, 24 Nov 2010 07:01:01 +0000 (08:01 +0100)]
server: add a comment explaining the call redirect logic in ctdb_call_send_redirect().

13 years agoctdb_ltdb_store_server: honour the AUTOMATIC record flag
Michael Adam [Thu, 3 Feb 2011 15:32:23 +0000 (16:32 +0100)]
ctdb_ltdb_store_server: honour the AUTOMATIC record flag

Do not delete empty records that carry this flag but store
them and schedule them for deletetion. Do not store the flag
in the ltdb though, since this is internal only and should not
be visible to the client.

13 years agoltdb: add the CTDB_REC_FLAG_AUTOMATIC to the initial header in ctdb_ltdb_fetch()
Michael Adam [Thu, 3 Feb 2011 15:30:52 +0000 (16:30 +0100)]
ltdb: add the CTDB_REC_FLAG_AUTOMATIC to the initial header in ctdb_ltdb_fetch()

Signals that this record was not created by a client level store.

13 years agoctdb_private.h: add record flag CTDB_REC_FLAG_AUTOMATIC
Michael Adam [Thu, 3 Feb 2011 15:27:42 +0000 (16:27 +0100)]
ctdb_private.h: add record flag CTDB_REC_FLAG_AUTOMATIC

This is a flag that shall signa that a record has been automatically generated by ctdb
and not by an explicit client store operation. This will be used in the ctdb_ltdb_fetch
operation which stores an empty record with default initial header before trying to
migrate the record from the dmaster when the record does not exist in the local tdb.

13 years agoctdb_ltdb_store_server: add ability to send SCHEDULE_FOR_DELETION control to ctdb_ltd...
Michael Adam [Tue, 28 Dec 2010 12:19:22 +0000 (13:19 +0100)]
ctdb_ltdb_store_server: add ability to send SCHEDULE_FOR_DELETION control to ctdb_ltdb_store.

13 years agoctdb_ltdb_store_server: Improve debug message in ctdb_ltdb_store when store or delete...
Michael Adam [Tue, 21 Dec 2010 17:08:11 +0000 (18:08 +0100)]
ctdb_ltdb_store_server: Improve debug message in ctdb_ltdb_store when store or delete fails.

13 years agoctdb_ltdb_store_server: always store the data when ctdb_ltdb_store() is called from...
Michael Adam [Tue, 21 Dec 2010 16:50:52 +0000 (17:50 +0100)]
ctdb_ltdb_store_server: always store the data when ctdb_ltdb_store() is called from the client

This also fixes a segfault since ctdb_lmaster uses the vnn_map.

13 years agoctdb_ltdb_store_server: implement fastpath vacuuming deletion based on VACUUM_MIGRATE...
Michael Adam [Fri, 10 Dec 2010 13:13:50 +0000 (14:13 +0100)]
ctdb_ltdb_store_server: implement fastpath vacuuming deletion based on VACUUM_MIGRATED flag.

When the record has been obtained by the lmaster as part of the vacuuming-fetch
handler and it is empty and never been migrated with data, then such records
are deleted instead of being stored. These records have automatically been
deleted when leaving the former dmaster, so that they vanish for good when
hitting the lmaster in this way. This will reduces the load on traditional
vacuuming.

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

13 years agoctdb_ltdb_store_server: delete an empty record that is safe to delete instead of...
Michael Adam [Fri, 3 Dec 2010 14:29:21 +0000 (15:29 +0100)]
ctdb_ltdb_store_server: delete an empty record that is safe to delete instead of storing locally.

When storing a record that is being migrated off to another node
and has never been migrated with data, then we can safely delete it
from the local tdb instead of storing the record with empty data.

Note: This record is not deleted if we are its lmaster or dmaster.

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

13 years agoserver: Use the ctdb_ltdb_store_server() in the ctdb daemon for non-persistent dbs
Michael Adam [Thu, 30 Dec 2010 17:19:32 +0000 (18:19 +0100)]
server: Use the ctdb_ltdb_store_server() in the ctdb daemon for non-persistent dbs

This is realized by adding a ctdb_ltdb_store_fn function pointer to the db
context and filling it in the attach procedure for non-persistent dbs.

13 years agoserver: create a server variant ctdb_ltdb_store_server() of ctdb_ltdb_store().
Michael Adam [Thu, 30 Dec 2010 16:44:51 +0000 (17:44 +0100)]
server: create a server variant ctdb_ltdb_store_server() of ctdb_ltdb_store().

This is supposed to contain logic for deleting records that are safe
to delete and scheduling records for deletion. It will be called in
server context for non-persistent databases instead of the standard
ctdb_ltdb_store() function.

13 years agodaemon: fill ctdb->ctdbd_pid early
Michael Adam [Tue, 28 Dec 2010 12:14:23 +0000 (13:14 +0100)]
daemon: fill ctdb->ctdbd_pid early

13 years agotest: send SCHEDULE_FOR_DELETION control from randrec test.
Michael Adam [Tue, 21 Dec 2010 14:29:46 +0000 (15:29 +0100)]
test: send SCHEDULE_FOR_DELETION control from randrec test.

13 years agoclient: add accessor function ctdb_header_from_record_handle().
Michael Adam [Tue, 21 Dec 2010 14:29:23 +0000 (15:29 +0100)]
client: add accessor function ctdb_header_from_record_handle().

13 years agovacuum: add ctdb_local_schedule_for_deletion()
Michael Adam [Tue, 28 Dec 2010 12:13:34 +0000 (13:13 +0100)]
vacuum: add ctdb_local_schedule_for_deletion()

13 years agoserver: implement a new control SCHEDULE_FOR_DELETION to fill the delete_queue.
Michael Adam [Tue, 21 Dec 2010 13:25:48 +0000 (14:25 +0100)]
server: implement a new control SCHEDULE_FOR_DELETION to fill the delete_queue.

13 years agocontrol: add a new control opcode CTDB_CONTROL_SCHEDULE_FOR_DELETION
Michael Adam [Tue, 8 Mar 2011 23:57:55 +0000 (00:57 +0100)]
control: add a new control opcode CTDB_CONTROL_SCHEDULE_FOR_DELETION

13 years agocontrol: add macro CHECK_CONTROL_MIN_DATA_SIZE.
Michael Adam [Tue, 8 Mar 2011 23:56:25 +0000 (00:56 +0100)]
control: add macro CHECK_CONTROL_MIN_DATA_SIZE.

This is for the control dispatcher to check whether the input data has
a required minimum size.

13 years agovacuum: lower level of hash collision debug message to INFO
Michael Adam [Thu, 23 Dec 2010 10:54:09 +0000 (11:54 +0100)]
vacuum: lower level of hash collision debug message to INFO