repl_md: Avoid dropping cross-partition links
commit98848142cde51d4b280a6fb5cd95dc4bd2471e17
authorTim Beale <timbeale@catalyst.net.nz>
Mon, 1 Jul 2019 01:41:14 +0000 (1 13:41 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 2 Jul 2019 04:21:36 +0000 (2 04:21 +0000)
tree3bad34ed8f460aef83b0179578b1e3a59781b2c4
parentdba9987bf500f82fbbcda1cd78c543a87f90cec5
repl_md: Avoid dropping cross-partition links

Cross-partition links could still be dropped if GET_TGT was already
previously set for the replication.

This was due to a slight error in the order of logic. We never want to
ignore cross-partition links (regardless of whether the TARGETS_UPTODATE
/GET_TGT flag is set). We should only be returning early in the
GET_TGT case if the objects are both in the same partition.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14022
RN: When the AD domain contained a linked attribute that spanned
partitions, DRS replication could drop the link. This dropped link could
then result in subtle differences in behaviour between DCs, as some DCs
would have the link and others wouldn't. When this issue occurred, the
dropped link would be logged in a warning message:
 "<target-dn> is Unknown but up to date. Ignoring link from <source-dn>"
This issue would not always occur - it depended a lot on the database
contents. Typically, it would only potentially occur when joining a new
DC to the domain (doing an ldapcmp after the join would also highlight
the problem, if it occurred). This issue has now been resolved.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/knownfail.d/getncchanges
source4/dsdb/samdb/ldb_modules/repl_meta_data.c