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

ctdb-locking: Add new tunable LockProcessesPerDB

This allows to change the maximum number of lock processes that can
be active.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Amitay Isaacs 2014-07-15 12:13:53 +10:00 committed by Volker Lendecke
parent e0d5459451
commit 59d45ea307
3 changed files with 3 additions and 4 deletions

View File

@ -127,6 +127,7 @@ struct ctdb_tunable {
uint32_t no_ip_host_on_all_disabled;
uint32_t samba3_hack;
uint32_t mutex_enabled;
uint32_t lock_processes_per_db;
};
/*

View File

@ -43,9 +43,6 @@
* auto_mark - whether to mark/unmark DBs in before/after callback
*/
/* FIXME: Add a tunable max_lock_processes_per_db */
#define MAX_LOCK_PROCESSES_PER_DB (100)
enum lock_type {
LOCK_RECORD,
LOCK_DB,
@ -700,7 +697,7 @@ static void ctdb_lock_schedule(struct ctdb_context *ctdb)
talloc_free(lock_ctx);
} else {
if (lock_ctx->ctdb_db == NULL ||
lock_ctx->ctdb_db->lock_num_current < MAX_LOCK_PROCESSES_PER_DB) {
lock_ctx->ctdb_db->lock_num_current < ctdb->tunable.lock_processes_per_db) {
/* Found a lock context with lock requests */
break;
}

View File

@ -83,6 +83,7 @@ static const struct {
{ "NoIPHostOnAllDisabled", 0, offsetof(struct ctdb_tunable, no_ip_host_on_all_disabled), false },
{ "Samba3AvoidDeadlocks", 0, offsetof(struct ctdb_tunable, samba3_hack), false },
{ "TDBMutexEnabled", 0, offsetof(struct ctdb_tunable, mutex_enabled), false },
{ "LockProcessesPerDB", 100, offsetof(struct ctdb_tunable, lock_processes_per_db), false },
};
/*