Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Barchiesi
OpenLDAP
Commits
e0929d6a
Commit
e0929d6a
authored
13 years ago
by
Howard Chu
Committed by
Quanah Gibson-Mount
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Turn off tool IDL caching
Well, just like in back-bdb in 2005, it only slowed things down on larger LDIFs.
parent
c7e50ed2
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
servers/slapd/back-mdb/idl.c
+5
-1
5 additions, 1 deletion
servers/slapd/back-mdb/idl.c
servers/slapd/back-mdb/index.c
+2
-0
2 additions, 0 deletions
servers/slapd/back-mdb/index.c
servers/slapd/back-mdb/tools.c
+21
-10
21 additions, 10 deletions
servers/slapd/back-mdb/tools.c
with
28 additions
and
11 deletions
servers/slapd/back-mdb/idl.c
+
5
−
1
View file @
e0929d6a
...
...
@@ -399,6 +399,7 @@ mdb_idl_insert_keys(
ID
lo
,
hi
,
*
i
;
char
*
err
;
int
rc
,
k
;
unsigned
int
flag
=
MDB_NODUPDATA
;
{
char
buf
[
16
];
...
...
@@ -409,6 +410,9 @@ mdb_idl_insert_keys(
assert
(
id
!=
NOID
);
if
(
slapMode
&
SLAP_TOOL_QUICK
)
flag
|=
MDB_APPEND
;
for
(
k
=
0
;
keys
[
k
].
bv_val
;
k
++
)
{
/* Fetch the first data item for this key, to see if it
* exists and if it's a range.
...
...
@@ -501,7 +505,7 @@ mdb_idl_insert_keys(
}
else
if
(
rc
==
MDB_NOTFOUND
)
{
put1:
data
.
mv_data
=
&
id
;
data
.
mv_size
=
sizeof
(
ID
);
rc
=
mdb_cursor_put
(
cursor
,
&
key
,
&
data
,
MDB_NODUPDATA
);
rc
=
mdb_cursor_put
(
cursor
,
&
key
,
&
data
,
flag
);
/* Don't worry if it's already there */
if
(
rc
==
MDB_KEYEXIST
)
rc
=
0
;
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-mdb/index.c
+
2
−
0
View file @
e0929d6a
...
...
@@ -185,9 +185,11 @@ static int indexer(
if
(
rc
)
goto
done
;
if
(
opid
==
SLAP_INDEX_ADD_OP
)
{
#ifdef MDB_TOOL_IDL_CACHING
if
(
slapMode
&
SLAP_TOOL_QUICK
)
keyfunc
=
mdb_tool_idl_add
;
else
#endif
keyfunc
=
mdb_idl_insert_keys
;
}
else
keyfunc
=
mdb_idl_delete_keys
;
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-mdb/tools.c
+
21
−
10
View file @
e0929d6a
...
...
@@ -24,6 +24,7 @@
#include
"back-mdb.h"
#include
"idl.h"
#ifdef MDB_TOOL_IDL_CACHING
static
int
mdb_tool_idl_flush
(
BackendDB
*
be
,
MDB_txn
*
txn
);
#define IDBLOCK 1024
...
...
@@ -47,6 +48,11 @@ typedef struct mdb_tool_idl_cache {
static
mdb_tool_idl_cache_entry
*
mdb_tool_idl_free_list
;
static
Avlnode
*
mdb_tool_roots
[
MDB_INDICES
];
#define MDB_TOOL_IDL_FLUSH(be, txn) mdb_tool_idl_flush(be, txn)
#else
#define MDB_TOOL_IDL_FLUSH(be, txn)
#endif
/* MDB_TOOL_IDL_CACHING */
static
MDB_txn
*
txn
=
NULL
,
*
txi
=
NULL
;
static
MDB_cursor
*
cursor
=
NULL
,
*
idcursor
=
NULL
;
static
MDB_val
key
,
data
;
...
...
@@ -161,7 +167,7 @@ int mdb_tool_entry_close(
mdb_cursor_close
(
cursor
);
cursor
=
NULL
;
}
mdb_tool_idl_flush
(
be
,
txn
);
MDB_TOOL_IDL_FLUSH
(
be
,
txn
);
if
(
txn
)
{
if
(
mdb_txn_commit
(
txn
))
return
-
1
;
...
...
@@ -618,7 +624,7 @@ done:
if
(
rc
==
0
)
{
mdb_writes
++
;
if
(
mdb_writes
>=
mdb_writes_per_commit
)
{
mdb_tool_idl_flush
(
be
,
txn
);
MDB_TOOL_IDL_FLUSH
(
be
,
txn
);
rc
=
mdb_txn_commit
(
txn
);
mdb_writes
=
0
;
txn
=
NULL
;
...
...
@@ -773,7 +779,7 @@ done:
if
(
rc
==
0
)
{
mdb_writes
++
;
if
(
mdb_writes
>=
mdb_writes_per_commit
)
{
mdb_tool_idl_flush
(
be
,
txi
);
MDB_TOOL_IDL_FLUSH
(
be
,
txi
);
rc
=
mdb_txn_commit
(
txi
);
if
(
rc
!=
0
)
{
Debug
(
LDAP_DEBUG_ANY
,
...
...
@@ -914,6 +920,7 @@ mdb_tool_index_task( void *ctx, void *ptr )
}
#endif
#ifdef MDB_TOOL_IDL_CACHING
static
int
mdb_tool_idl_cmp
(
const
void
*
v1
,
const
void
*
v2
)
{
...
...
@@ -1044,13 +1051,14 @@ mdb_tool_idl_flush( BackendDB *be, MDB_txn *txn )
{
struct
mdb_info
*
mdb
=
(
struct
mdb_info
*
)
be
->
be_private
;
int
rc
=
0
;
unsigned
int
i
;
for
(
i
=
MDB_NDB
;
i
<
mdb
->
mi_nattrs
+
MDB_NDB
;
i
++
)
{
if
(
!
mdb_tool_roots
[
i
]
)
continue
;
rc
=
mdb_tool_idl_flush_db
(
txn
,
i
,
mdb_tool_roots
[
i
]
);
tavl_free
(
mdb_tool_roots
[
i
],
NULL
);
mdb_tool_roots
[
i
]
=
NULL
;
unsigned
int
i
,
dbi
;
for
(
i
=
0
;
i
<
mdb
->
mi_nattrs
;
i
++
)
{
dbi
=
mdb
->
mi_attrs
[
i
]
->
ai_dbi
;
if
(
!
mdb_tool_roots
[
dbi
]
)
continue
;
rc
=
mdb_tool_idl_flush_db
(
txn
,
dbi
,
mdb_tool_roots
[
dbi
]
);
tavl_free
(
mdb_tool_roots
[
dbi
],
NULL
);
mdb_tool_roots
[
dbi
]
=
NULL
;
if
(
rc
)
break
;
}
...
...
@@ -1146,6 +1154,8 @@ int mdb_tool_idl_add(
ic
->
tail
->
next
=
ice
;
}
ic
->
tail
=
ice
;
if
(
lcount
)
ice
->
ids
[
lcount
-
1
]
=
0
;
if
(
!
ic
->
count
)
ic
->
first
=
id
;
}
...
...
@@ -1157,3 +1167,4 @@ int mdb_tool_idl_add(
return
0
;
}
#endif
/* MDB_TOOL_IDL_CACHING */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment