mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-23 14:09:39 +08:00
ITS#10047 back-mdb: delete idxckp table after slapindex
Could do it when beginning too, either way an interrupted slapindex must be rerun completely.
This commit is contained in:
parent
559878328d
commit
3271bfa1ea
@ -58,6 +58,8 @@ static MDB_cursor *mcp = NULL, *mcd = NULL;
|
||||
static MDB_val key, data;
|
||||
static ID previd = NOID;
|
||||
|
||||
static int reindexing;
|
||||
|
||||
typedef struct dn_id {
|
||||
ID id;
|
||||
struct berval dn;
|
||||
@ -223,6 +225,20 @@ int mdb_tool_entry_close(
|
||||
}
|
||||
mdb_tool_txn = NULL;
|
||||
}
|
||||
if( reindexing ) {
|
||||
struct mdb_info *mdb = be->be_private;
|
||||
if ( !txi ) {
|
||||
int rc = mdb_txn_begin( mdb->mi_dbenv, NULL, 0, &txi );
|
||||
if( rc != 0 ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"=> " LDAP_XSTRING(mdb_tool_entry_close) ": database %s: "
|
||||
"txn_begin failed: %s (%d)\n",
|
||||
be->be_suffix[0].bv_val, mdb_strerror(rc), rc );
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
mdb_drop( txi, mdb->mi_idxckp, 0 );
|
||||
}
|
||||
if( txi ) {
|
||||
int rc;
|
||||
if (( rc = mdb_txn_commit( txi ))) {
|
||||
@ -841,6 +857,8 @@ int mdb_tool_entry_reindex(
|
||||
return 0;
|
||||
}
|
||||
|
||||
reindexing = 1;
|
||||
|
||||
/* Check for explicit list of attrs to index */
|
||||
if ( adv ) {
|
||||
int i, j, n;
|
||||
|
Loading…
Reference in New Issue
Block a user