]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
replmd: Add more debug for replicating links
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 23 Oct 2018 22:17:38 +0000 (11:17 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 1 Nov 2018 19:38:14 +0000 (20:38 +0100)
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 <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index b1f1523ffa242619511ba23c926fba450a5f0165..6ed158830368f2469ca252417f628a7637e1b8cf 100644 (file)
@@ -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);