1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

ctdb: hold transaction locks during freeze, mark during recover.

Make the ctdb parent "mark" the transaction lock once the child process
has frozen/locked the entire database.
This stops the ctdb daemon from using  a blocking fcntl() locking on the tdb during the
read traverse during recovery.

CQ 1021388

(This used to be ctdb commit 52ee2b3ce822344d0f55ac040fe25f6ec5c0d7c2)
This commit is contained in:
Ronnie Sahlberg 2011-01-18 13:33:24 +11:00
parent e68b97ffc9
commit 3f819741ad

View File

@ -57,7 +57,11 @@ static int ctdb_lock_all_databases_mark(struct ctdb_context *ctdb, uint32_t prio
if (strstr(ctdb_db->db_name, "notify") != NULL) {
continue;
}
if (tdb_transaction_write_lock_mark(ctdb_db->ltdb->tdb) != 0) {
return -1;
}
if (tdb_lockall_mark(ctdb_db->ltdb->tdb) != 0) {
tdb_transaction_write_lock_unmark(ctdb_db->ltdb->tdb);
return -1;
}
}
@ -68,7 +72,11 @@ static int ctdb_lock_all_databases_mark(struct ctdb_context *ctdb, uint32_t prio
if (strstr(ctdb_db->db_name, "notify") == NULL) {
continue;
}
if (tdb_transaction_write_lock_mark(ctdb_db->ltdb->tdb) != 0) {
return -1;
}
if (tdb_lockall_mark(ctdb_db->ltdb->tdb) != 0) {
tdb_transaction_write_lock_unmark(ctdb_db->ltdb->tdb);
return -1;
}
}
@ -95,6 +103,7 @@ static int ctdb_lock_all_databases_unmark(struct ctdb_context *ctdb, uint32_t pr
if (ctdb_db->priority != priority) {
continue;
}
tdb_transaction_write_lock_unmark(ctdb_db->ltdb->tdb);
if (tdb_lockall_unmark(ctdb_db->ltdb->tdb) != 0) {
return -1;
}