diff --git a/internal/patroni/config.go b/internal/patroni/config.go index 7815fc8c8..8f9948796 100644 --- a/internal/patroni/config.go +++ b/internal/patroni/config.go @@ -552,6 +552,11 @@ func instanceYAML( } else { initdb := []string{ + // Pod "securityContext.fsGroup" ensures processes and filesystems agree on a GID. + // Group access ensures processes can access data regardless of their UID. + // NOTE: The "--allow-group-access" option was introduced in PostgreSQL v11. + "allow-group-access", + // Enable checksums on data pages to help detect corruption of // storage that would otherwise be silent. This also enables // "wal_log_hints" which is a prerequisite for using `pg_rewind`. @@ -568,7 +573,7 @@ func instanceYAML( "data-checksums", "encoding=UTF8", - // NOTE(cbandy): The "--waldir" option was introduced in PostgreSQL v10. + // NOTE: The "--waldir" option was introduced in PostgreSQL v10. "waldir=" + postgres.WALDirectory(cluster, instance), } diff --git a/internal/patroni/config_test.go b/internal/patroni/config_test.go index d5aef835e..1f787bea7 100644 --- a/internal/patroni/config_test.go +++ b/internal/patroni/config_test.go @@ -685,6 +685,7 @@ func TestInstanceYAML(t *testing.T) { # Your changes will not be saved. bootstrap: initdb: + - allow-group-access - data-checksums - encoding=UTF8 - waldir=/pgdata/pg12_wal @@ -708,6 +709,7 @@ tags: {} # Your changes will not be saved. bootstrap: initdb: + - allow-group-access - data-checksums - encoding=UTF8 - waldir=/pgdata/pg12_wal @@ -747,6 +749,7 @@ tags: {} # Your changes will not be saved. bootstrap: initdb: + - allow-group-access - data-checksums - encoding=UTF8 - waldir=/pgdata/pg12_wal