replmd: Cache recycle-bin state to avoid DB lookup
authorTim Beale <timbeale@catalyst.net.nz>
Fri, 26 Oct 2018 02:04:42 +0000 (15:04 +1300)
committerTim Beale <timbeale@samba.org>
Tue, 20 Nov 2018 07:40:16 +0000 (08:40 +0100)
commit8b47443b871c8cfcae60f4d098ff27e561ee6cd4
tree4c77e4303fe5d127810c976bfb0bbdaa813aebae
parent062ac12a31010436953ebe0b31351f7ec0844415
replmd: Cache recycle-bin state to avoid DB lookup

By caching the recycle-bin state we can save ~6% of the join time.

Checking whether the recycle-bin is enabled involves an underlying DSDB
search. We do this ~4 times for each link we replicate (twice for the
link source and target). By caching the recycle-bin's state over the
duration of the replication, we can save 1000s of unnecessary DB
searches.

With 5K users this makes the join time ~5 secs faster.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Tim Beale <timbeale@samba.org>
Autobuild-Date(master): Tue Nov 20 08:40:16 CET 2018 on sn-devel-144
source4/dsdb/samdb/ldb_modules/repl_meta_data.c