Skip to content

Draft: Re-define workflows when using replicas

Kamil Trzciński requested to merge lb-session-define-workflows into master

What does this MR do?

This replaces other load balancing code with a set of clearly defined workflows:

  • isolated_session: opens a new session with a new context
  • read_only: we intent to only read data, disallowing writes
  • isolated_write: we intent to perform isolated write

This removes all prior methods:

  • without_sticky_writes
  • use_replicas_for_read_queries
  • fallback_to_replicas_for_ambiguous_queries

This ensures that operations are executed in a transactional way. We continue to be able to use the .use_primary! to work as it was.

Related:

Conformity

Edited by Kamil Trzciński

Merge request reports