Преглед изворни кода

Ticket 48325 - Replica promotion leaves RUV out of order

Bug Description:  When promoting a consumer to a master the new RUV
                  element is appended to the RUV.  However, when trying
                  to replicate from the newly promoted replica the
                  remote replica checks the first element in the RUV
                  and sees that its the same replica ID, and aborts the
                  replication session.  Essentailly this completely
                  breaks replication between the two servers, and can
                  actually corrupt other RUVs on other replicas.

Fix Description:  When promoting a replica to a master, reorder the RUV
                  so that it is the first in the list.

https://fedorahosted.org/389/ticket/48325

Reviewed by: nhosoi(Thanks!)
Mark Reynolds пре 10 година
родитељ
комит
b896840d27
1 измењених фајлова са 1 додато и 0 уклоњено
  1. 1 0
      ldap/servers/plugins/replication/repl5_replica_config.c

+ 1 - 0
ldap/servers/plugins/replication/repl5_replica_config.c

@@ -1003,6 +1003,7 @@ replica_config_change_type_and_id (Replica *r, const char *new_type,
                 csngen_rewrite_rid(gen, rid);
                 if(purl && type == REPLICA_TYPE_UPDATABLE){
                     ruv_add_replica(ruv, rid, purl);
+                    ruv_move_local_supplier_to_first(ruv, rid);
                     replica_reset_csn_pl(r);
                 }
                 ruv_delete_replica(ruv, oldrid);