On 05/06/2015 01:54 PM, Martin Babinsky wrote:
The attached patch tries to fix https://fedorahosted.org/freeipa/ticket/4378

After discussion with Thierry we concluded that while this issue is more complex than it seems, the transition from REPLACE to DEL/ADD operations when updating nsDS5ReplicaId should suffice for this ticket.

Hello Martin,

Few comments, you are using MOD_DEL 'replicaID' with None value. So this is going to delete all previous values and it should be equivalent to a MOD_REPL. I was thinking you wanted to retrieve the id_value and call MOD_DEL 'replicaID' <current_value>. So that if by the time you fetched the replicaId, an other replica updated the replicaId, the MOD_DEL/MOD_ADD would fail and you need a new iteration.

If replicaId was multi-valued and you want to make it single valued, you may want to do create a more complex MOD (e.g. (ldap.MOD_DELETE, 'nsDS5ReplicaId', str(value1), (ldap.MOD_DELETE, 'nsDS5ReplicaId', str(value2)...)

If it is updating successfully do you want to return 'retval' or 'retval+1' ?

If several replicas try to update the replicaId of the master and the current replicaId is 1000.
Replica1 successfully updates the replicaId and gets 1001 as the new value.
Replica2 successfully updates the replicaId and gets 1002.
The final value on master will be 1002, but replica1 will assum it is 1001. Is it a problem ?

Manage your subscription for the Freeipa-devel mailing list:
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to