From 5bd8725aacaf0bc98c94c99b6caa2d103cba3c63 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 14 Mar 2009 01:04:55 +0000 Subject: [PATCH] ITS#5988 avoid redundant slap_graduate_commit_csn calls --- servers/slapd/syncrepl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 76b9ec1a97..01b4cf6b50 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -2241,6 +2241,7 @@ retry_add:; si->si_ridtxt, rs_add.sr_err, 0 ); break; } + syncCSN = NULL; op->o_bd = be; goto done; } @@ -2440,7 +2441,9 @@ retry_add:; op->o_req_dn = entry->e_name; op->o_req_ndn = entry->e_nname; /* Use CSN on the modify */ - if ( syncCSN && !just_rename ) + if ( just_rename ) + syncCSN = NULL; + else if ( syncCSN ) slap_queue_csn( op, syncCSN ); } if ( dni.mods ) { @@ -2460,11 +2463,16 @@ retry_add:; "syncrepl_entry: %s be_modify failed (%d)\n", si->si_ridtxt, rs_modify.sr_err, 0 ); } + syncCSN = NULL; op->o_bd = be; } else if ( !dni.renamed ) { Debug( LDAP_DEBUG_SYNC, "syncrepl_entry: %s entry unchanged, ignored (%s)\n", si->si_ridtxt, op->o_req_dn.bv_val, 0 ); + if ( syncCSN ) { + slap_graduate_commit_csn( op ); + syncCSN = NULL; + } } goto done; case LDAP_SYNC_DELETE : @@ -2493,6 +2501,7 @@ retry_add:; break; } } + syncCSN = NULL; op->o_bd = be; } goto done; -- 2.39.5