This is an automated email from the git hooks/post-receive script.
lkrispen pushed a commit to branch 389-ds-base-1.3.6
in repository 389-ds-base.
commit 17aee5e8e5eb7b04b51f465ef471d6142c624e48
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Tue Jul 25 13:46:14 2017 +0200
additional fix for 49287: handle readonly replica
check if replicaid is readonly replica id and if ruv element for replicaid can be
found
reviewed by:
---
ldap/servers/plugins/replication/repl5_ruv.c | 65 ++++++++++++++++------------
1 file changed, 37 insertions(+), 28 deletions(-)
diff --git a/ldap/servers/plugins/replication/repl5_ruv.c
b/ldap/servers/plugins/replication/repl5_ruv.c
index d85b428..39449b6 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.c
+++ b/ldap/servers/plugins/replication/repl5_ruv.c
@@ -1707,35 +1707,44 @@ int ruv_cancel_csn_inprogress (void *repl, RUV *ruv, const CSN
*csn, ReplicaId l
goto done;
}
if (csn_primary(repl, csn, prim_csn)) {
- /* the prim csn is cancelled, lets remove all dependent csns */
- /* for the primary replica we can have modifications for two RIDS:
- * - the local RID for direct or internal operations
- * - a remote RID if the primary csn is for a replciated op.
- */
- ReplicaId prim_rid = csn_get_replicaid (csn);
- repl_ruv = ruvGetReplica (ruv, local_rid);
- rc = csnplRemoveAll (repl_ruv->csnpl, prim_csn);
- if (prim_rid != local_rid) {
- repl_ruv = ruvGetReplica (ruv, prim_rid);
- rc = csnplRemoveAll (repl_ruv->csnpl, prim_csn);
- }
+ /* the prim csn is cancelled, lets remove all dependent csns */
+ /* for the primary replica we can have modifications for two RIDS:
+ * - the local RID for direct or internal operations
+ * - a remote RID if the primary csn is for a replciated op.
+ */
+ ReplicaId prim_rid = csn_get_replicaid(csn);
+ repl_ruv = ruvGetReplica(ruv, prim_rid);
+ if (!repl_ruv) {
+ rc = RUV_NOTFOUND;
+ goto done;
+ }
+ rc = csnplRemoveAll(repl_ruv->csnpl, prim_csn);
- for (it=0; it<prim_csn->repl_cnt; it++) {
- repl_it = prim_csn->sec_repl[it];
- replica_lock_replica(repl_it);
- local_rid = replica_get_rid(repl_it);
- if( local_rid != READ_ONLY_REPLICA_ID) {
- Object *ruv_obj = replica_get_ruv (repl_it);
- RUV *ruv_it = object_get_data (ruv_obj);
- repl_ruv = ruvGetReplica (ruv_it, local_rid);
- if (repl_ruv) {
- rc = csnplRemoveAll (repl_ruv->csnpl, prim_csn);
- } else {
- rc = RUV_NOTFOUND;
- }
- }
- replica_unlock_replica(repl_it);
- }
+ if (prim_rid != local_rid && local_rid != READ_ONLY_REPLICA_ID) {
+ repl_ruv = ruvGetReplica(ruv, local_rid);
+ if (!repl_ruv) {
+ rc = RUV_NOTFOUND;
+ goto done;
+ }
+ rc = csnplRemoveAll(repl_ruv->csnpl, prim_csn);
+ }
+
+ for (it = 0; it < prim_csn->repl_cnt; it++) {
+ repl_it = prim_csn->sec_repl[it];
+ replica_lock_replica(repl_it);
+ local_rid = replica_get_rid(repl_it);
+ if (local_rid != READ_ONLY_REPLICA_ID) {
+ Object *ruv_obj = replica_get_ruv(repl_it);
+ RUV *ruv_it = object_get_data(ruv_obj);
+ repl_ruv = ruvGetReplica(ruv_it, local_rid);
+ if (repl_ruv) {
+ rc = csnplRemoveAll(repl_ruv->csnpl, prim_csn);
+ } else {
+ rc = RUV_NOTFOUND;
+ }
+ }
+ replica_unlock_replica(repl_it);
+ }
} else {
rc = csnplRemove (repl_ruv->csnpl, csn);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.