replmd: Avoid redundant dsdb_get_deleted_objects_dn() checks
authorTim Beale <timbeale@catalyst.net.nz>
Mon, 12 Nov 2018 02:49:28 +0000 (15:49 +1300)
committerTim Beale <timbeale@samba.org>
Wed, 21 Nov 2018 00:51:11 +0000 (01:51 +0100)
commit05147d25e7b4a9343378c59927f443b723606960
tree8eac455abe4b87e61faf8baf2add84cc383ccc59
parent698cf271f439c252c77f67fb88b09c9dcc84139d
replmd: Avoid redundant dsdb_get_deleted_objects_dn() checks

Quite a bit of time was spent in dsdb_get_deleted_objects_dn()
processing during either a join (~9%) or a full-sync (~28%).

The problem is we're *always* doing the dsdb_get_deleted_objects_dn()
call for each object, regardless of whether it's actually deleted or
not. i.e. we were doing an expensive query and a lot of the time just
ignoring the query result.

If it's not a deleted object we're dealing with, we can just return
early and skip the unnecessary processing.

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