]> git.sur5r.net Git - openldap/commitdiff
ITS#7699 fixed one dds start-up assertion failure
authorTed C. Cheng <tedcheng@symas.com>
Wed, 18 Sep 2013 22:33:17 +0000 (15:33 -0700)
committerHoward Chu <hyc@openldap.org>
Sat, 12 Oct 2013 22:23:19 +0000 (15:23 -0700)
servers/slapd/overlays/dds.c

index 900c6fd3e356a3dd633af0057995774544403350..84df7dec7d3bc75dcb57bb92b44973d2a69fa8f5 100644 (file)
@@ -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 */