Pavlo Yemelianov
08/09/2023, 5:47 PMThis Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlite3.OperationalError) database is locked
...
but we’re using postgres and i don’t see any locks there
one thing to mention that we’re using celery with big amount of parallel tasksjohann
08/09/2023, 7:36 PMPavlo Yemelianov
08/09/2023, 8:25 PMjohann
08/09/2023, 8:27 PMjohann
08/09/2023, 8:28 PMPavlo Yemelianov
08/09/2023, 8:29 PMjohann
08/09/2023, 8:29 PMdagster.yaml
(with secrets removed)Pavlo Yemelianov
08/09/2023, 8:31 PMdagster-user-deployments:
enabled: true
deployments:
- name: data-ops
image:
repository: us-central1-docker.pkg.dev/-dev/repository-dev/dagster
tag: latest
pullPolicy: Always
dagsterApiGrpcArgs:
- -m
- data_ops
port: 8000
env:
MELTANO_ENVIRONMENT: prod
GOOGLE_APPLICATION_CREDENTIALS: /etc/service-key/credentials
volumes:
- name: service-key
secret:
secretName: service-key
volumeMounts:
- name: service-key
mountPath: /etc/service-key
readOnly: true
generateCeleryConfigSecret: false
global:
celeryConfigSecretName: "dagster-celery-1111-config-secret"
flower:
enabled: true
image:
repository: "<http://docker.io/mher/flower|docker.io/mher/flower>"
tag: "0.9.5"
pullPolicy: Always
service:
type: ClusterIP
annotations: {}
port: 5555
# Support Node, affinity and tolerations for Flower pod assignment. See:
# <https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector>
# <https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity>
# <https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/>
annotations: {}
nodeSelector: {}
affinity: {}
tolerations: []
podSecurityContext: {}
securityContext: {}
# Override the default K8s scheduler
# schedulerName: ~
resources: {}
# If you want to specify resources, uncomment the following lines, adjust them as necessary,
# and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
# Liveness probe detects when to restart flower.
# <https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes>
livenessProbe:
tcpSocket:
port: "flower"
# initialDelaySeconds: 60
periodSeconds: 20
failureThreshold: 3
startupProbe:
tcpSocket:
port: "flower"
periodSeconds: 10
failureThreshold: 6
postgresql:
enabled: false
postgresqlHost: 11.111.111.111
postgresqlUsername: dagster
postgresqlPassword: 1111
postgresqlDatabase: dagster
service:
port: 5432
johann
08/09/2023, 8:33 PMPavlo Yemelianov
08/09/2023, 8:33 PMjohann
08/09/2023, 8:33 PMjohann
08/09/2023, 8:34 PMjohann
08/09/2023, 8:34 PMPavlo Yemelianov
08/09/2023, 8:35 PMjohann
08/09/2023, 8:36 PMjohann
08/09/2023, 8:38 PMdatabase is locked
message get logged? The run pods? The webserver?Pavlo Yemelianov
08/09/2023, 8:41 PM@app.task(autoretry_for=(,), retry_kwargs={'max_retries': 1, 'countdown': 10})
then we’re just waiting for all tasks from list to finish
result = group(self.tasks).apply_async()
# Wait for the tasks to complete
while not result.ready():
...
and then pipeline continues
we have a celery deployment which is managed by KEDA
celery uses same docker image as we’re using for dagster deploymentPavlo Yemelianov
08/09/2023, 8:42 PMdagster-run
jobjohann
08/09/2023, 8:46 PMjohann
08/09/2023, 8:47 PMPavlo Yemelianov
08/09/2023, 8:47 PMPavlo Yemelianov
08/09/2023, 8:47 PMPavlo Yemelianov
08/09/2023, 8:47 PMjohann
08/09/2023, 8:48 PMdagster.yaml
that configures it (the helm chart sets it). The same file would be needed inside the celery workersjohann
08/09/2023, 8:49 PMThis Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlite3.OperationalError) database is locked
...
?Pavlo Yemelianov
08/09/2023, 8:49 PM[2023-08-09 20:31:02,955: INFO/ForkPoolWorker-9] This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlite3.OperationalError) database is locked
[2023-08-09 20:31:02,955: INFO/ForkPoolWorker-9] [SQL: UPDATE runs SET last_heartbeat_at=? WHERE runs.id = ?]
[2023-08-09 20:31:02,955: INFO/ForkPoolWorker-9] [parameters: ('2023-08-09 20:30:49.066415', 5)]
[2023-08-09 20:31:02,956: INFO/ForkPoolWorker-9] (Background on this error at: <https://sqlalche.me/e/14/e3q8>) (Background on this error at: <https://sqlalche.me/e/14/7s2a>)
Pavlo Yemelianov
08/09/2023, 8:50 PMPavlo Yemelianov
08/09/2023, 8:51 PMjohann
08/09/2023, 8:53 PMPavlo Yemelianov
08/09/2023, 8:55 PMdagster.yaml
therejohann
08/09/2023, 8:55 PMDAGSTER_HOME
env var to a directory inside the celery workers, and copy the dagster.yaml
from the webserver to there (can use the configmap), I’d expect it to workjohann
08/09/2023, 8:56 PMPavlo Yemelianov
08/09/2023, 9:00 PMPavlo Yemelianov
08/09/2023, 10:34 PMmax_locks_per_transaction
lock_timeout
idk should i open an issue that it’s showing wrong db connection in error text ?johann
08/09/2023, 10:58 PMPavlo Yemelianov
08/10/2023, 7:11 AMPavlo Yemelianov
08/11/2023, 3:55 PMruns
tables with similar structure
so if anyone will have similar issue check meltanojohann
08/11/2023, 3:56 PM