Commit aefbecac authored by Thong Kuah's avatar Thong Kuah

Merge branch 'add-docs-for-srv-handling' into 'master'

Document SRV handling for DB load balancing

Closes #14049 and #14048

See merge request gitlab-org/gitlab-ee!16000
parents 8d848869 a36028e9
......@@ -146,7 +146,11 @@ The following options can be set:
| `use_tcp` | Lookup DNS resources using TCP instead of UDP | false |
If `record_type` is set to `SRV`, GitLab will continue to use a round-robin algorithm
and will ignore the `weight` and `priority` in the record.
and will ignore the `weight` and `priority` in the record. Since SRV records usually
return hostnames instead of IPs, GitLab will look for the IPs of returned hostnames
in the additional section of the SRV response. If no IP is found for a hostname, Gitlab
will query the configured `nameserver` for ANY record for each such hostname looking for A or AAAA records, eventually
dropping this hostname from rotation if it can't resolve its IP.
The `interval` value specifies the _minimum_ time between checks. If the A
record has a TTL greater than this value, then service discovery will honor said
......
---
title: Document SRV handling for DB load balancing
merge_request: 16000
author:
type: other
......@@ -3,6 +3,12 @@
module Gitlab
module Database
module LoadBalancing
# Hostnames returned in SRV records cannot sometimes be resolved by a local
# resolver, however, there's a possibility that their A/AAAA records are
# returned as part of the SRV query in the additional section, so we try
# to extract the IPs from there first, failing back to querying the
# hostnames A/AAAA records one by one, using the same resolver that
# queried the SRV record.
class SrvResolver
include Gitlab::Utils::StrongMemoize
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment