replmd: Skip redundant source object link checks
authorTim Beale <timbeale@catalyst.net.nz>
Fri, 9 Nov 2018 01:06:16 +0000 (14:06 +1300)
committerTim Beale <timbeale@samba.org>
Tue, 20 Nov 2018 03:48:46 +0000 (04:48 +0100)
commitffe7707675fe91830bea59725e324d029cf2988d
tree88bfcaea68199aef498b5d19cdc399cf665ba3af
parentaf1f24acf783c293d3af6de8e10a64a036d7be38
replmd: Skip redundant source object link checks

We receive the links grouped together by source object. We can save
ourselves some work by not looking up the source object for every single
link (if it's still the same object we're dealing with).

We've already made this change to replmd_process_linked_attribute().
This patch makes the same change to replmd_store_linked_attributes().
(We verify that we know about each link source/target as we receive each
replication chunk. replmd_process_linked_attribute() kicks in later as
the transaction completes).

Note some care is needed to hold onto the tmp_ctx/src_msg across
multiple passes of the for loop.

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