rpmd: Skip bump of USN when vanishing forward links
authorGarming Sam <garming@catalyst.net.nz>
Thu, 8 Sep 2016 02:40:40 +0000 (14:40 +1200)
committerGarming Sam <garming@samba.org>
Thu, 8 Sep 2016 08:46:08 +0000 (10:46 +0200)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 44fbbf46d766fe5bef9fba610761ebdf479e60ce..7a5906eb86b7f4528181bfe9eaaa051205473ba2 100644 (file)
@@ -1312,6 +1312,18 @@ static int replmd_update_rpmd_element(struct ldb_context *ldb,
                } else if (LDB_FLAG_MOD_TYPE(el->flags) == LDB_FLAG_MOD_DELETE) {
                        may_skip = true;
                }
+       } else if (a->linkID != 0 && LDB_FLAG_MOD_TYPE(el->flags) == LDB_FLAG_MOD_DELETE &&
+                  ldb_request_get_control(req, DSDB_CONTROL_REPLMD_VANISH_LINKS) != NULL) {
+               /*
+                * We intentionally skip the version bump when attempting to
+                * vanish links.
+                *
+                * The control is set by dbcheck and expunge-tombstones which
+                * both attempt to be non-replicating. Otherwise, making an
+                * alteration to the replication state would trigger a
+                * broadcast of all expunged objects.
+                */
+               may_skip = true;
        }
 
        if (el->flags & DSDB_FLAG_INTERNAL_FORCE_META_DATA) {