diff --git a/modules/usrloc/dlist.c b/modules/usrloc/dlist.c index 50dec888b44..4ac97c70eee 100644 --- a/modules/usrloc/dlist.c +++ b/modules/usrloc/dlist.c @@ -522,7 +522,7 @@ get_domain_cdb_ucontacts(udomain_t *d, void *buf, int *len, { static const cdb_key_t aorhash_key = {str_init("aorhash"), 0}; /* TODO */ struct list_head *_, *__; - int cur_node_idx, nr_nodes, min, max; + int cur_node_idx = 0, nr_nodes = 1, min, max; char *cpos; double unit; cdb_filter_t *aorh_filter; @@ -536,8 +536,9 @@ get_domain_cdb_ucontacts(udomain_t *d, void *buf, int *len, enum cdb_filter_op rhs_op; int shortage; - cur_node_idx = clusterer_api.get_my_index( - location_cluster, &contact_repl_cap, &nr_nodes); + if (shared_pinging) + cur_node_idx = clusterer_api.get_my_index( + location_cluster, &contact_repl_cap, &nr_nodes); unit = MAX_DB_AOR_HASH / (double)(part_max * nr_nodes); min = (int)(unit * part_max * cur_node_idx + unit * part_idx); @@ -646,8 +647,8 @@ get_domain_mem_ucontacts(udomain_t *d,void *buf, int *len, unsigned int flags, if (zero_end) *len -= (int)sizeof(c->c.len); - if (cluster_mode == CM_FULL_SHARING - || cluster_mode == CM_FULL_SHARING_CACHEDB) { + if (shared_pinging && (cluster_mode == CM_FULL_SHARING + || cluster_mode == CM_FULL_SHARING_CACHEDB)) { cur_node_idx = clusterer_api.get_my_index( location_cluster, &contact_repl_cap, &nr_nodes); } diff --git a/modules/usrloc/doc/usrloc_admin.xml b/modules/usrloc/doc/usrloc_admin.xml index 7805ef52ff1..a472e6ce9a7 100644 --- a/modules/usrloc/doc/usrloc_admin.xml +++ b/modules/usrloc/doc/usrloc_admin.xml @@ -1308,6 +1308,36 @@ modparam("usrloc", "latency_event_min_us_delta", 300000) +
+ <varname>shared_pinging</varname> (integer) + + Only relevant in a "full sharing" or "full sharing cachedb" + . If set to non-zero, the overall + pinging workload will be equally spread across cluster nodes with the + help of the clustering layer that keeps track of the current number of + active nodes. + + + Disabling this parameter may be useful in simple active/backup + setups, where only the active node must perform the pinging. + + + + Default value is 1 (enabled). + + + + + Set <varname>shared_pinging</varname> parameter + +... +# do not partition the pinging workload across cluster nodes +modparam("usrloc", "shared_pinging", 0) +... + + +
+
diff --git a/modules/usrloc/ul_mod.c b/modules/usrloc/ul_mod.c index a2fc53fb327..b97c4dc41ca 100644 --- a/modules/usrloc/ul_mod.c +++ b/modules/usrloc/ul_mod.c @@ -146,6 +146,7 @@ char *rr_persist_str; /*!< SQL write mode */ enum ul_sql_write_mode sql_wmode = SQL_NO_WRITE; char *sql_wmode_str; +int shared_pinging; int use_domain = 0; /*!< Whether usrloc should use domain part of aor */ int desc_time_order = 0; /*!< By default do not enable timestamp ordering */ @@ -214,6 +215,7 @@ static param_export_t params[] = { {"cluster_mode", STR_PARAM, &cluster_mode_str }, {"restart_persistency",STR_PARAM, &rr_persist_str }, {"sql_write_mode", STR_PARAM, &sql_wmode_str }, + {"shared_pinging", INT_PARAM, &shared_pinging }, {"use_domain", INT_PARAM, &use_domain }, {"desc_time_order", INT_PARAM, &desc_time_order }, diff --git a/modules/usrloc/ul_mod.h b/modules/usrloc/ul_mod.h index ef2ba4c6285..0a3c9dcfc39 100644 --- a/modules/usrloc/ul_mod.h +++ b/modules/usrloc/ul_mod.h @@ -120,6 +120,7 @@ extern int cseq_delay; extern int ul_hash_size; extern int latency_event_min_us_delta; extern int latency_event_min_us; +extern int shared_pinging; extern db_con_t* ul_dbh; /* Database connection handle */ extern db_func_t ul_dbf;