Docs feedback: Whether the parameter db_load_balancing should include the database primary node
Problem to solve
From page db_load_balancing.hosts, I found that the introduction of the parameter gitlab_rails['db_load_balancing'] here is different from the actual configuration example. In the db load balancing chapter, this parameter does not include the database primary node, but in the rails configuration of the 3k cluster, this parameter includes all database nodes.
For example:
-
database_load_balancing
There are four nodes in a postgresql cluster:primary.example.com, host1.example.com, host2.example.com, and host3.example.com.gitlab_rails['db_load_balancing'] = { 'hosts' => ['host1.example.com', 'host2.example.com', host3.example.com] }, it doesn't contains postgresql primary node. -
3000 users references
gitlab_rails['db_load_balancing'] = { 'hosts' => ['10.6.0.31', '10.6.0.32', '10.6.0.33'] } # PostgreSQL IPs, it include all postgresql nodes.
From the introduction of the database load balancing function, we can know that when no read-only node is available, it will automatically connect to the postgresql primary node to perform read operations? So the operation of connecting to the postgresql primary node is retrieved through gitlab_rails['db_host'] or primary ip in gitlab_rails['db_load_balancing'].
According to the introduction in the load balancing chapter, the gitlab_rails['db_load_balancing'] parameter should only specify the postgresql replica node. If so, we need to use haproxy or consul dns to identify the replica role.
Further details
Proposal
Keep Documentation Behavior Consistent.
Who can address the issue
Other links/references
Link the doc and describe what is wrong with it.