From 65b5ff2de31d73565fe8bc84ff0c034677226e29 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 13 Sep 2011 01:28:37 -0700 Subject: [PATCH] mdb_db_close() should not force env_sync in quick mode --- servers/slapd/back-mdb/init.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/servers/slapd/back-mdb/init.c b/servers/slapd/back-mdb/init.c index 7b2fb30044..75d4cdd01e 100644 --- a/servers/slapd/back-mdb/init.c +++ b/servers/slapd/back-mdb/init.c @@ -279,13 +279,17 @@ mdb_db_close( BackendDB *be, ConfigReply *cr ) mdb_txn_abort( txn ); - /* force a sync */ - rc = mdb_env_sync( mdb->mi_dbenv, 1 ); - if( rc != 0 ) { - Debug( LDAP_DEBUG_ANY, - "mdb_db_close: database \"%s\": " - "mdb_env_sync failed: %s (%d).\n", - be->be_suffix[0].bv_val, mdb_strerror(rc), rc ); + /* force a sync, but not if we were ReadOnly, + * and not in Quick mode. + */ + if (!(slapMode & (SLAP_TOOL_QUICK|SLAP_TOOL_READONLY))) { + rc = mdb_env_sync( mdb->mi_dbenv, 1 ); + if( rc != 0 ) { + Debug( LDAP_DEBUG_ANY, + "mdb_db_close: database \"%s\": " + "mdb_env_sync failed: %s (%d).\n", + be->be_suffix[0].bv_val, mdb_strerror(rc), rc ); + } } } -- 2.39.5