diff options
-rw-r--r-- | ldap/servers/slapd/back-ldbm/dblayer.c | 5 | ||||
-rw-r--r-- | ldap/servers/slapd/back-ldbm/ldbm_instance_config.c | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c index ae66be60..598b9976 100644 --- a/ldap/servers/slapd/back-ldbm/dblayer.c +++ b/ldap/servers/slapd/back-ldbm/dblayer.c @@ -3154,7 +3154,7 @@ int dblayer_erase_index_file_ex(backend *be, struct attrinfo *a, int rc = 0; DB *db = 0; - if (NULL == pEnv) /* index file does not exist */ + if (NULL == pEnv) /* db does not exist */ return rc; /* Added for bug 600401. Somehow the checkpoint thread deadlocked on @@ -3165,7 +3165,8 @@ int dblayer_erase_index_file_ex(backend *be, struct attrinfo *a, dblayer_force_checkpoint(li); } - if (dblayer_get_index_file(be, a, &db, DBOPEN_CREATE) == 0) { + if (0 == dblayer_get_index_file(be, a, &db, 0 /* Don't create an index file + if it does not exist. */)) { /* first, remove the file handle for this index, if we have it open */ PR_Lock(inst->inst_handle_list_mutex); if (a->ai_dblayer) { diff --git a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c index a6b11668..a33bb786 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c @@ -1109,7 +1109,18 @@ ldbm_instance_post_delete_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* } PR_CloseDir(dirhandle); } - PR_RmDir(inst_dirp); + /* + * When a backend was removed, the db instance directory + * was removed as well (See also bz463774). + * In case DB_RECOVER_FATAL is set in the DB open after + * the removal (e.g., in restore), the logs in the transaction + * logs are replayed and compared with the contents of the DB + * files. At that time, if the db instance directory does not + * exist, libdb returns FATAL error. To prevent the problem, + * we have to leave the empty directory. (bz597375) + * + * PR_RmDir(inst_dirp); + */ } /* non-null dirhandle */ if (inst_dirp != inst_dir) { slapi_ch_free_string(&inst_dirp); |