From 5528a4cce4f7520bec3305f5ba2951378184687d Mon Sep 17 00:00:00 2001 From: Tim Beale Date: Wed, 24 Oct 2018 11:17:38 +1300 Subject: [PATCH] replmd: Add more debug for replicating links During a join of a large DB, processing the linked attributes can take a long time. The join hangs in 'Committing SAM database' for many minutes with no indication of whether it's making progress or not. This patch adds some extra debug to show how far through processing the linked attributes we are, when there are many thousands of links. Signed-off-by: Tim Beale Reviewed-by: Andrew Bartlett --- source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index b1f1523ffa2..6ed15883036 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -75,6 +75,8 @@ struct replmd_private { struct ldb_dn *schema_dn; bool originating_updates; bool sorted_links; + uint32_t total_links; + uint32_t num_processed; }; struct la_entry { @@ -6579,6 +6581,7 @@ static int replmd_store_linked_attributes(struct replmd_replicated_request *ar) } DLIST_ADD(replmd_private->la_list, la_entry); + replmd_private->total_links++; } return ret; @@ -8150,6 +8153,10 @@ static int replmd_prepare_commit(struct ldb_module *module) struct la_entry *la, *prev; int ret; + if (replmd_private->la_list != NULL) { + DBG_NOTICE("Processing linked attributes\n"); + } + /* * Walk the list of linked attributes from DRS replication. * @@ -8166,6 +8173,12 @@ static int replmd_prepare_commit(struct ldb_module *module) replmd_txn_cleanup(replmd_private); return ret; } + + if ((++replmd_private->num_processed % 8192) == 0) { + DBG_NOTICE("Processed %u/%u linked attributes\n", + replmd_private->num_processed, + replmd_private->total_links); + } } replmd_txn_cleanup(replmd_private); -- 2.47.2