From a69f9918cd1d3a0ca5fec28ac71801ff223435ae Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Mon, 07 Oct 2013 05:29:52 -0400
Subject: [PATCH] Improve selection of replicated database connection: - Analyze query and prefer dsnr unless a write operation for a table involved has been carried out before - New config option and setter method to enforce connection mode on table level

---
 config/defaults.inc.php |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/config/defaults.inc.php b/config/defaults.inc.php
index 66db040..9afa4ac 100644
--- a/config/defaults.inc.php
+++ b/config/defaults.inc.php
@@ -41,6 +41,16 @@
 // you can define specific table (and sequence) names prefix
 $config['db_prefix'] = '';
 
+// Mapping of table names and connections to use for ALL operations.
+// This can be used in a setup with replicated databases and a DB master
+// where read/write access to cache tables should not go to master.
+$config['db_table_dsn'] = array(
+//    'cache' => 'r',
+//    'cache_index' => 'r',
+//    'cache_thread' => 'r',
+//    'cache_messages' => 'r',
+);
+
 
 // ----------------------------------
 // LOGGING/DEBUGGING

--
Gitblit v1.9.1