Skip to content

Make read_write_split a per database configuration option. #804

@mijoharas

Description

@mijoharas

Hey Lev,

We're doing some testing, and shifting things around. We have a db that is primary_only (just has one primary), one that is replica_only (just has one replica) and one that has both primaries, and replicas.

In our testing, we want to use the last option, but we only want queries to go to the replica. Now, because read_write_split is a general configuration option, we can't have it use exclude_primary (that makes our primary_only break.

I've got two ideas, and actually, the second one seems easier to implement:

  • make read_write_split a database configuration option, so we can override it to exclude_primary just for the last db.
  • create a new read_write_split option that's something like exclude_primary_if_replicas_available that will not exclude primary, if there is only one primary for the db.

Let me know what you think makes sense?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions