From: Ronnie Sahlberg Date: Wed, 1 Apr 2009 06:21:38 +0000 (+1100) Subject: Change the (dodgy) seqnumfrequency variable to have ms resolution instead of second... X-Git-Tag: ctdb-1.0.79~12 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=68eac459e5d2b6b534f72821036675ffe5d7a350;p=sahlberg%2Fctdb.git Change the (dodgy) seqnumfrequency variable to have ms resolution instead of second resolution. Rename the variable to SeqnumInterval for 1, it is an interval and not a 1/interval unit 2, so that we catch when people use this old variable and can update the sysconfig file instead of silently changin semantics of this variable this is a real dodgy variable --- diff --git a/include/ctdb_private.h b/include/ctdb_private.h index 16db7730..88e686bc 100644 --- a/include/ctdb_private.h +++ b/include/ctdb_private.h @@ -77,7 +77,7 @@ struct ctdb_tcp_array { /* all tunable variables go in here */ struct ctdb_tunable { uint32_t max_redirect_count; - uint32_t seqnum_frequency; + uint32_t seqnum_interval; /* unit is ms */ uint32_t control_timeout; uint32_t traverse_timeout; uint32_t keepalive_interval; diff --git a/server/ctdb_ltdb_server.c b/server/ctdb_ltdb_server.c index 35212506..b330768d 100644 --- a/server/ctdb_ltdb_server.c +++ b/server/ctdb_ltdb_server.c @@ -455,7 +455,7 @@ static void ctdb_ltdb_seqnum_check(struct event_context *ev, struct timed_event /* setup a new timer */ ctdb_db->te = event_add_timed(ctdb->ev, ctdb_db, - timeval_current_ofs(ctdb->tunable.seqnum_frequency, 0), + timeval_current_ofs(ctdb->tunable.seqnum_interval/1000, (ctdb->tunable.seqnum_interval%1000)*1000), ctdb_ltdb_seqnum_check, ctdb_db); } @@ -474,7 +474,7 @@ int32_t ctdb_ltdb_enable_seqnum(struct ctdb_context *ctdb, uint32_t db_id) if (ctdb_db->te == NULL) { ctdb_db->te = event_add_timed(ctdb->ev, ctdb_db, - timeval_current_ofs(ctdb->tunable.seqnum_frequency, 0), + timeval_current_ofs(ctdb->tunable.seqnum_interval/1000, (ctdb->tunable.seqnum_interval%1000)*1000), ctdb_ltdb_seqnum_check, ctdb_db); } diff --git a/server/ctdb_tunables.c b/server/ctdb_tunables.c index f758c2cf..31ec89f8 100644 --- a/server/ctdb_tunables.c +++ b/server/ctdb_tunables.c @@ -25,7 +25,7 @@ static const struct { size_t offset; } tunable_map[] = { { "MaxRedirectCount", 3, offsetof(struct ctdb_tunable, max_redirect_count) }, - { "SeqnumFrequency", 1, offsetof(struct ctdb_tunable, seqnum_frequency) }, + { "SeqnumInterval", 1000, offsetof(struct ctdb_tunable, seqnum_interval) }, { "ControlTimeout", 60, offsetof(struct ctdb_tunable, control_timeout) }, { "TraverseTimeout", 20, offsetof(struct ctdb_tunable, traverse_timeout) }, { "KeepaliveInterval", 5, offsetof(struct ctdb_tunable, keepalive_interval) },