From a2e1b9b5452c0de4b54f0debbf03393555bfc80f Mon Sep 17 00:00:00 2001 From: "Ted C. Cheng" Date: Wed, 18 Sep 2013 15:33:17 -0700 Subject: [PATCH] ITS#7699 fixed one dds start-up assertion failure --- servers/slapd/overlays/dds.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/servers/slapd/overlays/dds.c b/servers/slapd/overlays/dds.c index 900c6fd3e3..84df7dec7d 100644 --- a/servers/slapd/overlays/dds.c +++ b/servers/slapd/overlays/dds.c @@ -1733,8 +1733,15 @@ dds_db_open( di->di_suffix = be->be_suffix; di->di_nsuffix = be->be_nsuffix; - /* ... so that count, if required, is accurate */ - if ( di->di_max_dynamicObjects > 0 ) { + /* count the dynamic objects first */ + rc = dds_count( thrctx, be ); + if ( rc != LDAP_SUCCESS ) { + rc = 1; + goto done; + } + + /* ... if there are dynamic objects, delete those expired */ + if ( di->di_num_dynamicObjects > 0 ) { /* force deletion of expired entries... */ be->bd_info = (BackendInfo *)on->on_info; rc = dds_expire( thrctx, di ); @@ -1743,12 +1750,6 @@ dds_db_open( rc = 1; goto done; } - - rc = dds_count( thrctx, be ); - if ( rc != LDAP_SUCCESS ) { - rc = 1; - goto done; - } } /* start expire task */ -- 2.39.5