1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

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>
This commit is contained in:
Amitay Isaacs 2015-06-29 14:56:53 +10:00 committed by Amitay Isaacs
parent b04c48d2f5
commit 951431910d
3 changed files with 1895 additions and 0 deletions

View File

@ -197,6 +197,7 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/ctdb
%{_bindir}/ctdb_lock_helper
%{_bindir}/ctdb_event_helper
%{_bindir}/ctdb_recovery_helper
%{_bindir}/smnotify
%{_bindir}/ping_pong
%{_bindir}/ltdbtool

File diff suppressed because it is too large Load Diff

View File

@ -425,6 +425,12 @@ def build(bld):
deps='samba-util ctdb-common-util replace tdb',
install_path='${BINDIR}')
bld.SAMBA_BINARY('ctdb_recovery_helper',
source='server/ctdb_recovery_helper.c',
deps='''ctdb-client2 ctdb-protocol ctdb-util
samba-util replace tdb''',
install_path='${BINDIR}')
bld.SAMBA_GENERATOR('ctdb-smnotify-h',
source='utils/smnotify/smnotify.x',
target='utils/smnotify/smnotify.h',