Primary Geo site has default wal_keep_size instead of increased recommendation
Summary
wal_keep_size
on Geo Primary is 160 while it should be 800 based on Increase wal_keep_segments setting from 10 to 5... (!1989 - merged)
Detailed information
Based on Gitlab['postgresql']['wal_keep_segments'] ||= 50
in https://gitlab.com/gitlab-org/omnibus-gitlab/-/blob/master/files/gitlab-cookbooks/package/libraries/config/roles/geo_primary.rb?ref_type=heads#L24 added with !1989 (diffs) - wal_keep_size
should be 800 on Primary site.
wal_keep_segments
was removed and wal_keep_size
used in PG13+ and based on 8bd646ad - this conversion should be handled in parse_wal_keep_size
code
On Staging Ref when checking wal_keep_size
on primary US site (PG14) it's 160 which is same as default value (16*10) - https://gitlab.com/gitlab-org/quality/gitlab-environment-toolkit-configs/staging-ref/-/issues/149#note_1803518319. The value should be 800 (50*16).
Steps to reproduce
- Build GitLab Geo instances
- Check
wal_keep_size
-cat /var/opt/gitlab/patroni/patroni.yaml | grep wal_keep_size
What is the current bug behavior?
"wal_keep_size":160
Note that the value was manually updated after this bug was raised to resolve could not receive data from WAL stream: ERROR: requested WAL segment 000000990000025900000013 has already been removed
- https://gitlab.com/gitlab-org/quality/gitlab-environment-toolkit-configs/staging-ref/-/issues/149#note_1803679536 but same issue should be possible to reproduce on custom Geo instances.
What is the expected correct behavior?
"wal_keep_size":800
Workaround
Specify wal_keep_size
manually using postgresql['wal_keep_size']
or patroni['postgresql']['wal_keep_size']
depending on PG setup