We need to add instanceType on new records if not added by caller. This is needed in repl_meta_data
to ensure we fill in the meta data for replication
ldb_msg_remove_attr(msg, "uSNChanged");
ldb_msg_remove_attr(msg, "replPropertyMetaData");
+ if (!ldb_msg_find_element(req->op.add.message, "instanceType")) {
+ ret = ldb_msg_add_fmt(msg, "instanceType", "%u", INSTANCE_TYPE_WRITE);
+ if (ret != LDB_SUCCESS) {
+ ldb_oom(ldb);
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+ }
+
/*
* readd replicated attributes
*/