s4-drepl: We won't need a working schema for empty replicas sent.
authorKamen Mazdrashki <kamenim@samba.org>
Fri, 10 Dec 2010 02:17:09 +0000 (04:17 +0200)
committerKamen Mazdrashki <kamenim@samba.org>
Tue, 14 Dec 2010 23:51:19 +0000 (00:51 +0100)
Without this check, receiving empty replica leads to a situation
where we left with a working_schema attached to the ldb.

The problem here is that working_schema is not fully functional
schema cache and keeping it attached to the ldb may lead
to modules failing to accomplish their jobs

source4/dsdb/repl/drepl_out_helpers.c

index 6481028a42e05e16768452378f7863b7f43a5720..6bb2516f2df775ef688ebf9be6eaa25286b6f279 100644 (file)
@@ -588,8 +588,11 @@ static void dreplsrv_op_pull_source_apply_changes_trigger(struct tevent_req *req
                return;
        }
 
-       /* Decide what working schema to use for object conversion */
-       if (ldb_dn_compare(partition->dn, schema->base_dn) == 0) {
+       /*
+        * Decide what working schema to use for object conversion.
+        * We won't need a working schema for empty replicas sent.
+        */
+       if (first_object && ldb_dn_compare(partition->dn, schema->base_dn) == 0) {
                /* create working schema to convert objects with */
                status = dsdb_repl_make_working_schema(service->samdb,
                                                       schema,