View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0007192||OXID eShop (all versions)||4.01. Database handling||public||2020-11-17 12:54||2020-11-17 12:55|
|Target Version||Fixed in Version|
|Summary||0007192: Master Slave Database balancing - category listing (alist) - using the Master DB in model classes|
|Description||We have tested our test system Balancing with and without contentcache according to https://bugs.oxid-esales.com/view.php?id=6927. |
The category list (alist) is considered
1. without content cache: select queries on master 6130, queries on slave 74
2. with content cache: 38/32 select queries
The ratio without content cache was 85:1 on Master DB.
Conspicuous are explicit usage of the master DB in model classes.
The use of master DB in this call is not exactly explained or not really thought through:
public function setProductData($oProduct)
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
$masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
$sQ = "select oxid from oxfield2shop where oxartid=" . $masterDb->quote($oProduct->getId()) . " and oxshopid= " . $masterDb->quote($this->getConfig()->getShopId());
This function is called when loading from any article list (in frontend), if prices should be loaded and the clients have different prices, which is the strength of the EE version. But the call leaves the database on the master and thus practically switches off the balancing, which explains the bad distribution.
|Steps To Reproduce||1. Install master slave DB and set aSlaveHost Array in config.inc.php|
2. Activate and deactivate dynamic content caching
2. Category listing (alist) in frontend
3. Look at the query log on master and slave host
|Additional Information||- es -|
|Tags||No tags attached.|
|PHP Version||Not defined|
|Database Version||Not defined|