From: Howard Chu Date: Tue, 13 Sep 2011 08:28:37 +0000 (-0700) Subject: mdb_db_close() should not force env_sync in quick mode X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=65b5ff2de31d73565fe8bc84ff0c034677226e29;p=openldap mdb_db_close() should not force env_sync in quick mode --- 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 ); + } } }