Author: rjung Date: Sat Jan 27 06:41:05 2007 New Revision: 500537 URL: http://svn.apache.org/viewvc?view=rev&rev=500537 Log: Do not try to recover load balancer sub workers multiple times in parallel (except when doing forced recovery). Use additional runtime states "PROBE" and "FORCED". Typical state cycles are: OK->ERROR->RECOVER->PROBE->OK/ERROR. and OK->ERROR->FORCED->OK/ERROR.
Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h tomcat/connectors/trunk/jk/native/common/jk_status.c tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml tomcat/connectors/trunk/jk/xdocs/reference/status.xml tomcat/connectors/trunk/jk/xdocs/reference/workers.xml Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c?view=diff&rev=500537&r1=500536&r2=500537 ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original) +++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Sat Jan 27 06:41:05 2007 @@ -40,8 +40,8 @@ * The load balancing code in this */ -#define JK_WORKER_USABLE(w) ((w)->state != JK_LB_STATE_ERROR && (w)->state != JK_LB_STATE_BUSY && (w)->activation != JK_LB_ACTIVATION_STOPPED && (w)->activation != JK_LB_ACTIVATION_DISABLED) -#define JK_WORKER_USABLE_STICKY(w) ((w)->state != JK_LB_STATE_ERROR && (w)->activation != JK_LB_ACTIVATION_STOPPED) +#define JK_WORKER_USABLE(w) ((w)->state != JK_LB_STATE_ERROR && (w)->state != JK_LB_STATE_PROBE && (w)->state != JK_LB_STATE_BUSY && (w)->activation != JK_LB_ACTIVATION_STOPPED && (w)->activation != JK_LB_ACTIVATION_DISABLED) +#define JK_WORKER_USABLE_STICKY(w) ((w)->state != JK_LB_STATE_ERROR && (w)->state != JK_LB_STATE_PROBE && (w)->activation != JK_LB_ACTIVATION_STOPPED) static const char *lb_locking_type[] = { JK_LB_LOCK_TEXT_OPTIMISTIC, @@ -65,6 +65,8 @@ JK_LB_STATE_TEXT_RECOVER, JK_LB_STATE_TEXT_BUSY, JK_LB_STATE_TEXT_ERROR, + JK_LB_STATE_TEXT_FORCE, + JK_LB_STATE_TEXT_PROBE, "unknown", NULL }; @@ -172,6 +174,10 @@ return JK_LB_STATE_BUSY; else if (*v == 'e' || *v == 'E' || *v == '4') return JK_LB_STATE_ERROR; + else if (*v == 'f' || *v == 'F' || *v == '5') + return JK_LB_STATE_FORCE; + else if (*v == 'p' || *v == 'P' || *v == '6') + return JK_LB_STATE_PROBE; else return JK_LB_STATE_DEF; } @@ -446,7 +452,7 @@ jk_log(l, JK_LOG_INFO, "worker %s is marked for recovery", w->s->name); - w->s->state = JK_LB_STATE_RECOVER; + w->s->state = JK_LB_STATE_FORCE; forced++; } } @@ -857,6 +863,9 @@ int retry_wait = JK_LB_MIN_RETRY_WAIT; s->route = rec->r; prec = rec; + + if (rec->s->state == JK_LB_STATE_RECOVER) + rec->s->state = JK_LB_STATE_PROBE; if (JK_IS_DEBUG_LEVEL(l)) jk_log(l, JK_LOG_DEBUG, Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h?view=diff&rev=500537&r1=500536&r2=500537 ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h (original) +++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h Sat Jan 27 06:41:05 2007 @@ -62,13 +62,17 @@ #define JK_LB_STATE_RECOVER (2) #define JK_LB_STATE_BUSY (3) #define JK_LB_STATE_ERROR (4) +#define JK_LB_STATE_FORCE (5) +#define JK_LB_STATE_PROBE (6) #define JK_LB_STATE_DEF (JK_LB_STATE_NA) #define JK_LB_STATE_TEXT_NA ("N/A") #define JK_LB_STATE_TEXT_OK ("OK") #define JK_LB_STATE_TEXT_RECOVER ("REC") #define JK_LB_STATE_TEXT_BUSY ("BSY") #define JK_LB_STATE_TEXT_ERROR ("ERR") -#define JK_LB_STATE_TEXT_MAX (JK_LB_STATE_ERROR) +#define JK_LB_STATE_TEXT_FORCE ("FRC") +#define JK_LB_STATE_TEXT_PROBE ("PRB") +#define JK_LB_STATE_TEXT_MAX (JK_LB_STATE_PROBE) #define JK_LB_STATE_TEXT_DEF (JK_LB_STATE_TEXT_NA) #define JK_LB_ACTIVATION_ACTIVE (0) #define JK_LB_ACTIVATION_DISABLED (1) Modified: tomcat/connectors/trunk/jk/native/common/jk_status.c URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_status.c?view=diff&rev=500537&r1=500536&r2=500537 ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_status.c (original) +++ tomcat/connectors/trunk/jk/native/common/jk_status.c Sat Jan 27 06:41:05 2007 @@ -595,6 +595,12 @@ case JK_LB_STATE_RECOVER: mask &= JK_STATUS_MASK_RECOVER; break; + case JK_LB_STATE_FORCE: + mask &= JK_STATUS_MASK_RECOVER; + break; + case JK_LB_STATE_PROBE: + mask &= JK_STATUS_MASK_RECOVER; + break; default: jk_log(l, JK_LOG_WARNING, "Unknown state type '%d'", @@ -2260,7 +2266,8 @@ "<tr><th>Act</th><td>Worker activation configuration<br/>\n" "ACT=Active, DIS=Disabled, STP=Stopped</td></tr>\n" "<tr><th>Stat</th><td>Worker error status<br/>\n" - "OK=OK, N/A=Unknown, ERR=Error, REC=Recovering, BSY=Busy</td></tr>\n" + "OK=OK, N/A=Unknown, ERR=Error, BSY=Busy<br/>\n" + "REC=Recovering, PRB=Probing, FRC=Forced Recovery</td></tr>\n" "<tr><th>D</th><td>Worker distance</td></tr>\n" "<tr><th>F</th><td>Load Balancer factor</td></tr>\n" "<tr><th>M</th><td>Load Balancer multiplicity</td></tr>\n" Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?view=diff&rev=500537&r1=500536&r2=500537 ============================================================================== --- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original) +++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Sat Jan 27 06:41:05 2007 @@ -26,6 +26,10 @@ <br /> <subsection name="Native"> <changelog> + <add> + Load Balancer: Do not try to recover multiple times in parallel. + Use additional runtime states "PROBE" and "FORCED". (rjung) + </add> <fix> JkStatus: Improve data synchronization between different processes. (rjung) </fix> Modified: tomcat/connectors/trunk/jk/xdocs/reference/status.xml URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/reference/status.xml?view=diff&rev=500537&r1=500536&r2=500537 ============================================================================== --- tomcat/connectors/trunk/jk/xdocs/reference/status.xml (original) +++ tomcat/connectors/trunk/jk/xdocs/reference/status.xml Sat Jan 27 06:41:05 2007 @@ -273,7 +273,8 @@ </p> <p> The categorization is based on the activation state of the workers (active, disabled or stopped), -which is a pure configuration state, and the runtime state (OK, N/A, busy, recovering, error) +which is a pure configuration state, and the runtime state +(OK, N/A, busy, recovering, probing, forced recovery, error) which only depends on the runtime situation. </p> <p> @@ -288,7 +289,9 @@ You can define other rules for the grouping into good, bad and degraded. The two attributes "good" and "bad" can be populated by a comma-separated list ob single characters or dot-separated pairs. Each character stands for the first character of one of the possible states "active", -"disabled", "stopped", "ok", "na", "busy", "recovering" and "error". Comma-separated entries will be combined +"disabled", "stopped", "ok", "na", "busy", "recovering" and "error". The additional states "probing" +and "forced recovery" are always rated equivalent to "recovering". +Comma-separated entries will be combined with logical "or", if you combine a configuration and a runtime state with a dot. the are combined with logical "and". So the default value for "good" is "a.o,a.n,a.b,a.r", for "bad" it is "e,s". </p> Modified: tomcat/connectors/trunk/jk/xdocs/reference/workers.xml URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/reference/workers.xml?view=diff&rev=500537&r1=500536&r2=500537 ============================================================================== --- tomcat/connectors/trunk/jk/xdocs/reference/workers.xml (original) +++ tomcat/connectors/trunk/jk/xdocs/reference/workers.xml Sat Jan 27 06:41:05 2007 @@ -399,7 +399,7 @@ <p> These states are determined depending on the activation of the members (active, disabled, stopped) and their runtime state -(ok, n/a, busy, recovering, error). +(ok, n/a, busy, recovering, probing, forced recovery, error). By default, members are assumed to be "good", if their activation is "active" and their runtime state is not "error". </p> @@ -409,7 +409,9 @@ and one match suffices. Each value is either a single character, or two characters combined with a dot ".". The single characters are the first characters in the words "active", "disabled", "stopped", -"ok", "na", "busy", "recovering", "error". If a value consists only +"ok", "na", "busy", "recovering", "error". The additional states "probing" +and "forced recovery" are always rated equivalent to "recovering". +If a value consists only of a single character, then all members with this activation or runtime state will be assumed good. A combination of an activation and a runtime state concatenated with a dot "." does only apply to a member, that has --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]