The code to check for the 'repsFrom' highwatermark didn't have any
effect because the hwm variable was overwritten (initialized to all
zeroes) further down.
Using a zero HWM probably wouldn't have impacted functionality because
we were still correctly using the uptodatenessvector, which should
avoid a full replication.
This was introduced in commit
e2ba17d26af42974e5d, presumably by
accident.
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
req8.naming_context = drsuapi.DsReplicaObjectIdentifier()
req8.naming_context.dn = dn
+ # Default to a full replication if we don't find an upToDatenessVector
udv = None
+ hwm = drsuapi.DsReplicaHighWaterMark()
+ hwm.tmp_highest_usn = 0
+ hwm.reserved_usn = 0
+ hwm.highest_usn = 0
+
if not full_sync:
res = self.samdb.search(base=dn, scope=ldb.SCOPE_BASE,
attrs=["repsFrom"])
udv.cursors = cursors_v1
udv.count = len(cursors_v1)
- # If we can't find an upToDateVector, or where told not to, replicate fully
- hwm = drsuapi.DsReplicaHighWaterMark()
- hwm.tmp_highest_usn = 0
- hwm.reserved_usn = 0
- hwm.highest_usn = 0
-
req8.highwatermark = hwm
req8.uptodateness_vector = udv