summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2012-01-10 13:55:13 -0500
committerNalin Dahyabhai <nalin@redhat.com>2012-01-10 13:55:13 -0500
commit982244674489c01e3575409561b94337a75e2639 (patch)
tree9c232e63fc130dde2a917895a36dcbab4d7e77b4
parentb19a0bbcccb5c0c8ef91dfbb2c7c7b9289f3b6a1 (diff)
downloadslapi-nis-982244674489c01e3575409561b94337a75e2639.tar.gz
slapi-nis-982244674489c01e3575409561b94337a75e2639.tar.xz
slapi-nis-982244674489c01e3575409561b94337a75e2639.zip
- add a testing option for toggling the skip-uninteresting-updates logic
-rw-r--r--configure.ac6
-rw-r--r--src/back-nis.c8
-rw-r--r--src/back-sch.c8
-rw-r--r--src/back-shr.c6
-rw-r--r--src/backend.h3
5 files changed, 29 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 44cd752..9f027c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -384,6 +384,12 @@ AC_SUBST(test_nisport)
NIS_PLUGIN_CONTINUE_WITHOUT_PORTMAP_ENV="nis_plugin_continue_without_portmap_for_testing_only_no_i_really_mean_that"
AC_DEFINE_UNQUOTED(NIS_PLUGIN_CONTINUE_WITHOUT_PORTMAP_ENV,"$NIS_PLUGIN_CONTINUE_WITHOUT_PORTMAP_ENV",[Define to the environment variable which will override the fail-if-unable-to-use-the-portmapper logic.])
AC_SUBST(NIS_PLUGIN_CONTINUE_WITHOUT_PORTMAP_ENV)
+NIS_PLUGIN_PROCESS_UNINTERESTING_UPDATES_ENV="nis_plugin_process_uninteresting_updates_for_testing_only_no_i_really_mean_that"
+AC_DEFINE_UNQUOTED(NIS_PLUGIN_PROCESS_UNINTERESTING_UPDATES_ENV,"$NIS_PLUGIN_PROCESS_UNINTERESTING_UPDATES_ENV",[Define to the environment variable which will override the default skip-uninteresting-updates logic for the NIS plugin.])
+AC_SUBST(NIS_PLUGIN_PROCESS_UNINTERESTING_UPDATES_ENV)
+SCHEMA_COMPAT_PLUGIN_PROCESS_UNINTERESTING_UPDATES_ENV="schema_compat_plugin_process_uninteresting_updates_for_testing_only_no_i_really_mean_that"
+AC_DEFINE_UNQUOTED(SCHEMA_COMPAT_PLUGIN_PROCESS_UNINTERESTING_UPDATES_ENV,"$SCHEMA_COMPAT_PLUGIN_PROCESS_UNINTERESTING_UPDATES_ENV",[Define to the environment variable which will override the default skip-uninteresting-updates logic for the schema compat plugin.])
+AC_SUBST(SCHEMA_COMPAT_PLUGIN_PROCESS_UNINTERESTING_UPDATES_ENV)
AC_SUBST(TRACE_CMD)
CONFIGURED_LINK_FLAGS=
diff --git a/src/back-nis.c b/src/back-nis.c
index 803cf61..91f520d 100644
--- a/src/back-nis.c
+++ b/src/back-nis.c
@@ -137,6 +137,8 @@ backend_copy_set_data(const struct backend_set_data *data)
ret->common.inref_attr_list = data->common.inref_attr_list ?
format_dup_ref_attr_list(data->common.inref_attr_list) :
NULL;
+ ret->common.skip_uninteresting_updates =
+ data->common.skip_uninteresting_updates;
ret->disallowed_chars = data->disallowed_chars ?
strdup(data->disallowed_chars) : NULL;
ret->key_formats = backend_shr_dup_strlist(data->key_formats);
@@ -606,6 +608,12 @@ backend_set_config_read_config(struct plugin_state *state, Slapi_Entry *e,
ret.common.inref_attrs = NULL;
ret.common.ref_attr_list = NULL;
ret.common.inref_attr_list = NULL;
+ if ((getenv(NIS_PLUGIN_PROCESS_UNINTERESTING_UPDATES_ENV) == NULL) ||
+ (atol(getenv(NIS_PLUGIN_PROCESS_UNINTERESTING_UPDATES_ENV)) != 0)) {
+ ret.common.skip_uninteresting_updates = 0;
+ } else {
+ ret.common.skip_uninteresting_updates = 1;
+ }
ret.disallowed_chars = use_disallowed_chars;
ret.key_formats = use_key_formats;
ret.n_key_formats = 0;
diff --git a/src/back-sch.c b/src/back-sch.c
index dedb50a..9203da0 100644
--- a/src/back-sch.c
+++ b/src/back-sch.c
@@ -139,6 +139,8 @@ backend_copy_set_config(const struct backend_set_data *data)
format_dup_ref_attr_list(data->common.inref_attr_list) :
NULL;
ret->common.entry_filter = strdup(data->common.entry_filter);
+ ret->common.skip_uninteresting_updates =
+ data->common.skip_uninteresting_updates;
ret->container_sdn = slapi_sdn_dup(data->container_sdn);
ret->rdn_format = strdup(data->rdn_format);
ret->attribute_format = backend_shr_dup_strlist(data->attribute_format);
@@ -192,6 +194,12 @@ backend_set_config_read_config(struct plugin_state *state, Slapi_Entry *e,
ret.common.inref_attrs = NULL;
ret.common.ref_attr_list = NULL;
ret.common.inref_attr_list = NULL;
+ if ((getenv(SCHEMA_COMPAT_PLUGIN_PROCESS_UNINTERESTING_UPDATES_ENV) == NULL) ||
+ (atol(getenv(SCHEMA_COMPAT_PLUGIN_PROCESS_UNINTERESTING_UPDATES_ENV)) != 0)) {
+ ret.common.skip_uninteresting_updates = 0;
+ } else {
+ ret.common.skip_uninteresting_updates = 1;
+ }
if (strlen(ret.common.set) > 0) {
dn = slapi_dn_plus_rdn(ret.common.group, ret.common.set);
} else {
diff --git a/src/back-shr.c b/src/back-shr.c
index 044c694..e75a26b 100644
--- a/src/back-shr.c
+++ b/src/back-shr.c
@@ -876,7 +876,8 @@ backend_shr_update_references_cb(const char *group, const char *set,
/* If the entry didn't change any attributes which are at all relevant
* to this map, then we don't need to recompute anything. */
- if ((cbdata->mods != NULL) && (set_data->rel_attrs != NULL)) {
+ if (set_data->skip_uninteresting_updates &&
+ (cbdata->mods != NULL) && (set_data->rel_attrs != NULL)) {
for (i = 0; cbdata->mods[i] != NULL; i++) {
for (j = 0; set_data->rel_attrs[j] != NULL; j++) {
if (slapi_attr_types_equivalent(cbdata->mods[i]->mod_type,
@@ -1542,7 +1543,8 @@ backend_shr_modify_entry_cb(const char *group, const char *set, bool_t flag,
/* If the entry didn't change any attributes which are at all relevant
* to the map, and it both was and is still is in the map, then we
* don't need to recompute anything. */
- if ((cbdata->mods != NULL) && (set_data->rel_attrs != NULL)) {
+ if (set_data->skip_uninteresting_updates &&
+ (cbdata->mods != NULL) && (set_data->rel_attrs != NULL)) {
for (i = 0; cbdata->mods[i] != NULL; i++) {
for (j = 0; set_data->rel_attrs[j] != NULL; j++) {
if (slapi_attr_types_equivalent(cbdata->mods[i]->mod_type,
diff --git a/src/backend.h b/src/backend.h
index a2b1f58..bf58456 100644
--- a/src/backend.h
+++ b/src/backend.h
@@ -43,6 +43,9 @@ struct backend_shr_set_data {
/* More general-purpose versions of the above, which allow for
* overriding the search bases and filters as well. */
struct format_ref_attr_list **ref_attr_list, **inref_attr_list;
+ /* Configuration flag indicating whether or not we try to skip
+ * recomputing data in this map. */
+ int skip_uninteresting_updates:1;
struct backend_set_data *self;
};