From 822218c0aef28e5ae9e327033f9365f0008f6e7e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 13 May 2005 01:55:29 +0000 Subject: [PATCH] ITS#3703 from HEAD --- CHANGES | 1 + servers/slapd/back-bdb/init.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index ee99ca1d6d..587f308821 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ OpenLDAP 2.2 Change Log OpenLDAP 2.2.27 Engineering + Fixed back-bdb/hdb slapcat checkpoint on close (ITS#3703) Fixed back-ldap/back-meta debug output of NULL strings (ITS#3698) Fixed back-meta sizelimit bug (ITS#3720) Fixed syncrepl runqueue (ITS#3542) diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 49319418b0..a6ca86f631 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -433,12 +433,14 @@ bdb_db_destroy( BackendDB *be ) /* close db environment */ if( bdb->bi_dbenv ) { - /* force a checkpoint */ - rc = TXN_CHECKPOINT( bdb->bi_dbenv, 0, 0, DB_FORCE ); - if( rc != 0 ) { - Debug( LDAP_DEBUG_ANY, - "bdb_db_destroy: txn_checkpoint failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); + /* force a checkpoint, but not if we were ReadOnly. */ + if ( !( slapMode & SLAP_TOOL_READONLY )) { + rc = TXN_CHECKPOINT( bdb->bi_dbenv, 0, 0, DB_FORCE ); + if( rc != 0 ) { + Debug( LDAP_DEBUG_ANY, + "bdb_db_destroy: txn_checkpoint failed: %s (%d)\n", + db_strerror(rc), rc, 0 ); + } } rc = bdb->bi_dbenv->close( bdb->bi_dbenv, 0 ); -- 2.39.2