Tuesday, September 13, 2016

[389-commits] Branch '389-ds-base-1.3.5' - ldap/servers

ldap/servers/plugins/replication/cl5_clcache.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)

New commits:
commit f4301f6be6bbff3c7bb0180a38f6dfd7e31b8558
Author: Thierry Bordaz <tbordaz@redhat.com>
Date: Thu Sep 8 11:38:15 2016 +0200

use a consumer maxcsn only as anchor if supplier is more advanced

diff --git a/ldap/servers/plugins/replication/cl5_clcache.c b/ldap/servers/plugins/replication/cl5_clcache.c
index 74f0fec..ca8b841 100644
--- a/ldap/servers/plugins/replication/cl5_clcache.c
+++ b/ldap/servers/plugins/replication/cl5_clcache.c
@@ -717,24 +717,22 @@ clcache_adjust_anchorcsn ( CLC_Buffer *buf, int *flag )
curr, conmaxcsn);
}

- if (csn_compare (cscb->local_maxcsn, cscb->prev_local_maxcsn) == 0 ||
- csn_compare (cscb->prev_local_maxcsn, buf->buf_current_csn) > 0 ) {
- if (csn_compare (cscb->local_maxcsn, cscb->consumer_maxcsn) > 0 ) {
+ if (csn_compare(cscb->local_maxcsn, cscb->consumer_maxcsn) > 0) {
+ /* We have something to send for this RID */
+
+ if (csn_compare(cscb->local_maxcsn, cscb->prev_local_maxcsn) == 0 ||
+ csn_compare(cscb->prev_local_maxcsn, buf->buf_current_csn) > 0) {
+ /* No new changes or it remains, in the buffer, updates to send */
rid_anchor = buf->buf_current_csn;
- }
- } else {
- /* prev local max csn < csnBuffer AND different from local maxcsn */
- if (cscb->prev_local_maxcsn == NULL) {
+ } else {
+ /* prev local max csn < csnBuffer AND different from local maxcsn */
if (cscb->consumer_maxcsn == NULL) {
/* the consumer hasn't seen changes for this RID */
rid_anchor = cscb->local_mincsn;
rid_flag = DB_SET;
- } else if ( csn_compare (cscb->local_maxcsn, cscb->consumer_maxcsn) > 0 ) {
+ } else {
rid_anchor = cscb->consumer_maxcsn;
}
- } else {
- /* csnPrevMaxSup > 0 */
- rid_anchor = cscb->consumer_maxcsn;
}
}

--
389-commits mailing list
389-commits@lists.fedoraproject.org
https://lists.fedoraproject.org/admin/lists/389-commits@lists.fedoraproject.org

No comments:

Post a Comment