-
Notifications
You must be signed in to change notification settings - Fork 20
[DPE-6678] PostgreSQL Config Improvement #778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Conflicts: # lib/charms/postgresql_k8s/v0/postgresql.py
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #778 +/- ##
==========================================
+ Coverage 71.97% 72.11% +0.13%
==========================================
Files 15 15
Lines 3479 3862 +383
Branches 532 583 +51
==========================================
+ Hits 2504 2785 +281
- Misses 845 897 +52
- Partials 130 180 +50 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# Conflicts: # lib/charms/postgresql_k8s/v0/postgresql.py
Hi, @Pepsiqqq, please sync up with main, it should skip the tests that cannot run on forks. |
Hi, @Pepsiqqq! Thanks for syncing the branch. We're checking why a lot of tests are failing. We found that the replication HBA rules are not being filled correctly for some reason. Still investigating. |
I'm not sure yet, but it seems something related to RAFT and the number of config options we try to set on PG: 2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: Exception in thread Thread-2 (_autoTickThread):
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: Traceback (most recent call last):
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: self.run()
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: File "/usr/lib/python3.10/threading.py", line 953, in run
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: self._target(*self._args, **self._kwargs)
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: File "/usr/lib/python3/dist-packages/patroni/dcs/raft.py", line 271, in _autoTickThread
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: self.doTick(self.conf.autoTickPeriod)
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: File "/usr/lib/python3/dist-packages/pysyncobj/syncobj.py", line 532, in doTick
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: self._onTick(timeToWait)
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: File "/usr/lib/python3/dist-packages/patroni/dcs/raft.py", line 261, in _onTick
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: super(KVStoreTTL, self)._onTick(timeToWait)
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: File "/usr/lib/python3/dist-packages/patroni/dcs/raft.py", line 97, in _onTick
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: super(DynMemberSyncObj, self)._onTick(timeToWait)
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: File "/usr/lib/python3/dist-packages/pysyncobj/syncobj.py", line 622, in _onTick
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: self._checkCommandsToApply()
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: File "/usr/lib/python3/dist-packages/pysyncobj/syncobj.py", line 456, in _checkCommandsToApply
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: self.__raftLog.add(command, idx, term)
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: File "/usr/lib/python3/dist-packages/pysyncobj/journal.py", line 201, in add
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: self.__journalFile.write(self.__currentOffset, cmdData)
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: File "/usr/lib/python3/dist-packages/pysyncobj/journal.py", line 104, in write
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: self.__mm[offset:offset + size] = values
2025-03-19T20:44:22Z charmed-postgresql.patroni[4826]: IndexError: mmap slice assignment is wrong size |
Thank you, seem like everything works. I deployed charm and tried to change config with |
Thanks for the great contribution, @Pepsiqqq! |
This is copy of K8s PR, however there is an issue that PostgreSQL stucks in
Awaiting for member to start
. I think it's related to this issue because there is the same error (Failed to list PostgreSQL database users: could not translate host name "None" to address: Temporary failure in name resolution
). On K8s side everything works as intended.Added all missing parameters from PostgreSQL config analysis (Added params 25.05):
https://docs.google.com/spreadsheets/d/1CbJMmSSP5eyu08y5vM8RNGrjiSxOLsa7RelwwUsi-vg/edit?pli=1&gid=815242942#gid=815242942
Were not added:
client_encoding
: Session only parameter that can't be set by Patroni. Sourcetransaction_deferrable
: This parameter cannot be set in the configuration file, or from any source other than live SQL. Sourcetransaction_isolation
: This parameter cannot be set in the configuration file, or from any source other than live SQL. Sourcetransaction_read_only
: This parameter cannot be set in the configuration file, or from any source other than live SQL. SourceNotice:
old_snapshot_threshold
: Will be deleted in 17 version. Sourcedefault_table_access_method
: Added dynamic validation.Also sorted config to improve readability.