Aurora MySQL 5.7 on Temporal v1.3.0

Notes on setting up Temporal v1.3.0 on AWS Aurora MYSQL (Serverless, 5.7.12)

Missing items from the Helm chart:

  • Missing ability to set the target MySQL host when setting up the DB; it tries to connect to localhost even when sql host is setup. Had to run setup locally (see caveats below)

  • Missing ability to set SQL_CONNECT_ATTRIBUTES=tx_isolation=“READ-COMMITTED”. Without setting, below error is encountered:

$ ./temporal-sql-tool create-database -database temporal

2020/11/15 19:21:46 error creating database:Error 1193: Unknown system variable 'transaction_isolation'

Cadence Helm chart has option for this → banzai-charts/values.yaml at master · banzaicloud/banzai-charts · GitHub

  • I had to do a custom _helpers.tpl so that credentials can be read from a custom sealed secrets. Example values:
...
      default:
        driver: "sql"

        sql:
...
          port: 3306
          database: temporal
          user: temporal
          existingSecret: "temporalxx"
          secretKey: "default-passwd"
...

_helpers.tpl

...
{{- define "temporal.persistence.sql.secretName" -}}
...
{{- $storeConfig := index $global.Values.server.config.persistence $store -}}
{{- if $storeConfig.sql.existingSecret -}}
{{- $storeConfig.sql.existingSecret -}}
{{- else if $storeConfig.sql.password -}}
...
1 Like

Worker (among others) failing; how to pass in SQL_CONNECT_ATTRIBUTES=tx_isolation=“READ-COMMITTED” correct;y?

{"level":"info","ts":"2020-11-15T13:47:53.291Z","msg":"Starting server for services","value":"[worker]","logging-call-at":"server.go:109
"}
Unable to start server: sql schema version compatibility check failed: unable to create SQL connection: Error 1193: Unknown system varia
ble 'transaction_isolation'.

Thanks a lot for reporting.

For such problems filing an issue (or even better PR) against helm-charts repo would get to a faster resolution.

@AlexFainshtein 's suggestion works to enable successful deployment, by using connectAttributes, will add to PR for helm chart:

      default:
        driver: "sql"

        sql:
          driver: "mysql"
          ...
          connectAttributes:
            tx_isolation: 'READ-COMMITTED'

      visibility:
        driver: "sql"

        sql:
          driver: "mysql"
          ...
          connectAttributes:
            tx_isolation: 'READ-COMMITTED'

``
2 Likes

This is absolutely awesome. Great work.