Thursday, May 3, 2018

[389-commits] [389-ds-base] 01/01: Ticket 49631 - same csn generated twice

This is an automated email from the git hooks/post-receive script.

tbordaz pushed a commit to branch 389-ds-base-1.3.6
in repository 389-ds-base.

commit 99ba446fefa64bfc096c6484f6ca0869ae35465c
Author: Thierry Bordaz <tbordaz@redhat.com>
Date: Thu May 3 16:21:59 2018 +0200

Ticket 49631 - same csn generated twice

Bug: if in the csn adjustment the local time was less or equal than the remote time
the sequence number has always been adjusted to remote++
but if the csn time was equal and the local seq number was larger the effect
was a reset of the csn generato.

Fix: correctly handles seqnum in csn adjustment

https://pagure.io/389-ds-base/issue/49631

Reviewed by: Mark, thanks
---
ldap/servers/slapd/csngen.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ldap/servers/slapd/csngen.c b/ldap/servers/slapd/csngen.c
index 2c75c6d..da2d95d 100644
--- a/ldap/servers/slapd/csngen.c
+++ b/ldap/servers/slapd/csngen.c
@@ -375,7 +375,11 @@ int csngen_adjust_time(CSNGen *gen, const CSN* csn)
we have increased the time, we can decrease the seqnum
and still guarantee that any new CSNs generated will be
> any current CSNs we have generated */
- gen->state.seq_num = remote_seqnum + 1;
+ if (remote_seqnum < gen->state.seq_num) {
+ gen->state.seq_num++;
+ } else {
+ gen->state.seq_num = remote_seqnum + 1;
+ }
}
if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) {
slapi_log_err(SLAPI_LOG_REPL, "csngen_adjust_time",

--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
389-commits mailing list -- 389-commits@lists.fedoraproject.org
To unsubscribe send an email to 389-commits-leave@lists.fedoraproject.org

No comments:

Post a Comment