Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
76df30a8
Commit
76df30a8
authored
Nov 17, 2020
by
Howard Chu
Committed by
Quanah Gibson-Mount
Nov 19, 2020
Browse files
ITS#9394 syncprov: ignore duplicate sessionlog entries
parent
8f1ec67f
Pipeline
#1266
passed with stage
in 56 minutes and 22 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/overlays/syncprov.c
View file @
76df30a8
...
...
@@ -1594,6 +1594,7 @@ syncprov_add_slog( Operation *op )
syncprov_info_t
*
si
=
on
->
on_bi
.
bi_private
;
sessionlog
*
sl
;
slog_entry
*
se
;
char
uuidstr
[
40
];
int
rc
;
sl
=
si
->
si_logs
;
...
...
@@ -1632,12 +1633,11 @@ syncprov_add_slog( Operation *op )
ldap_pvt_thread_rdwr_wlock
(
&
sl
->
sl_mutex
);
if
(
LogTest
(
LDAP_DEBUG_SYNC
)
)
{
char
uuidstr
[
4
0
]
=
{}
;
uuidstr
[
0
]
=
0
;
if
(
!
BER_BVISEMPTY
(
&
opc
->
suuid
)
)
{
lutil_uuidstr_from_normalized
(
opc
->
suuid
.
bv_val
,
opc
->
suuid
.
bv_len
,
uuidstr
,
40
);
}
Debug
(
LDAP_DEBUG_SYNC
,
"%s syncprov_add_slog: "
"adding csn=%s to sessionlog, uuid=%s
\n
"
,
op
->
o_log_prefix
,
se
->
se_csn
.
bv_val
,
uuidstr
);
...
...
@@ -1653,7 +1653,13 @@ syncprov_add_slog( Operation *op )
}
}
rc
=
tavl_insert
(
&
sl
->
sl_entries
,
se
,
syncprov_sessionlog_cmp
,
avl_dup_error
);
assert
(
rc
==
LDAP_SUCCESS
);
if
(
rc
)
{
Debug
(
LDAP_DEBUG_SYNC
,
"%s syncprov_add_slog: "
"duplicate sessionlog entry ignored: csn=%s, uuid=%s
\n
"
,
op
->
o_log_prefix
,
se
->
se_csn
.
bv_val
,
uuidstr
);
ch_free
(
se
);
goto
leave
;
}
sl
->
sl_num
++
;
if
(
!
sl
->
sl_playing
&&
sl
->
sl_num
>
sl
->
sl_size
)
{
Avlnode
*
edge
=
tavl_end
(
sl
->
sl_entries
,
TAVL_DIR_LEFT
);
...
...
@@ -1685,6 +1691,7 @@ syncprov_add_slog( Operation *op )
sl
->
sl_num
--
;
}
}
leave:
ldap_pvt_thread_rdwr_wunlock
(
&
sl
->
sl_mutex
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment