mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
libnet/drs: Update replication debug to report link progress
Update the replication debug (for joins/backups) so that it's easier to see how far through syncing the links we are. E.g. with 150,000 links, you just get screeds of debug like this, with no real idea how far through the replication is. Partition[DC=addom,DC=samba,DC=example,DC=com] objects[11816/11720] linked_values[1500/150024] Partition[DC=addom,DC=samba,DC=example,DC=com] objects[11816/11720] linked_values[1500/150024] Partition[DC=addom,DC=samba,DC=example,DC=com] objects[11816/11720] linked_values[1500/150024] This patch now applies to links the same debug logic we use for objects, and changes it to look like: Partition[DC=addom,DC=samba,DC=example,DC=com] objects[11816/11720] linked_values[57024/150024] Partition[DC=addom,DC=samba,DC=example,DC=com] objects[11816/11720] linked_values[58524/150024] Partition[DC=addom,DC=samba,DC=example,DC=com] objects[11816/11720] linked_values[60024/150024] Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
3713905f8b
commit
539daefaf3
@ -88,6 +88,7 @@ struct libnet_vampire_cb_state {
|
||||
struct loadparm_context *lp_ctx;
|
||||
struct tevent_context *event_ctx;
|
||||
unsigned total_objects;
|
||||
unsigned total_links;
|
||||
char *last_partition;
|
||||
const char *server_dn_str;
|
||||
};
|
||||
@ -689,10 +690,12 @@ WERROR libnet_vampire_cb_store_chunk(void *private_data,
|
||||
/* we want to show a count per partition */
|
||||
if (!s->last_partition || strcmp(s->last_partition, c->partition->nc.dn) != 0) {
|
||||
s->total_objects = 0;
|
||||
s->total_links = 0;
|
||||
talloc_free(s->last_partition);
|
||||
s->last_partition = talloc_strdup(s, c->partition->nc.dn);
|
||||
}
|
||||
s->total_objects += object_count;
|
||||
s->total_links += linked_attributes_count;
|
||||
|
||||
partition_dn = ldb_dn_new(s_dsa, s->ldb, c->partition->nc.dn);
|
||||
if (partition_dn == NULL) {
|
||||
@ -705,7 +708,7 @@ WERROR libnet_vampire_cb_store_chunk(void *private_data,
|
||||
if (nc_object_count) {
|
||||
DEBUG(0,("Exop on[%s] objects[%u/%u] linked_values[%u/%u]\n",
|
||||
c->partition->nc.dn, s->total_objects, nc_object_count,
|
||||
linked_attributes_count, nc_linked_attributes_count));
|
||||
s->total_links, nc_linked_attributes_count));
|
||||
} else {
|
||||
DEBUG(0,("Exop on[%s] objects[%u] linked_values[%u]\n",
|
||||
c->partition->nc.dn, s->total_objects, linked_attributes_count));
|
||||
@ -721,10 +724,10 @@ WERROR libnet_vampire_cb_store_chunk(void *private_data,
|
||||
if (nc_object_count) {
|
||||
DEBUG(0,("Partition[%s] objects[%u/%u] linked_values[%u/%u]\n",
|
||||
c->partition->nc.dn, s->total_objects, nc_object_count,
|
||||
linked_attributes_count, nc_linked_attributes_count));
|
||||
s->total_links, nc_linked_attributes_count));
|
||||
} else {
|
||||
DEBUG(0,("Partition[%s] objects[%u] linked_values[%u]\n",
|
||||
c->partition->nc.dn, s->total_objects, linked_attributes_count));
|
||||
c->partition->nc.dn, s->total_objects, s->total_links));
|
||||
}
|
||||
nc_root = partition_dn;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user