-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS-4747: make marking parent proxies down in hostdb configurable. #1464
Conversation
Intel CC build successful! See https://ci.trafficserver.apache.org/job/icc-github/12/ for details. |
mgmt/RecordsConfig.cc
Outdated
@@ -518,6 +518,8 @@ static const RecordElement RecordsConfig[] = | |||
, | |||
{RECT_CONFIG, "proxy.config.http.parent_proxy.connect_attempts_timeout", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL} | |||
, | |||
{RECT_CONFIG, "proxy.config.http.update_hostdb_on_parent_proxy_connect_errors", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a rather long name of a configuration ... :) And it doesn't feel properly "name spaced" ? How about
CONFIG proxy.config.hostdb.mark_parent_down INT 0
or perhaps
CONFIG proxy.config.http.parent_proxy.mark_down_hostdb INT 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fwiw, I like the first of my two alternative best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it is long, i prefer your second suggestion since it's used in the http transaction to update or not hostdb. All the ones named spaced to proxy.config.hostdb are internal to hostdb and its configuration. But if you prefer #1, I'll use it.
proxy/http/HttpConfig.cc
Outdated
@@ -1255,6 +1257,7 @@ HttpConfig::reconfigure() | |||
params->oride.parent_connect_attempts = m_master.oride.parent_connect_attempts; | |||
params->per_parent_connect_attempts = m_master.per_parent_connect_attempts; | |||
params->parent_connect_timeout = m_master.parent_connect_timeout; | |||
params->parent_failures_update_hostdb = m_master.parent_failures_update_hostdb; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this configuration overridable instead? Or are we positive that this is something we always want completely on, or completely off? In general, new configurations ought to be overridable unless it's impossible to do so (i.e. configs outside of the HttpSM are difficult to make overridable).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats a good point. In our case we would never mark a parent down in hostdb so completely off works for us. However making it overidable is a good idea. Let me make changes.
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/freebsd-github/1579/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1473/ for details. |
clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/144/ for details. |
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/freebsd-github/1580/ for details. |
Intel CC build successful! See https://ci.trafficserver.apache.org/job/icc-github/13/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1474/ for details. |
clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/145/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1476/ for details. |
Intel CC build successful! See https://ci.trafficserver.apache.org/job/icc-github/15/ for details. |
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/freebsd-github/1582/ for details. |
clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/147/ for details. |
@zwoop, @bryancall, @PSUdaemon - changes were made, see last two commits. changed the config variable name and made it overridable. Tested with header_rewrite plugin and traffic_ctl |
[approve ci] |
Intel CC build successful! See https://ci.trafficserver.apache.org/job/icc-github/16/ for details. |
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/freebsd-github/1583/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1477/ for details. |
clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/148/ for details. |
proxy/InkAPI.cc
Outdated
@@ -8153,6 +8153,10 @@ _conf_to_memberp(TSOverridableConfigKey conf, OverridableHttpConfigParams *overr | |||
typ = OVERRIDABLE_TYPE_STRING; | |||
ret = &overridableHttpConfig->client_cert_filepath; | |||
break; | |||
case TS_CONFIG_PARENT_FAILURES_UPDATE_HOSTDB: | |||
typ = OVERRIDABLE_TYPE_INT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I see this, this type should probably be 'byte'. See some of the earlier examples how to do that (both in the SM structs as well as here). OVERRiDABLE_TYPE_BYTE is also the default, and we should use that (I probably need to take a look at this, to make sure it's done correctly elsewhere as well).
Also, I think the way this was written, the string types were all collected towards the end. Not sure that's important any more, but might be worth keeping that semantics?
proxy/http/HttpConfig.h
Outdated
@@ -563,6 +564,7 @@ struct OverridableHttpConfigParams { | |||
// hostdb/dns variables // | |||
////////////////////////// | |||
MgmtByte srv_enabled; | |||
MgmtInt parent_failures_update_hostdb; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, similar to above, but i think this should be MgmtByte.
changed type on parent_failures_update_hostdb from MgmtInt to MgmtByte. |
Intel CC build successful! See https://ci.trafficserver.apache.org/job/icc-github/22/ for details. |
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/freebsd-github/1589/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1483/ for details. |
clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/154/ for details. |
@zwoop All changes are in, see the commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/freebsd-github/1605/ for details. |
Intel CC build successful! See https://ci.trafficserver.apache.org/job/icc-github/37/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1499/ for details. |
Intel CC build successful! See https://ci.trafficserver.apache.org/job/icc-github/38/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1500/ for details. |
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/freebsd-github/1606/ for details. |
clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/169/ for details. |
clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/170/ for details. |
For the use case where a parent in parent.config has multiple ip's for failover, TS-4747 added marking the parent down in hostdb so that subsequent requests to the parent would go to another ip/host. For parent proxies listed in parent.config tat are not using multiple ips for failover, it is not desirable to mark the parent proxy down in hostdb as the parent selection system will manage the availability of the parent.
This PR reverts to the original behavior where parent proxies are not marked down in hostdb but adds a configuration option so that need parent proxies marked down in hostdb may enable it.