default: false
services:
- rgw
+ see_also:
+ - rgw_rest_conn_ip_fail_timeout_secs
+ with_legacy: true
+- name: rgw_rest_conn_ip_fail_timeout_secs
+ desc: IP failure tracking timeout (requires rgw_rest_conn_connect_to_resolved_ips=true)
+ type: uint
+ level: advanced
+ long_desc: When rgw_rest_conn_connect_to_resolved_ips is enabled, RGW tracks
+ per-IP connection failures by remembering the timestamp of the most recent
+ failure. This option controls how long (in seconds) an IP address remains
+ marked as "failed" before RGW considers it eligible for retry.
+ After this timeout expires, the IP will be tried again in the normal
+ round-robin rotation.
+ default: 2
+ services:
+ - rgw
+ see_also:
+ - rgw_rest_conn_connect_to_resolved_ips
with_legacy: true
- name: rgw_obj_stripe_size
type: size
return;
}
- static constexpr uint32_t CONN_STATUS_EXPIRE_SECS = 2;
+ const auto ip_fail_timeout = cct->_conf->rgw_rest_conn_ip_fail_timeout_secs;
const size_t num_ips = resolved_endpoint.resolved_ips.size();
// Round-robin through IPs, skipping any that are marked down
}
auto diff = ceph::to_seconds<double>(ceph::real_clock::now() - last_fail);
- if (diff >= CONN_STATUS_EXPIRE_SECS) {
+ if (diff >= ip_fail_timeout) {
// Failure expired, mark IP as up and use it
ip_status.mark_up();
ldout(cct, 5) << "IP " << ip_status.connect_to << " failure expired, marking up" << dendl;
return -EINVAL;
}
- static constexpr uint32_t CONN_STATUS_EXPIRE_SECS = 2;
+ const auto ip_fail_timeout = cct->_conf->rgw_rest_conn_ip_fail_timeout_secs;
auto now = ceph::real_clock::now();
// Helper to check if an endpoint has at least one available IP
// Fast path: if no recent failures at endpoint level, all IPs are available
const auto& ep_last_fail = res_ep.last_failure_time.load();
if (ceph::real_clock::is_zero(ep_last_fail) ||
- ceph::to_seconds<double>(now - ep_last_fail) >= CONN_STATUS_EXPIRE_SECS) {
+ ceph::to_seconds<double>(now - ep_last_fail) >= ip_fail_timeout) {
return true;
}
return true; // This IP is up
}
auto diff = ceph::to_seconds<double>(now - last_fail);
- if (diff >= CONN_STATUS_EXPIRE_SECS) {
+ if (diff >= ip_fail_timeout) {
return true; // This IP's failure has expired
}
}
* ResolvedIP - Per-IP connection status tracking.
*
* Each resolved IP address has its own failure status. An IP is considered
- * "down" if last_failure is non-zero and less than CONN_STATUS_EXPIRE_SECS old.
+ * "down" if last_failure is non-zero and less than rgw_rest_conn_ip_fail_timeout_secs old.
* After the timeout, the IP becomes eligible for retry.
*/
struct ResolvedIP {