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