libnet: Reset debug counters after replicating critical objects
authorTim Beale <timbeale@catalyst.net.nz>
Mon, 5 Nov 2018 03:34:15 +0000 (16:34 +1300)
committerTim Beale <timbeale@samba.org>
Tue, 6 Nov 2018 02:39:11 +0000 (03:39 +0100)
Reset the debug counters once we have finished replicating a given
partition. This helps if we replicate the same partition immediately
afterward with different options.

This helps the DC join debug look less weird. Because it replicates the
critical objects first, and then the base partition, previously it
always ended up overcounting, e.g.

Partition[DC=addom,DC=samba,DC=example,DC=com] objects[314/218]
  linked_values[48/24]

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

index 5bd8df13a2620dfa5bd95d5ecd0fcceff52acbee..6167493c359efa8f35481cc5aac4946b13ae541b 100644 (file)
@@ -781,6 +781,12 @@ WERROR libnet_vampire_cb_store_chunk(void *private_data,
                return status;
        }
 
+       /* reset debug counters once we've finished replicating the partition */
+       if (!c->partition->more_data) {
+               s->total_objects = 0;
+               s->total_links = 0;
+       }
+
        talloc_free(s_dsa);
        talloc_free(objs);