mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
0d4c3e5e3f
This problem was noticed when 2 DCs added the same linked attribute at roughly the same time. One DC would have a later timestamp than the other, so it would re-apply the same link information. However, when it did this, replmd_update_la_val() would incorrectly increment the RMD_VERSION for the attribute. We then end up with one DC having a higher RMD_VERSION than the others (and it doesn't replicate the new RMD_VERSION out). During replication RMD_VERSION is used to determine whether a linked attribute is old (and should be ignored), or whether the information is new and should be applied to the DB. This RMD_VERSION discrepancy could potentially cause a subsequent linked attribute update to be ignored. Normally when a local DB operation is performed, we just pass in a version of zero and get replmd_update_la_val() to increment what's already in the DB. However, we *never* want this to happen during replication - we should always use the version we receive from the peer DC. This patch fixes the problem by separating the API into two: - replmd_update_la_val(): we're updating a linked attribute in the DB, and so as part of this operation we always want to increment the version number (the version no longer need to be passed in because we can work it out from the existing DB entry). - replmd_set_la_val(): we want to set a linked attribute to use the exact values we're telling it, including the version. This is what replication needs to use. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13038 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Sep 26 09:36:48 CEST 2017 on sn-devel-144