dsdb: Apply linked attribute backlinks as we apply the forward links
authorAndrew Bartlett <abartlet@samba.org>
Wed, 15 Jun 2016 21:31:21 +0000 (09:31 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 26 Jun 2016 22:18:17 +0000 (00:18 +0200)
Otherwise, we spend a lot of time checking if the link is in the list, which is pointless
and very costly in large domains

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index cf49a3c1d4e189e596262923b3dad7a457dde261..8a7e482d99c3585360167a6724df7b6790cf17aa 100644 (file)
@@ -6075,7 +6075,7 @@ linked_attributes[0]:
 
                if (!(rmd_flags & DSDB_RMD_FLAG_DELETED)) {
                        /* remove the existing backlink */
-                       ret = replmd_add_backlink(module, schema, &la->identifier->guid, &guid, false, attr, false);
+                       ret = replmd_add_backlink(module, schema, &la->identifier->guid, &guid, false, attr, true);
                        if (ret != LDB_SUCCESS) {
                                talloc_free(tmp_ctx);
                                return ret;
@@ -6095,7 +6095,7 @@ linked_attributes[0]:
 
                if (active) {
                        /* add the new backlink */
-                       ret = replmd_add_backlink(module, schema, &la->identifier->guid, &guid, true, attr, false);
+                       ret = replmd_add_backlink(module, schema, &la->identifier->guid, &guid, true, attr, true);
                        if (ret != LDB_SUCCESS) {
                                talloc_free(tmp_ctx);
                                return ret;
@@ -6130,7 +6130,7 @@ linked_attributes[0]:
 
                if (active) {
                        ret = replmd_add_backlink(module, schema, &la->identifier->guid, &guid,
-                                                 true, attr, false);
+                                                 true, attr, true);
                        if (ret != LDB_SUCCESS) {
                                talloc_free(tmp_ctx);
                                return ret;