s3:rpc_client: optimize the netlogon_creds_cli.tdb for read-only access
authorMichael Adam <obnox@samba.org>
Mon, 27 Jan 2014 15:21:14 +0000 (16:21 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 7 Feb 2014 15:06:06 +0000 (16:06 +0100)
Usually a record in this DB will be written once and then read
many times by winbindd processes on multiple nodes (when run in
a cluster). In order not to introduce a big performance penalty
with the increased correctness achieved by storing the netlogon
creds, in a cluster setup, we should activate ctdb's read only
record copies on this db.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/rpc_client/cli_netlogon.c

index 9e3c1bd30e6bd411529a7aa6ba1b8300702eb0e2..746c7b6480f30d4765e9374401f532c9e3bdb061 100644 (file)
@@ -70,7 +70,7 @@ NTSTATUS rpccli_pre_open_netlogon_creds(void)
        global_db = db_open(talloc_autofree_context(), fname,
                            0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
                            O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2,
-                           DBWRAP_FLAG_NONE);
+                           DBWRAP_FLAG_OPTIMIZE_READONLY_ACCESS);
        if (global_db == NULL) {
                TALLOC_FREE(frame);
                return NT_STATUS_NO_MEMORY;