temporalio / temporalio/temporal

fr: add support for multi-az postgres with read-only replication

Open
#6,100 4 comments 1 reaction 1 assignee View on GitHub

@gow is already working on this.

Since Jun 21, 2024.

enhancement
Dominant language
Go
Stars
23.2k
Forks
1.9k
Avg merge
2d 8h
Merged PRs (30d)
228

Description

Is your feature request related to a problem? Please describe.

Yes, current implementation assumes all postgres data stores have static read-write configurations (i.e. will always be read-write for the lifecycle of the temporal instance).

Describe the solution you'd like

Add support for postgres configurations such that:

  • Nodes may utilize dynamic read-only/read-write (HA) postgres servers between multiple instances.
  • Where write transactions are required, fall back to available read-write (master) nodes to mitigate issues with HA compatibility.
  • Default queries only utilize read-only nodes (optional but bonus points if so).

Describe alternatives you've considered

No alternatives, if HA is enabled between multiple postgres servers (e.g temporal does not check pg_is_in_recovery), temporal will eventually fail upon (postgres) instance recovery / failover.

Additional context

Postgres configured such that:

  • 1 master / read-write instance
  • 1 or more read-only instance(s)
  • Nodes may failover from read-write to read-only (and vice versa) at any point.

Happy to provide docker configurations for reproducible context for the feature request.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.