From 3604c48b86e6b6feea63f99bebfecaa346d2bf59 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Wed, 6 Oct 2010 23:27:47 -0700 Subject: Bug 640854 - changelog db: _cl5WriteOperation: failed to write entry; db error - 22 Invalid argument https://bugzilla.redhat.com/show_bug.cgi?id=640854 Description: DBENV open flags is used to determine the DB_OPEN mode whether to set DB_AUTO_COMMIT or not. The info was eliminated in the change made for "Bug 633168 - Share backend dbEnv with the replication changelog". This patch picks up the backend dbenv openflags and uses it for the changelog DB_OPEN. --- ldap/servers/plugins/replication/cl5_api.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ldap/servers/plugins/replication/cl5_api.c') diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c index 79677416..b7c72292 100644 --- a/ldap/servers/plugins/replication/cl5_api.c +++ b/ldap/servers/plugins/replication/cl5_api.c @@ -1799,6 +1799,7 @@ static int _cl5AppInit (PRBool *didRecovery) int rc = -1; /* initialize to failure */ DB_ENV *dbEnv = NULL; size_t pagesize = 0; + int openflags = 0; char *cookie = NULL; Slapi_Backend *be = slapi_get_first_backend(&cookie); while (be) { @@ -1807,7 +1808,11 @@ static int _cl5AppInit (PRBool *didRecovery) rc = slapi_back_get_info(be, BACK_INFO_INDEXPAGESIZE, (void **)&pagesize); if ((LDAP_SUCCESS == rc) && pagesize) { - break; /* Successfully fetched */ + rc = slapi_back_get_info(be, + BACK_INFO_DBENV_OPENFLAGS, (void **)&openflags); + if (LDAP_SUCCESS == rc) { + break; /* Successfully fetched */ + } } } be = slapi_get_next_backend(cookie); @@ -1819,6 +1824,7 @@ static int _cl5AppInit (PRBool *didRecovery) slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5AppInit: fetched backend dbEnv (%p)\n", dbEnv); s_cl5Desc.dbEnv = dbEnv; + s_cl5Desc.dbEnvOpenFlags = openflags; s_cl5Desc.dbConfig.pageSize = pagesize; return CL5_SUCCESS; } -- cgit