Hello community,
here is the log from the commit of package booth for openSUSE:Factory checked in at 2014-07-22 06:57:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/booth (Old)
and /work/SRC/openSUSE:Factory/.booth.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "booth"
Changes:
--------
--- /work/SRC/openSUSE:Factory/booth/booth.changes 2014-07-11 06:45:47.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.booth.new/booth.changes 2014-07-22 06:57:52.000000000 +0200
@@ -1,0 +2,19 @@
+Thu Jul 17 14:20:58 UTC 2014 - dmuhamedagic@suse.com
+
+- build: update setting build information
+- doc: update server operation description
+- client: add the -w option
+- upstream version: 49c0f3d
+
+-------------------------------------------------------------------
+Thu Jul 17 10:54:20 UTC 2014 - dmuhamedagic@suse.com
+
+- build: fix setting package version in configure
+- build: update booth.spec for redhat platforms
+- client: wait for request outcome (bnc#887689)
+- ticket: add renewal frequency (bnc#887113)
+- ra: simplify process status and removal
+- config: fix copying name from the configuration file name (bnc#886674)
+- upstream version: 3bfdd5b
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ booth.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/.git_info new/booth/.git_info
--- old/booth/.git_info 2014-07-03 17:36:56.000000000 +0200
+++ new/booth/.git_info 2014-07-17 16:32:16.000000000 +0200
@@ -1 +1 @@
-v0.1.7-262-gff5b114
+v0.1.7-285-g49c0f3d
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/README new/booth/README
--- old/booth/README 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/README 2014-07-17 16:30:12.000000000 +0200
@@ -1,16 +1,16 @@
The Booth Cluster Ticket Manager
=============
-Booth manages the ticket which authorizes one of the cluster
-sites located in geographically dispersed distances to run
-certain resources. It is designed to be an add-on of Pacemaker,
-which extends Pacemaker to support geographically distributed
-clustering.
+Booth manages tickets which authorize cluster sites located in
+geographically dispersed locations to run resources. It
+facilitates support of geographically distributed clustering in
+Pacemaker.
Booth is based on the Raft consensus algorithm. Though the
-implementation is not complete (there is no log), booth
-guarantees that the ticket is always available at just one site
-as long as it has exclusive control of the tickets.
+implementation is not complete (there is no log) and there are a
+few additions and modifications, booth guarantees that the ticket
+is always available at just one site as long as it has exclusive
+control of the tickets.
The git repository is available at github:
@@ -27,12 +27,13 @@
of at least three servers.
A booth server can be either a site or an arbitrator. Arbitrators
-help resolve ties in elections, but cannot hold tickets.
+take part in elections and so help resolve ties, but cannot hold
+tickets.
-The basic unit of operation in the booth cluster is a ticket.
-Every non-granted ticket is in the initial state on all servers.
-For granted tickets, the server holding the ticket is the leader
-and other servers are followers. The leader issues heartbeats and
+The basic unit in the booth cluster is a ticket. Every
+non-granted ticket is in the initial state on all servers. For
+granted tickets, the server holding the ticket is the leader and
+other servers are followers. The leader issues heartbeats and
ticket updates to the followers. The followers are required to
obey the leader.
@@ -41,14 +42,15 @@
On startup, the booth process first loads tickets, if available,
from the CIB. Afterwards, it broadcasts a query to get tickets'
-status from other servers. Local copies are updated from ticket
-replies.
+status from other servers. In-memory copies are updated from
+the replies if they contain newer ticket data.
If the server discovers that itself is the ticket leader, it
tries to establish its authority again by broadcasting heartbeat.
If it succeeds, it continues as the leader for this ticket. The
other booth servers become followers. This procedure is possible
-only immediately after the booth startup.
+only immediately after the booth startup. It also serves as a
+configuration reload.
Grant and revoke operations
------------
@@ -62,7 +64,8 @@
Ticket revoke is the operation which is the opposite of grant.
An administrative revoke may be started at any server, but the
operation itself happens only at the leader. If the leader is
-unreachable, the ticket cannot be revoked.
+unreachable, the ticket cannot be revoked. The user will need to
+wait until the ticket expires.
A ticket grant may be delayed if not all sites are reachable.
The delay is the ticket expiry time extended by acquire-after, if
@@ -112,7 +115,8 @@
receives enough acknowledgements, it then stores the ticket to
the CIB and broadcasts the UPDATE RPC with updated ticket expiry
time so that the followers can update local ticket copies. Ticket
-renewals run every half ticket expire time.
+renewals are configurable and by default set to half ticket
+expire time.
Before ticket renewal, the leader runs an external program if
such program is set in 'before-acquire-handler'. The external
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/booth.spec new/booth/booth.spec
--- old/booth/booth.spec 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/booth.spec 2014-07-17 16:30:12.000000000 +0200
@@ -7,7 +7,7 @@
%define with_extra_warnings 0
%define with_debugging 0
%define without_fatal_warnings 1
-%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version}
+%if 0%{?fedora} || 0%{?centos} || 0%{?rhel}
%define pkg_group System Environment/Daemons
%else
%define pkg_group Productivity/Clustering/HA
@@ -26,12 +26,21 @@
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: glib2-devel
+%if 0%{?fedora} || 0%{?centos} || 0%{?rhel}
+BuildRequires: cluster-glue-libs-devel
+BuildRequires: pacemaker-libs-devel
+%else
BuildRequires: libglue-devel
BuildRequires: libpacemaker-devel
+%endif
BuildRequires: libxml2-devel
BuildRequires: pkgconfig
-# the following is probably SUSE specific
+%if 0%{?fedora} || 0%{?centos} || 0%{?rhel}
+Requires: pacemaker >= 1.1.8
+Requires: cluster-glue-libs >= 1.0.6
+%else
Requires: pacemaker-ticket-support >= 2.0
+%endif
%description
Booth manages the ticket which authorizes one of the cluster sites located in
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/configure.ac new/booth/configure.ac
--- old/booth/configure.ac 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/configure.ac 2014-07-17 16:30:12.000000000 +0200
@@ -181,12 +181,12 @@
[ INITDDIR="$sysconfdir/init.d" ])
test -s .git_info &&
- BOOTH_BUILD_VERSION="`cat .git_info`"
+ GIT_VER="`cat .git_info`"
AC_ARG_WITH([build-version],
[ --with-build-version=STR : build version ],
[ BOOTH_BUILD_VERSION="$withval" ],
- [ ])
+ [ BOOTH_BUILD_VERSION="${GIT_VER:-$PACKAGE_VERSION}" ])
AC_ARG_ENABLE([resource-monitor],
[ --enable-resource-monitor : Enabling Resource Monitor ],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/docs/boothd.8.txt new/booth/docs/boothd.8.txt
--- old/booth/docs/boothd.8.txt 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/docs/boothd.8.txt 2014-07-17 16:30:12.000000000 +0200
@@ -86,6 +86,9 @@
relinquish the ticket. See the 'Booth ticket management'
section below for more details. Use with caution!
+*-w*::
+ 'wait indefinitely': The client will wait forever for the
+ server result for grant and revoke requests.
COMMANDS
@@ -105,13 +108,20 @@
Booth clients can list the ticket information (see also 'crm_ticket -L'),
and revoke or grant tickets to a site.
+
+The grant and, under certain circumstances, revoke operations may
+take a while to return a definite operation's outcome. The client
+will wait up to the network timeout value (by default 5 seconds)
+for the result. Unless the '-w' option was set, in which case the
+client waits indefinitely.
++
In this mode the configuration file is searched for an IP address that is
locally reachable, ie. matches a configured subnet.
This allows to run the client commands on another node in the same cluster, as
long as the config file and the service IP is locally reachable.
+
-Example: If the booth service IP is 192.168.55.200, and the local node has
-192.168.55.15 configured on an interface, it knows which site it belongs to.
+For instance, if the booth service IP is 192.168.55.200, and the
+local node has 192.168.55.15 configured on one of its network
+interfaces, it knows which site it belongs to.
+
Use '-s' to direct client to connect to a different site.
@@ -221,7 +231,7 @@
+
Default is 10. Values lower than 3 are illegal.
+
-Ticket *renewal*, which occurs every half expire time, cannot
+Ticket *renewal*, which by default occurs every half expire time,
must happen after packet resending. Hence, the total retry time
must be shorter than half the expire time:
@@ -244,6 +254,17 @@
See below for details about booth specific environment variables
and the distributed 'service-runnable' script.
+*'renewal-freq'*::
+ Set the ticket renewal frequency period. By default, it is
+ set to half the ticket expire time.
++
+If the network reliability is often reduced over prolonged
+periods, it may help to reduce the renewal frequency.
++
+Before every renewal, if set, the 'before-acquire-handler' is
+run. This parameter then may be used to set the local cluster
+monitor interval.
+
A more verbose example of a configuration file might be
@@ -304,11 +325,11 @@
case, it is up to the administrator to make sure that the
unreachable site is not holding the ticket.
-While the ticket is managed by 'booth', it is dangerous to manage
+When the ticket is managed by 'booth', it is dangerous to modify
it manually using either `crm_ticket` command or `crm site
ticket`. Neither of these tools is aware of 'booth' and,
-consequently, 'booth' itself may not notice any ticket status
-changes.
+consequently, 'booth' itself may not be aware of any ticket
+status changes.
NOTES
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/script/ocf/booth-site new/booth/script/ocf/booth-site
--- old/booth/script/ocf/booth-site 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/script/ocf/booth-site 2014-07-17 16:30:12.000000000 +0200
@@ -26,11 +26,6 @@
#######################################################################
# Initialization:
-BOOTH_DAEMON_STARTED=0
-BOOTH_DAEMON_STARTING=1
-BOOTH_DAEMON_EXIST=2
-BOOTH_DAEMON_NOT_RUNNING=3
-BOOTH_ERROR_GENERIC=4
DEFAULT_BIN="boothd"
DEFAULT_CONF="/etc/booth/booth.conf"
@@ -82,8 +77,8 @@
</parameters>
<actions>
-<action name="start" timeout="90" />
-<action name="stop" timeout="100" />
+<action name="start" timeout="20" />
+<action name="stop" timeout="20" />
<action name="monitor" timeout="20" interval="10" depth="0" start-delay="0" />
<action name="meta-data" timeout="5" />
<action name="validate-all" timeout="30" />
@@ -103,108 +98,82 @@
}
-booth_check_daemon_state(){
- rc=$BOOTH_ERROR_GENERIC
- eval `"$OCF_RESKEY_daemon" status "-c$OCF_RESKEY_config" ; echo rc=$?`
- case $rc in
- 0)
- case "$booth_state" in
- started) return $BOOTH_DAEMON_STARTED;;
- starting) return $BOOTH_DAEMON_STARTING;;
- *) return $BOOTH_ERROR_GENERIC;;
- esac
- ;;
- $OCF_NOT_RUNNING) return $BOOTH_DAEMON_NOT_RUNNING;;
- $OCF_ERR_GENERIC) return $BOOTH_ERROR_GENERIC;;
- *) return $BOOTH_ERROR_GENERIC;;
- esac
+get_booth_pid() {
+ ps -o pid,cmd -e |
+ grep -w "[b]oothd.*$OCF_RESKEY_config" |
+ awk '{print $1}'
+}
+is_booth_running() {
+ [ -n "`get_booth_pid`" ]
+}
+
+booth_site_status() {
+ is_booth_running ||
+ return $OCF_NOT_RUNNING
+
+ booth list -c $OCF_RESKEY_config > /dev/null
}
booth_site_start() {
- booth_check_daemon_state; rc=$?
+ local rc
+
+ booth_site_status
+ rc=$?
case $rc in
- $BOOTH_DAEMON_STARTED) return $OCF_SUCCESS;;
- $BOOTH_DAEMON_STARTING)
- while [ $rc != $BOOTH_DAEMON_STARTED ]; do
- sleep .7
- booth_check_daemon_state ; rc=$?
- done
- return $OCF_SUCCESS;;
- $BOOTH_DAEMON_NOT_RUNNING) ;;
- *) return $OCF_ERR_GENERIC;;
+ 0)
+ ocf_log info "boothd already running"
+ return $OCF_SUCCESS
+ ;;
+ $OCF_NOT_RUNNING) ;;
+ *) booth_site_stop ;;
esac
- "$OCF_RESKEY_daemon" daemon "-c$OCF_RESKEY_config" $OCF_RESKEY_args
-
- sleep 1.1
- rc=$BOOTH_DAEMON_STARTING
- while [ $rc != $BOOTH_DAEMON_STARTED ]; do
- booth_check_daemon_state; rc=$?
- sleep .8
+ $OCF_RESKEY_daemon daemon -c $OCF_RESKEY_config $OCF_RESKEY_args
+ sleep 1
+ while ! booth_site_status; do
+ sleep 1
done
-
+
return $OCF_SUCCESS
}
booth_site_stop() {
- booth_check_daemon_state; rc=$?
-
- case $rc in
- $BOOTH_DAEMON_STARTED) ;;
- $BOOTH_DAEMON_STARTING) ;;
- $BOOTH_DAEMON_NOT_RUNNING) return $OCF_SUCCESS;;
- *) return $OCF_ERR_GENERIC;;
- esac
-
-
- if [ "$booth_lockpid" == "" ] ; then
- return $OCF_ERR_GENERIC
- fi
- if pkill -TERM -s $booth_lockpid $DEFAULT_BIN ; then
- sleep 1
- pkill -KILL -s $booth_lockpid $DEFAULT_BIN
+ local pid
+ pid=`get_booth_pid`
+ if [ -z "$pid" ]; then
+ ocf_log info "boothd already stopped"
+ return $OCF_SUCCESS
fi
- rc=$BOOTH_DAEMON_STARTED
- while [ $rc != $BOOTH_DAEMON_NOT_RUNNING ]; do
- booth_check_daemon_state; rc=$?
- sleep 0.9
+ ocf_stop_processes TERM 5 $pid
+ while is_booth_running; do
+ sleep 1
done
-
- if [ $rc = $BOOTH_DAEMON_NOT_RUNNING ]; then
- rc=$OCF_SUCCESS
- else
- rc=$OCF_ERR_GENERIC
- fi
-
- return $rc
+ return $OCF_SUCCESS
}
booth_site_monitor() {
- booth_check_daemon_state; rc=$?
-
- case $rc in
- $BOOTH_DAEMON_STARTED) return $OCF_SUCCESS;;
- $BOOTH_DAEMON_STARTING) return $OCF_NOT_RUNNING;;
- $BOOTH_DAEMON_EXIST) return $OCF_NOT_RUNNING;;
- $BOOTH_DAEMON_NOT_RUNNING) return $OCF_NOT_RUNNING;;
- *) return $OCF_ERR_GENERIC;;
+ booth_site_status
+ case $? in
+ 0) return $OCF_SUCCESS ;;
+ $OCF_NOT_RUNNING) return $OCF_NOT_RUNNING ;;
+ *) return $OCF_ERR_GENERIC ;;
esac
}
booth_site_validate_all() {
- if ! test -f $OCF_RESKEY_config; then
- ocf_log err "$OCF_RESKEY_config does not exist"
- return $OCF_ERR_INSTALLED
- fi
-
- if ocf_is_true $OCF_RESKEY_CRM_meta_globally_unique; then
- ocf_log err "$OCF_RESOURCE_INSTANCE must be configured with the globally_unique=false meta attribute"
- return $OCF_ERR_CONFIGURED
- fi
+ if ! test -f $OCF_RESKEY_config; then
+ ocf_log err "$OCF_RESKEY_config does not exist"
+ return $OCF_ERR_INSTALLED
+ fi
- return $OCF_SUCCESS
+ if ocf_is_true $OCF_RESKEY_CRM_meta_globally_unique; then
+ ocf_log err "$OCF_RESOURCE_INSTANCE must be configured with the globally_unique=false meta attribute"
+ return $OCF_ERR_CONFIGURED
+ fi
+
+ return $OCF_SUCCESS
}
: ${OCF_RESKEY_daemon:=$DEFAULT_BIN}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/booth.h new/booth/src/booth.h
--- old/booth/src/booth.h 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/src/booth.h 2014-07-17 16:30:12.000000000 +0200
@@ -136,10 +136,10 @@
CMD_REVOKE = CHAR2CONST('C', 'R', 'v', 'k'),
/* Replies */
- CMR_GENERAL = CHAR2CONST('G', 'n', 'l', 'R'), // Increase distance to CMR_GRANT
- CMR_LIST = CHAR2CONST('R', 'L', 's', 't'),
- CMR_GRANT = CHAR2CONST('R', 'G', 'n', 't'),
- CMR_REVOKE = CHAR2CONST('R', 'R', 'v', 'k'),
+ CL_RESULT = CHAR2CONST('R', 's', 'l', 't'),
+ CL_LIST = CHAR2CONST('R', 'L', 's', 't'),
+ CL_GRANT = CHAR2CONST('R', 'G', 'n', 't'),
+ CL_REVOKE = CHAR2CONST('R', 'R', 'v', 'k'),
/* get status from another server */
OP_STATUS = CHAR2CONST('S', 't', 'a', 't'),
@@ -160,9 +160,11 @@
/* for compatibility with other functions */
RLT_SUCCESS = 0,
RLT_ASYNC = CHAR2CONST('A', 's', 'y', 'n'),
+ RLT_MORE = CHAR2CONST('M', 'o', 'r', 'e'),
RLT_SYNC_SUCC = CHAR2CONST('S', 'c', 'c', 's'),
RLT_SYNC_FAIL = CHAR2CONST('F', 'a', 'i', 'l'),
RLT_INVALID_ARG = CHAR2CONST('I', 'A', 'r', 'g'),
+ RLT_CIB_PENDING = CHAR2CONST('P', 'e', 'n', 'd'),
RLT_EXT_FAILED = CHAR2CONST('X', 'P', 'r', 'g'),
RLT_TICKET_IDLE = CHAR2CONST('T', 'i', 'd', 'l'),
RLT_OVERGRANT = CHAR2CONST('O', 'v', 'e', 'r'),
@@ -191,6 +193,7 @@
* grant */
typedef enum {
OPT_IMMEDIATE = 1,
+ OPT_WAIT = 2,
} cmd_options_t;
/** @} */
@@ -246,6 +249,7 @@
int client_add(int fd, const struct booth_transport *tpt,
void (*workfn)(int ci), void (*deadfn)(int ci));
+int find_client_by_fd(int fd);
int do_read(int fd, void *buf, size_t count);
int do_write(int fd, void *buf, size_t count);
void process_connection(int ci);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/config.c new/booth/src/config.c
--- old/booth/src/config.c 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/src/config.c 2014-07-17 16:30:12.000000000 +0200
@@ -245,12 +245,12 @@
static int validate_ticket(struct ticket_config *tk)
{
- if (tk->timeout*(tk->retries+1) >= tk->term_duration/2) {
+ if (tk->timeout*(tk->retries+1) >= tk->renewal_freq) {
tk_log_error("total amount of time to "
"retry sending packets cannot exceed "
- "half of the expiry time "
- "(%d*(%d+1) >= %d/2)",
- tk->timeout, tk->retries, tk->term_duration);
+ "renewal frequency "
+ "(%d*(%d+1) >= %d)",
+ tk->timeout, tk->retries, tk->renewal_freq);
return 0;
}
return 1;
@@ -308,7 +308,8 @@
char line[1024];
FILE *fp;
char *s, *key, *val, *end_of_key;
- const char *cp, *error;
+ const char *error;
+ char *cp, *cp2;
int i;
int lineno = 0;
int got_transport = 0;
@@ -558,6 +559,15 @@
continue;
}
+ if (strcmp(key, "renewal-freq") == 0) {
+ current_tk->renewal_freq = strtol(val, &s, 0);
+ if (*s || s == val || current_tk->renewal_freq<1) {
+ error = "Expected plain integer value >=1 for renewal-freq";
+ goto err;
+ }
+ continue;
+ }
+
if (strcmp(key, "acquire-after") == 0) {
current_tk->acquire_after = strtol(val, &s, 0);
if (*s || s == val || current_tk->acquire_after<0) {
@@ -596,19 +606,21 @@
/* Default: make config name match config filename. */
if (!booth_conf->name[0]) {
cp = strrchr(path, '/');
- if (!cp)
- cp = path;
-
- /* TODO: locale? */
- /* NUL-termination by memset. */
- for(i=0; iname[i] = *(cp++);
-
- /* Last resort. */
- if (!booth_conf->name[0])
- strcpy(booth_conf->name, "booth");
+ cp = cp ? cp+1 : (char *)path;
+ cp2 = strrchr(cp, '.');
+ if (!cp2)
+ cp2 = cp + strlen(cp);
+ if (cp2-cp >= BOOTH_NAME_LEN) {
+ log_error("booth config file name too long");
+ goto err;
+ }
+ strncpy(booth_conf->name, cp, cp2-cp);
+ *(booth_conf->name+(cp2-cp)) = '\0';
}
+ if (!current_tk->renewal_freq)
+ current_tk->renewal_freq = current_tk->term_duration/2;
+
return 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/config.h new/booth/src/config.h
--- old/booth/src/config.h 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/src/config.h 2014-07-17 16:30:12.000000000 +0200
@@ -55,6 +55,10 @@
* another site. */
int acquire_after; /* TODO: needed? */
+ /* How often to renew the ticket
+ */
+ int renewal_freq;
+
/* Program to ask whether it makes sense to
* acquire the ticket */
@@ -76,6 +80,9 @@
/** When something has to be done */
timetype next_cron;
+ /** The client which sent a request */
+ struct client *req_client;
+
/** Current leader. This is effectively the log[] in Raft. */
struct booth_site *leader;
@@ -145,6 +152,9 @@
*/
int start_postpone;
+ /** Last renewal time */
+ time_t last_renewal;
+
/* Do we need to update the copy in the CIB?
* Normally, the ticket is written only when it changes via
* the UPDATE RPC (for followers) and on expiration update
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/inline-fn.h new/booth/src/inline-fn.h
--- old/booth/src/inline-fn.h 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/src/inline-fn.h 2014-07-17 16:30:12.000000000 +0200
@@ -68,6 +68,7 @@
static inline void init_header_bare(struct boothc_header *h) {
+ assert(local && local->site_id);
h->magic = htonl(BOOTHC_MAGIC);
h->version = htonl(BOOTHC_VERSION);
h->from = htonl(local->site_id);
@@ -215,23 +216,11 @@
static inline time_t next_vote_starts_at(struct ticket_config *tk)
{
- time_t half_exp, retries_needed, t;
-
/* If not owner, don't renew. */
if (tk->leader != local)
return 0;
- /* Try to renew at half of expiry time. */
- half_exp = tk->term_expires - tk->term_duration/2;
- /* Also start renewal if we couldn't get
- * a few message retransmission in the alloted
- * expiry time. */
- retries_needed = tk->term_expires - tk->timeout * tk->retries/2;
-
- /* Return earlier timestamp. */
- t = min(half_exp, retries_needed);
-
- return t;
+ return tk->last_renewal + tk->renewal_freq;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/log.h new/booth/src/log.h
--- old/booth/src/log.h 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/src/log.h 2014-07-17 16:30:12.000000000 +0200
@@ -35,14 +35,13 @@
/* all tk_* macros prepend "%(tk->name): " (the caller needs to
* have the ticket named tk!)
*/
-#define tk_cl_log(sev, fmt, args...) cl_log(sev, "%s: " fmt, tk->name, ##args)
-#define tk_detailed_cl_log(sev, fmt, args...) \
+#define tk_cl_log(sev, fmt, args...) \
cl_log(sev, "%s (%s/%d/%d): " fmt, \
tk->name, state_to_string(tk->state), tk->current_term, term_time_left(tk), \
##args)
#define tk_log_debug(fmt, args...) do { \
- if (ANYDEBUG) tk_detailed_cl_log(LOG_DEBUG, fmt, ##args); } \
+ if (ANYDEBUG) tk_cl_log(LOG_DEBUG, fmt, ##args); } \
while (0)
#define tk_log_info(fmt, args...) tk_cl_log(LOG_INFO, fmt, ##args)
#define tk_log_warn(fmt, args...) tk_cl_log(LOG_WARNING, fmt, ##args)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/main.c new/booth/src/main.c
--- old/booth/src/main.c 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/src/main.c 2014-07-17 16:30:12.000000000 +0200
@@ -211,6 +211,17 @@
assert(!"no client");
}
+int find_client_by_fd(int fd)
+{
+ int i;
+
+ for (i = 0; i < client_size; i++) {
+ if (clients[i].fd == fd)
+ return i;
+ }
+ return -1;
+}
+
/* Only used for client requests, TCP ???*/
void process_connection(int ci)
@@ -261,24 +272,17 @@
goto kill;
case CMD_GRANT:
- /* Expect boothc_ticket_site_msg. */
- if (len != sizeof(msg))
- goto bad_len;
- ticket_answer_grant(fd, &msg);
- goto kill;
-
case CMD_REVOKE:
/* Expect boothc_ticket_site_msg. */
if (len != sizeof(msg))
goto bad_len;
-
- ticket_answer_revoke(fd, &msg);
- goto kill;
+ process_client_request(&clients[ci], &msg);
+ return;
default:
log_error("connection %d cmd %x unknown",
ci, ntohl(msg.header.cmd));
- init_header(&msg.header,CMR_GENERAL, 0, 0, RLT_INVALID_ARG, 0, sizeof(msg.header));
+ init_header(&msg.header, CL_RESULT, 0, 0, RLT_INVALID_ARG, 0, sizeof(msg.header));
send_header_only(fd, &msg.header);
goto kill;
}
@@ -532,6 +536,11 @@
goto out_free;
data_len = ntohl(reply.length) - sizeof(reply);
+ /* no tickets? */
+ if (!data_len) {
+ rv = 0;
+ goto out_close;
+ }
data = malloc(data_len);
if (!data) {
@@ -547,6 +556,7 @@
out_free:
free(data);
+out_close:
tpt->close(site);
out:
return rv;
@@ -556,7 +566,7 @@
static int test_reply(int reply_code, cmd_request_t cmd)
{
int rv = 0;
- const char *op_str;
+ const char *op_str = "";
if (cmd == CMD_GRANT)
op_str = "grant";
@@ -587,6 +597,15 @@
rv = 0;
break;
+ case RLT_CIB_PENDING:
+ log_info("%s succeeded (CIB commit pending)", op_str);
+ rv = 0;
+ break;
+
+ case RLT_MORE:
+ rv = 2;
+ break;
+
case RLT_SYNC_SUCC:
case RLT_SUCCESS:
log_info("%s succeeded!", op_str);
@@ -627,6 +646,13 @@
struct booth_transport const *tpt;
uint32_t leader_id;
int rv;
+ int reply_cnt = 0;
+ const char *op_str = "";
+
+ if (cmd == CMD_GRANT)
+ op_str = "grant";
+ else if (cmd == CMD_REVOKE)
+ op_str = "revoke";
rv = 0;
site = NULL;
@@ -673,19 +699,39 @@
if (rv < 0)
goto out_close;
+read_more:
rv = tpt->recv(site, &reply, sizeof(reply));
if (rv < 0)
goto out_close;
rv = test_reply(ntohl(reply.header.result), cmd);
- if (rv == 1) {
+ switch(rv) {
+ case 1:
local_transport->close(site);
leader_id = ntohl(reply.ticket.leader);
if (!find_site_by_id(leader_id, &site)) {
log_error("Message with unknown redirect site %x received", leader_id);
- return rv;
+ rv = -1;
+ goto out_close;
}
goto redirect;
+ case 2: /* the server has more to say */
+ /* don't wait too long */
+ if (reply_cnt > 1 && !(cl.options & OPT_WAIT)) {
+ rv = 0;
+ log_info("Giving up on waiting for the definite result. "
+ "Please use \"booth list\" later to "
+ "see the outcome.");
+ goto out_close;
+ }
+ if (reply_cnt == 0) {
+ log_info("%s request sent, "
+ "waiting for the result ...", op_str);
+ }
+ reply_cnt++;
+ goto read_more;
+ default:
+ break;
}
out_close:
@@ -822,12 +868,13 @@
printf(" -s site name\n");
printf(" -l LOCKFILE Specify lock file path (daemon only)\n");
printf(" -F Try to grant the ticket immediately (client only)\n");
+ printf(" -w Wait forever for the result (client only)\n");
printf(" -h Print this help, then exit\n");
printf("\n");
printf("Please see the man page for details.\n");
}
-#define OPTION_STRING "c:Dl:t:s:FhS"
+#define OPTION_STRING "c:Dl:t:s:FhSw"
void safe_copy(char *dest, char *value, size_t buflen, const char *description) {
int content_len = buflen - 1;
@@ -999,6 +1046,15 @@
cl.options |= OPT_IMMEDIATE;
break;
+ case 'w':
+ if (cl.type != CLIENT ||
+ (cl.op != CMD_GRANT && cl.op != CMD_REVOKE)) {
+ log_error("use \"-w\" only for grant and revoke");
+ exit(EXIT_FAILURE);
+ }
+ cl.options |= OPT_WAIT;
+ break;
+
case 'h':
print_usage();
exit(EXIT_SUCCESS);
@@ -1272,8 +1328,9 @@
set_scheduler();
set_oom_adj(-16);
- set_proc_title("%s %s for [%s]:%d",
+ set_proc_title("%s %s %s for [%s]:%d",
DAEMON_NAME,
+ cl.configfile,
type_to_string(local->type),
local->addr_string,
booth_conf->port);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/pacemaker.c new/booth/src/pacemaker.c
--- old/booth/src/pacemaker.c 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/src/pacemaker.c 2014-07-17 16:30:12.000000000 +0200
@@ -321,9 +321,11 @@
* Assume that the ticket belonged to us if it was
* granted here!
*/
- tk_log_warn("no site matches; site got reconfigured?");
+ log_warn("%s: no site matches; site got reconfigured?",
+ tk->name);
if (tk->is_granted) {
- tk_log_warn("granted here, assume it belonged to us");
+ log_warn("%s: granted here, assume it belonged to us",
+ tk->name);
tk->leader = local;
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/raft.c new/booth/src/raft.c
--- old/booth/src/raft.c 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/src/raft.c 2014-07-17 16:30:12.000000000 +0200
@@ -144,7 +144,6 @@
tk->voted_for = NULL;
ticket_broadcast(tk, OP_HEARTBEAT, OP_ACK, RLT_SUCCESS, 0);
- ticket_activate_timeout(tk);
}
@@ -225,6 +224,7 @@
site_string(new_leader));
} else {
tk_log_info("nobody won elections, new elections");
+ notify_client(tk, RLT_MORE);
if (!new_election(tk, NULL, is_tie(tk), OR_AGAIN)) {
ticket_activate_timeout(tk);
}
@@ -664,6 +664,10 @@
* ticket */
tk->in_election = 1;
+ /* reset ticket's leader on not valid tickets */
+ if (!valid)
+ tk->leader = NULL;
+
/* if it's a newer term or ... */
if (newer_term(tk, sender, leader, msg, 1)) {
clear_election(tk);
@@ -742,7 +746,6 @@
}
ticket_broadcast(tk, OP_REQ_VOTE, OP_VOTE_FOR, RLT_SUCCESS, reason);
- ticket_activate_timeout(tk);
add_random_delay(tk);
return 0;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/ticket.c new/booth/src/ticket.c
--- old/booth/src/ticket.c 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/src/ticket.c 2014-07-17 16:30:12.000000000 +0200
@@ -95,11 +95,40 @@
}
+/* is it safe to commit the grant?
+ * if we didn't hear from all sites on the initial grant, we may
+ * need to delay the commit
+ *
+ * TODO: investigate possibility to devise from history whether a
+ * missing site could be holding a ticket or not
+ */
+static int ticket_dangerous(struct ticket_config *tk)
+{
+ if (!tk->delay_commit)
+ return 0;
+
+ if (tk->delay_commit <= get_secs(NULL) ||
+ all_sites_replied(tk)) {
+ tk_log_info("ticket delay expired, committing to CIB");
+ tk->delay_commit = 0;
+ return 0;
+ } else {
+ tk_log_debug("delay ticket commit for %ds",
+ (int)(tk->delay_commit - get_secs(NULL)));
+ }
+
+ return 1;
+}
+
+
int ticket_write(struct ticket_config *tk)
{
if (local->type != SITE)
return -EINVAL;
+ if (ticket_dangerous(tk))
+ return 1;
+
if (tk->leader == local) {
pcmk_handler.grant_ticket(tk);
} else {
@@ -145,10 +174,13 @@
*/
int acquire_ticket(struct ticket_config *tk, cmd_reason_t reason)
{
+ int rc;
+
if (test_external_prog(tk, 0))
return RLT_EXT_FAILED;
- return new_election(tk, local, 1, reason);
+ rc = new_election(tk, local, 1, reason);
+ return rc ? RLT_SYNC_FAIL : 0;
}
@@ -176,21 +208,23 @@
}
rv = acquire_ticket(tk, OR_ADMIN);
- if (rv)
+ if (rv) {
tk->delay_commit = 0;
- return rv;
+ return rv;
+ } else {
+ return RLT_MORE;
+ }
}
-static int start_revoke_ticket(struct ticket_config *tk)
+static void start_revoke_ticket(struct ticket_config *tk)
{
tk_log_info("revoking ticket");
reset_ticket(tk);
tk->leader = no_leader;
ticket_write(tk);
- ticket_activate_timeout(tk);
- return ticket_broadcast(tk, OP_REVOKE, OP_ACK, RLT_SUCCESS, OR_ADMIN);
+ ticket_broadcast(tk, OP_REVOKE, OP_ACK, RLT_SUCCESS, OR_ADMIN);
}
/** Ticket revoke.
@@ -200,9 +234,10 @@
if (tk->acks_expected) {
tk_log_info("delay ticket revoke until the current operation finishes");
tk->next_state = ST_INIT;
- return 0;
+ return RLT_MORE;
} else {
- return start_revoke_ticket(tk);
+ start_revoke_ticket(tk);
+ return RLT_SUCCESS;
}
}
@@ -405,60 +440,41 @@
if (rv < 0)
return rv;
- init_header(&hdr, CMR_LIST, 0, 0, RLT_SUCCESS, 0, sizeof(hdr) + olen);
+ init_header(&hdr, CL_LIST, 0, 0, RLT_SUCCESS, 0, sizeof(hdr) + olen);
return send_header_plus(fd, &hdr, data, olen);
}
-int ticket_answer_grant(int fd, struct boothc_ticket_msg *msg)
+int process_client_request(struct client *req_client, struct boothc_ticket_msg *msg)
{
int rv;
struct ticket_config *tk;
+ int cmd;
-
+ cmd = ntohl(msg->header.cmd);
if (!check_ticket(msg->ticket.id, &tk)) {
- log_warn("client asked to grant unknown ticket %s",
+ log_warn("client referenced unknown ticket %s",
msg->ticket.id);
rv = RLT_INVALID_ARG;
goto reply;
}
- if (is_owned(tk)) {
+ if ((cmd == CMD_GRANT) && is_owned(tk)) {
log_warn("client wants to grant an (already granted!) ticket %s",
msg->ticket.id);
rv = RLT_OVERGRANT;
goto reply;
}
- rv = do_grant_ticket(tk, ntohl(msg->header.options));
-
-reply:
- init_header(&msg->header, CMR_GRANT, 0, 0, rv ?: RLT_ASYNC, 0, sizeof(*msg));
- return send_ticket_msg(fd, msg);
-}
-
-
-int ticket_answer_revoke(int fd, struct boothc_ticket_msg *msg)
-{
- int rv;
- struct ticket_config *tk;
-
- if (!check_ticket(msg->ticket.id, &tk)) {
- log_warn("client wants to revoke an unknown ticket %s",
- msg->ticket.id);
- rv = RLT_INVALID_ARG;
- goto reply;
- }
-
- if (!is_owned(tk)) {
+ if ((cmd == CMD_REVOKE) && !is_owned(tk)) {
log_info("client wants to revoke a free ticket %s",
msg->ticket.id);
rv = RLT_TICKET_IDLE;
goto reply;
}
- if (tk->leader != local) {
+ if ((cmd == CMD_REVOKE) && tk->leader != local) {
log_info("the ticket %s is not granted here, "
"redirect to %s",
msg->ticket.id, ticket_leader_string(tk));
@@ -466,15 +482,45 @@
goto reply;
}
- rv = do_revoke_ticket(tk);
- if (rv == 0)
- rv = RLT_ASYNC;
+ if (cmd == CMD_REVOKE)
+ rv = do_revoke_ticket(tk);
+ else
+ rv = do_grant_ticket(tk, ntohl(msg->header.options));
+
+ if (rv == RLT_MORE) {
+ /* client may receive further notifications */
+ tk->req_client = req_client;
+ }
reply:
- init_ticket_msg(msg, CMR_REVOKE, 0, rv, 0, tk);
- return send_ticket_msg(fd, msg);
+ init_ticket_msg(msg, CL_RESULT, 0, rv, 0, tk);
+ return send_ticket_msg(req_client->fd, msg);
}
+void notify_client(struct ticket_config *tk, int rv)
+{
+ struct boothc_ticket_msg omsg;
+ void (*deadfn) (int ci);
+ int rc, ci;
+
+ if (!tk->req_client)
+ return;
+
+ init_ticket_msg(&omsg, CL_RESULT, 0, rv, 0, tk);
+ rc = send_ticket_msg(tk->req_client->fd, &omsg);
+
+ /* we sent a definite answer or there was a write error, drop
+ * the client */
+ if (rv != RLT_MORE || rc) {
+ deadfn = tk->req_client->deadfn;
+ if(deadfn) {
+ ci = find_client_by_fd(tk->req_client->fd);
+ if (ci >= 0)
+ deadfn(ci);
+ }
+ tk->req_client = NULL;
+ }
+}
int ticket_broadcast(struct ticket_config *tk,
cmd_request_t cmd, cmd_request_t expected_reply,
@@ -492,63 +538,45 @@
if (expected_reply) {
expect_replies(tk, expected_reply);
}
+ ticket_activate_timeout(tk);
return transport()->broadcast(&msg, sizeof(msg));
}
-/* is it safe to commit the grant?
- * if we didn't hear from all sites on the initial grant, we may
- * need to delay the commit
- *
- * TODO: investigate possibility to devise from history whether a
- * missing site could be holding a ticket or not
- */
-static int ticket_dangerous(struct ticket_config *tk)
-{
- if (!tk->delay_commit)
- return 0;
-
- if (tk->delay_commit <= get_secs(NULL) ||
- all_sites_replied(tk)) {
- tk_log_debug("ticket delay commit expired");
- tk->delay_commit = 0;
- return 0;
- } else {
- tk_log_debug("delay ticket commit for %ds",
- (int)(tk->delay_commit - get_secs(NULL)));
- }
-
- return 1;
-}
-
-
/* update the ticket on the leader, write it to the CIB, and
send out the update message to others with the new expiry
time
*/
int leader_update_ticket(struct ticket_config *tk)
{
- int rv = 0;
+ int rv = 0, rv2;
+ time_t now = get_secs(NULL);
if (tk->ticket_updated >= 2)
return 0;
if (tk->ticket_updated < 1) {
tk->ticket_updated = 1;
- tk->term_expires = get_secs(NULL) + tk->term_duration;
+ tk->last_renewal = now;
+ tk->term_expires = now + tk->term_duration;
rv = ticket_broadcast(tk, OP_UPDATE, OP_ACK, RLT_SUCCESS, 0);
}
if (tk->ticket_updated < 2) {
- if (!ticket_dangerous(tk)) {
+ rv2 = ticket_write(tk);
+ switch(rv2) {
+ case 0:
tk->ticket_updated = 2;
- ticket_write(tk);
- } else {
- /* log just once, on the first retry */
- if (tk->retry_number == 1)
- tk_log_info("delaying ticket commit to CIB for %ds "
- "(or all sites are reached)",
- (int)(tk->delay_commit - get_secs(NULL)));
+ notify_client(tk, RLT_SUCCESS);
+ break;
+ case 1:
+ tk_log_info("delaying ticket commit to CIB for %ds "
+ "(or all sites are reached)",
+ (int)(tk->delay_commit - now));
+ notify_client(tk, RLT_CIB_PENDING);
+ break;
+ default:
+ break;
}
}
@@ -570,10 +598,11 @@
for (i = 0; i < booth_conf->site_count; i++) {
n = booth_conf->site + i;
if (!(tk->acks_received & n->bitmask)) {
- tk_log_warn("%s %s didn't acknowledge our request, "
+ tk_log_warn("%s %s didn't acknowledge our %s, "
"will retry %d times",
(n->type == ARBITRATOR ? "arbitrator" : "site"),
site_string(n),
+ state_to_string(tk->last_request),
tk->retries);
}
}
@@ -597,6 +626,7 @@
send_msg(tk->last_request, tk, n, NULL);
}
}
+ ticket_activate_timeout(tk);
}
}
@@ -633,19 +663,10 @@
}
} else {
log_lost_servers(tk);
- if (tk->last_request == OP_HEARTBEAT &&
- is_owned(tk)) {
- /* we have the majority, update the ticket, at
- * least the local copy if we're still not
- * allowed to commit
- */
- leader_update_ticket(tk);
- }
}
just_resend:
resend_msg(tk);
- ticket_activate_timeout(tk);
}
int postpone_ticket_processing(struct ticket_config *tk)
@@ -665,6 +686,7 @@
case ST_INIT:
no_resends(tk);
start_revoke_ticket(tk);
+ notify_client(tk, RLT_SUCCESS);
break;
/* wanting to be follower is not much of an ambition; no
* processing, just return; don't reset start_postpone until
@@ -738,7 +760,6 @@
/* this is ticket renewal, run local test */
if (!test_external_prog(tk, 1)) {
ticket_broadcast(tk, OP_HEARTBEAT, OP_ACK, RLT_SUCCESS, 0);
- ticket_activate_timeout(tk);
}
}
break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/ticket.h new/booth/src/ticket.h
--- old/booth/src/ticket.h 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/src/ticket.h 2014-07-17 16:30:12.000000000 +0200
@@ -61,10 +61,8 @@
int acquire_ticket(struct ticket_config *tk, cmd_reason_t reason);
int ticket_answer_list(int fd, struct boothc_ticket_msg *msg);
-int ticket_answer_grant(int fd, struct boothc_ticket_msg *msg);
-int ticket_answer_revoke(int fd, struct boothc_ticket_msg *msg);
-
-int ticket_broadcast_proposed_state(struct ticket_config *tk, cmd_request_t state);
+int process_client_request(struct client *req_client,
+ struct boothc_ticket_msg *msg);
int ticket_write(struct ticket_config *tk);
@@ -75,6 +73,7 @@
cmd_result_t code, struct boothc_ticket_msg *in_msg);
int send_msg (int cmd, struct ticket_config *tk,
struct booth_site *dest, struct boothc_ticket_msg *in_msg);
+void notify_client(struct ticket_config *tk, int rv);
int ticket_broadcast(struct ticket_config *tk, cmd_request_t cmd, cmd_request_t expected_reply, cmd_result_t res, cmd_reason_t reason);
int leader_update_ticket(struct ticket_config *tk);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/transport.c new/booth/src/transport.c
--- old/booth/src/transport.c 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/src/transport.c 2014-07-17 16:30:12.000000000 +0200
@@ -477,8 +477,10 @@
int got;
/* Needs timeouts! */
got = do_read(from->tcp_fd, buf, len);
- if (got < 0)
+ if (got < 0) {
+ log_error("read failed (%d): %s", errno, strerror(errno));
return got;
+ }
return len;
}
@@ -597,13 +599,12 @@
if (rv == len) {
rv = 0;
} else if (rv < 0) {
- rv = errno;
log_error("Cannot send to %s: %d %s",
site_string(to),
errno,
strerror(errno));
} else {
- rv = EBUSY;
+ rv = -1;
log_error("Packet sent to %s got truncated",
site_string(to));
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/test/live_test.sh new/booth/test/live_test.sh
--- old/booth/test/live_test.sh 2014-07-03 17:11:10.000000000 +0200
+++ new/booth/test/live_test.sh 2014-07-17 16:30:12.000000000 +0200
@@ -284,8 +284,9 @@
}
get_tkt_settings() {
awk '
-n && /^ / && /expire|timeout/ {
+n && /^ / && /expire|timeout|renewal-freq/ {
sub(" = ", "=", $0);
+ gsub("-", "_", $0);
sub("^ ", "T_", $0);
print
next
@@ -294,29 +295,11 @@
/^ticket.*'$tkt'/ {n=1}
' $cnf
}
-wait_booth() {
- local maxwait=$T_expire testcmd="$@"
- while sleep 1; do
- run_site 1 booth list | grep $tkt | booth_list_fld 2 |
- $testcmd && break
- maxwait=$((maxwait-1))
- [ $maxwait -eq 0 ] && {
- echo "booth wait failed"
- return 1
- }
- done
-}
-wait_revoke() {
- wait_booth grep -iq none
-}
-wait_grant() {
- wait_booth grep -iqv none
-}
wait_exp() {
sleep $T_expire
}
-wait_half_exp() {
- sleep $((T_expire/2))
+wait_renewal() {
+ sleep $T_renewal_freq
}
wait_timeout() {
local t=2
@@ -491,13 +474,15 @@
}
revoke_ticket() {
run_site 1 booth revoke $tkt >/dev/null
- wait_revoke
wait_timeout
}
run_report() {
local start_ts=$1 end_ts=$2 name=$3
+ local quick_opt=""
logmsg "running hb_report"
- hb_report -f "`date -d @$((start_ts-5))`" \
+ hb_report -Q 2>&1 | grep -sq "illegal.option" ||
+ quick_opt="-Q"
+ hb_report $hb_report_opts -f "`date -d @$((start_ts-5))`" \
-t "`date -d @$((end_ts+60))`" \
-n "$sites $arbitrators" $name 2>&1 | logmsg
}
@@ -557,6 +542,10 @@
usage 1
}
+if [ -z "$T_renewal_freq" ]; then
+ T_renewal_freq=$((T_expire/2))
+fi
+
exec 2>$logf
BASH_XTRACEFD=2
PS4='+ `date +"%T"`: '
@@ -572,7 +561,6 @@
# most tests start like this
grant2site_one() {
run_site 1 booth grant $tkt >/dev/null
- wait_grant
wait_timeout
}
@@ -609,7 +597,6 @@
done >/dev/null 2>&1
sleep 1
run_site 1 booth grant $tkt >/dev/null
- wait_grant
}
check_grant_noarb() {
check_consistency `get_site 1`
@@ -640,7 +627,6 @@
# just a grant to another site
test_grant_elsewhere() {
run_site 1 booth grant -s `get_site 2` $tkt >/dev/null
- wait_grant
}
check_grant_elsewhere() {
check_consistency `get_site 2`
@@ -653,7 +639,6 @@
stop_site `get_site 2`
wait_timeout
run_site 1 booth grant $tkt >/dev/null
- wait_grant
check_cib `get_site 1` || return 1
wait_exp
}
@@ -670,7 +655,6 @@
test_simultaneous_start_even() {
local serv
run_site 2 booth grant $tkt >/dev/null
- wait_grant
stop_booth
wait_timeout
for serv in $(echo $sites | sed "s/`get_site 1` //"); do
@@ -679,7 +663,7 @@
for serv in $arbitrators; do
start_arbitrator $serv &
done
- wait_half_exp
+ wait_renewal
start_site `get_site 1`
wait_timeout
wait_timeout
@@ -827,7 +811,7 @@
grant2site_one
break_external_prog 1
show_pref 1 || return 1
- wait_half_exp
+ wait_renewal
wait_timeout
}
check_external_prog_failed() {
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org