mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05: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
1 changed files with 18 additions and 0 deletions
|
|
@ -58,6 +58,8 @@ static MDB_cursor *mcp = NULL, *mcd = NULL;
|
||||||
static MDB_val key, data;
|
static MDB_val key, data;
|
||||||
static ID previd = NOID;
|
static ID previd = NOID;
|
||||||
|
|
||||||
|
static int reindexing;
|
||||||
|
|
||||||
typedef struct dn_id {
|
typedef struct dn_id {
|
||||||
ID id;
|
ID id;
|
||||||
struct berval dn;
|
struct berval dn;
|
||||||
|
|
@ -223,6 +225,20 @@ int mdb_tool_entry_close(
|
||||||
}
|
}
|
||||||
mdb_tool_txn = NULL;
|
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 ) {
|
if( txi ) {
|
||||||
int rc;
|
int rc;
|
||||||
if (( rc = mdb_txn_commit( txi ))) {
|
if (( rc = mdb_txn_commit( txi ))) {
|
||||||
|
|
@ -841,6 +857,8 @@ int mdb_tool_entry_reindex(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reindexing = 1;
|
||||||
|
|
||||||
/* Check for explicit list of attrs to index */
|
/* Check for explicit list of attrs to index */
|
||||||
if ( adv ) {
|
if ( adv ) {
|
||||||
int i, j, n;
|
int i, j, n;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue