openedx / edx-django-utils

edX utilities for Django Application development.
https://edx.readthedocs.io/projects/edx-django-utils/en/latest/
Apache License 2.0
26 stars 20 forks source link

Add tooling for working with the read-replica database. #33

Closed cpennington closed 4 years ago

cpennington commented 4 years ago

This migrates the use_read_replica_if_available and read_replica_or_default functions from edx_platform/common/djangoapps/utils/query.py, and augments them with a pair of context managers for asserting that particular chunks of code are read-only (and thus read-replica safe).

Description:

Describe in a couple of sentence what this PR adds

JIRA:

XXX-XXXX

Dependencies:

List dependencies on other outstanding PRs, issues, etc.

Merge deadline:

List merge deadline (if any)

Installation instructions:

List any non-trivial installation instructions.

Testing instructions:

  1. Open page A
  2. Do thing B
  3. Expect C to happen
  4. If D happened instead - check failed.

Reviewers:

Merge checklist:

Post merge:

Author concerns:

List any concerns about this PR - inelegant solutions, hacks, quick-and-dirty implementations, concerns about migrations, etc.

cpennington commented 4 years ago

The build is passing, but not reporting to github (https://travis-ci.org/github/edx/edx-django-utils/builds/666356074). I'm going to merge this.