Skip to content

Commit

Permalink
ci: db persistence for large index dbs
Browse files Browse the repository at this point in the history
Makes a few changes:

  * raises db storage 1GB -> 10GB
  * leaves db running in maintenanceMode, for dump/restore
  * increases available shm size for db container

Ideally we'd make the db persistence customizable, but this is good
enough for now. Looks like 500k blocks maps to roughly 3.5GB of dbdump.
We can adjust over time if we plan to keep running long-lived testnet
chains.

The increased shm size is specifically to support large joins by e.g.
the dex explorer frontend, otherwise db connection was reporting
"could not resize shared memory segment".

Refs #4526.
  • Loading branch information
conorsch committed Jun 13, 2024
1 parent fe41629 commit 45a9435
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions deployments/charts/penumbra-node/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
storage: 10Gi
{{- end }}

updateStrategy:
Expand Down Expand Up @@ -100,6 +100,11 @@ spec:
items:
- key: "postgres-cometbft-schema.sql"
path: "postgres-cometbft-schema.sql"
# Create emptyDir volume for /dev/shm, otherwise large psql queries for frontends will fail.
- name: dshm
emptyDir:
medium: Memory
size: 1G
{{ end }}
{{- if .Values.postgres.certificateSecretName }}
- name: db-certificates
Expand Down Expand Up @@ -273,11 +278,6 @@ spec:
{{- toYaml .Values.postgres.securityContext | nindent 12 }}
image: "{{ .Values.postgres.image.repository }}:{{ .Values.postgres.image.tag }}"
imagePullPolicy: {{ .Values.postgres.image.pullPolicy }}
{{- if .Values.maintenanceMode }}
command:
- sleep
- infinity
{{- else }}
{{- if .Values.postgres.certificateSecretName }}
args:
- -c
Expand All @@ -287,7 +287,6 @@ spec:
- -c
- ssl_key_file=/var/lib/postgresql/data/certs/server.key
{{- end }}
{{- end }}
ports:
- name: postgres
containerPort: 5432
Expand Down Expand Up @@ -344,6 +343,8 @@ spec:
# in order to override the internal volume mount used by the Postgres container image.
# With the `/data` suffix, db will not persist.
mountPath: /var/lib/postgresql/data
- name: dshm
mountPath: /dev/shm
{{ end }}

{{- with .Values.nodeSelector }}
Expand Down

0 comments on commit 45a9435

Please sign in to comment.