ctdb-recoverd: Add parallel database recovery helper
authorAmitay Isaacs <amitay@gmail.com>
Mon, 29 Jun 2015 04:56:53 +0000 (14:56 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 7 Oct 2015 12:53:29 +0000 (14:53 +0200)
commit951431910dc6d00815c19e087bc2546b1daa591b
treed844d3a3893dbf201f7d4177266f3b267452af9c
parentb04c48d2f5f0a5e64ccf75e7773b880c521ffef3
ctdb-recoverd: Add parallel database recovery helper

Parallel database recovery fixes the samba/ctdb deadlock during recovery.

Many times samba tries to grab multiple record locks in sequence.
Consider a case when samba is already holding a record lock on a database
and tries to get a record lock on second database.  If the second record
is not available on the local node, samba asks ctdb to migrate the record.
If recovery occurs at this time (e.g. node becoming inactive), ctdb
cannot freeze all the databases since samba is already holding a lock
and waiting for the second lock.  CTDB can process the second record
request only after the recovery is complete, thus causing a deadlock.

In parallel database recovery, each database is frozen and recovered
independent from each other.  So as soon as the second database is
recovered, CTDB will resend all the pending migration requests and Samba
can get the second lock.  Once samba releases both the locks, ctdb can
freeze the first database and recover it completing recovery process.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/packaging/RPM/ctdb.spec.in
ctdb/server/ctdb_recovery_helper.c [new file with mode: 0644]
ctdb/wscript