HomePhabricator

Add a read-only flag to database connections

Description

Add a read-only flag to database connections

Summary:
Ref T4571. This allows individual connections to be flagged as "read-only". If we try to send writes over a read-only connection, the connection layer throws an exception.

This is part of moving toward a world where we degrade gracefully if the master database is unreachable, and can spread reads to replicas.

Test Plan: See next revision, which adds a basic read-only mode.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4571

Differential Revision: https://secure.phabricator.com/D15661

Details

Provenance
epriestleyAuthored on Apr 8 2016, 10:12 PM
epriestleyPushed on Apr 9 2016, 11:15 AM
Reviewer
chad
Differential Revision
D15661: Add a read-only flag to database connections
Parents
rPHU22a0253e08fd: Allow ConduitClient to use OAuth access tokens for authentication
Branches
Unknown
Tags
Unknown
Tasks
T4571: Allow Phabricator to run in Read-Only Mode
Build Status
Buildable 11614
Build 14521: Run Core Tests