Repository navigation
feat(postgres): max_locks_per_transaction naar 1024 voor in-cluster Postgres - #158
Draft
rubenvdlinde wants to merge 1 commit into
Draft
rubenvdlinde wants to merge 1 commit into
rubenvdlinde wants to merge 1 commit into
Conversation
…ostgres OpenRegister zoekt met één UNION over al zijn schematabellen. Bij ~1.329 tabellen loopt de default van 64 locks per transactie vol en geeft Postgres 'out of shared memory'. Gemeten op het tenant-image: 11.963 locks faalt op 64 en slaagt op 1024, voor 46MB extra shared memory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wat
values/db/postgres.yamlzetmax_locks_per_transaction = 1024(default 64) viapostgresql.primary.extendedConfigurationvan de Bitnami-subchart. De chart rendert dat als ConfigMapnextcloud-postgresql-extended-configuration, gemount op/bitnami/postgresql/conf/conf.d/.Aanleiding: bij de generale repetitie van demogemeente Zuiddrecht (NC 32.0.13, verse installatie) gaf OpenRegister
out of shared memory, increase max_locks_per_transaction. OpenRegister zet elk schema in een eigen tabel en zoekt met één UNION over al die tabellen; elke tabel en elke index kost een lock in één transactie. Daar waren het ~1.329 tabellen.Gemeten
Op het image van de vloot,
ghcr.io/conductionnl/nextcloud-images:postgres16-ext-sha-8abef67(digestsha256:7478927e…), lokaal in docker, met de setting op dezelfde mount als de chart:ERROR: out of shared memory+ HINTshared_memory_sizeOok gemeten: een bestaand datavolume, eerst gestart zonder en daarna met de ConfigMap op
conf.d, komt op 1024 op. De setting werkt dus ook voor bestaande tenants, niet alleen bij initdb.De +46MB valt binnen de limiet van 512Mi uit
values/common.yaml.Blast radius
Gerenderd zoals in #138: per tenantbestand eerst het inline values-blok van de ApplicationSet (helm als template-engine), daarna
helm templatemet chart nextcloud 8.9.0 en dezelfde valueFiles-volgorde, opmainen op deze branch.mariadbenexternalzijn byte voor byte gelijk.dbType: postgreskrijgen alle 75 exact dezelfde toevoegingen en niets anders: de ConfigMap, de annotatiechecksum/extended-configurationop de pod-template van de Postgres-StatefulSet, het volume en de volumeMount.Gevolg: elke in-cluster Postgres herstart één keer bij de sync. Tijdens die herstart is de tenant kort zonder database.
Gedraaid
nextcloud-platform/scripts/validate-values.shnextcloud-platform/tests/run-tests.shscripts/verify.shpre-commit run --all-files --hook-stage pre-pushmaintegen deze branchNiet gedraaid:
conftest, kube-score,kubeconformlos (zit insmoke-checks.shviaverify.sh). Niets tegen een cluster.Te beslissen
values/db/postgres.yaml, dus alle 75 postgres-tenants herstarten hun database. Wie alleen Zuiddrecht nu wil helpen, zet hetzelfde blok intenant-zuiddrecht-prod.yaml(tenantwijziging, mag altijd):dbType: externaldraait op het gedeelde cluster uitplatform/postgres/cluster.yaml(CNPG) en valt hier buiten. Dat cluster heeftmax_connections: 500, dus een veel grotere lock-tabel bij dezelfde 64; niet aangepast.Volgorde
Platformwijziging, label
change/platform, mergen ma tot do na 17:00. Canary (wave 0) eerst; daarna schuift de scheduled merge de refs op.🤖 Generated with Claude Code