Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-71000

Remove most SQL_QUERY_AUX calls from running on the primary db connection

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: Future Dev
    • Fix Version/s: None
    • Labels:
      None

      Description

      There are a bunch of various AUX queries which don't need to be on the primary such as:

      https://github.com/moodle/moodle/blob/master/lib/dml/pgsql_native_moodle_database.php#L354

      https://github.com/moodle/moodle/blob/master/lib/dml/pgsql_native_moodle_database.php#L761

      In fact almost all AUX should be safe to go to a read replica but I'm not sure we can assume that for 100% of AUX queries.

      I'm proposing the simplest way might be to introduce a new type of query so we have both  SQL_QUERY_AUX and SQL_QUERY_AUX_READONLY and then each driver can easily declare which is which.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              brendanheywood Brendan Heywood
              Participants:
              Component watchers:
              Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: