Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento Enterprise database split compatibility #22

Closed
nuzil opened this issue Jan 17, 2017 · 7 comments
Closed

Magento Enterprise database split compatibility #22

nuzil opened this issue Jan 17, 2017 · 7 comments
Assignees

Comments

@nuzil
Copy link

nuzil commented Jan 17, 2017

Hello

We want to use your extension on Magento2 EE edition and wanted to use default Database Split feature of Magento EE. But unfortunately your extension is not compatible with it. May we expect that will will be fixed in future versions?

Thanks a lot

@fjbender fjbender self-assigned this Jan 17, 2017
@fjbender
Copy link
Contributor

Do you have any implementation guidelines for this? I could only find this document, which explains the general setup but doesn't explain which guidelines to follow when actually implementing database split: http://devdocs.magento.com/guides/v2.0/config-guide/multi-master/multi-master.html

Where exactly is our module not compatible (e.g. Database Helper class isn't implemented database split aware)?

@fjbender
Copy link
Contributor

@nuzil Can you get me any more infos on this issue?

@nuzil
Copy link
Author

nuzil commented Jan 24, 2017

Hello @fjbender

One error:
When you are trying to VIEW order in Magento Backend this error popup

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'aboshop3_www.sales_order' doesn't exist in /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228 Stack trace: #0 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array) #1 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/DB/Statement/Pdo/Mysql.php(95): Zend_Db_Statement_Pdo->_execute(Array) #2 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array) #3 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array) #4 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(' SELECT\n ...', Array) #5 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(465): Zend_Db_Adapter_Pdo_Abstract->query(' SELECT\n ...', Array) #6 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(520): Magento\Framework\DB\Adapter\Pdo\Mysql->_query(' SELECT\n ...', Array) #7 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(756): Magento\Framework\DB\Adapter\Pdo\Mysql->query(' SELECT\n ...', Array) #8 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/payone-gmbh/magento-2/Helper/Database.php(145): Zend_Db_Adapter_Abstract->fetchRow(' SELECT\n ...', Array) #9 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/payone-gmbh/magento-2/Model/UiComponent/DataProvider.php(96): Payone\Core\Helper\Database->getIncrementIdByOrderId('17') #10 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/View/Element/UiComponent/DataProvider/DataProvider.php(109): Payone\Core\Model\UiComponent\DataProvider->prepareUpdateUrl() #11 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/payone-gmbh/magento-2/Model/UiComponent/DataProvider.php(74): Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider->__construct('payone_protocol...', 'id', 'order_id', Object(Magento\Framework\View\Element\UiComponent\DataProvider\Reporting), Object(Magento\Framework\Api\Search\SearchCriteriaBuilder), Object(Magento\Framework\App\Request\Http), Object(Magento\Framework\Api\FilterBuilder), Array, Array) #12 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93): Payone\Core\Model\UiComponent\DataProvider->__construct('payone_protocol...', 'id', 'order_id', Object(Magento\Framework\View\Element\UiComponent\DataProvider\Reporting), Object(Magento\Framework\Api\Search\SearchCriteriaBuilder), Object(Magento\Framework\App\Request\Http), Object(Magento\Framework\Api\FilterBuilder), Object(Payone\Core\Helper\Database), Array, Array) #13 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(89): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Payone\\Core\\Mod...', Array) #14 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Payone\\Core\\Mod...', Array) #15 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/View/Element/UiComponent/Argument/Interpreter/ConfigurableObject.php(60): Magento\Framework\ObjectManager\ObjectManager->create('Payone\\Core\\Mod...', Array) #16 /Users/alexlyzun/Projects/code/aboshop3/www/var/generation/Magento/Framework/Data/Argument/InterpreterInterface/Proxy.php(95): Magento\Framework\View\Element\UiComponent\Argument\Interpreter\ConfigurableObject->evaluate(Array) #17 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Data/Argument/Interpreter/Composite.php(61): Magento\Framework\Data\Argument\InterpreterInterface\Proxy->evaluate(Array) #18 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/module-ui/Model/Manager.php(188): Magento\Framework\Data\Argument\Interpreter\Composite->evaluate(Array) #19 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/module-ui/Model/Manager.php(191): Magento\Ui\Model\Manager->evaluateComponentArguments(Array) #20 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/module-ui/Model/Manager.php(172): Magento\Ui\Model\Manager->evaluateComponentArguments(Array) #21 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/View/Element/UiComponentFactory.php(144): Magento\Ui\Model\Manager->prepareData('payone_sales_or...') #22 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/View/Layout/Generator/UiComponent.php(124): Magento\Framework\View\Element\UiComponentFactory->create('payone_sales_or...', NULL, Array) #23 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/View/Layout/Generator/UiComponent.php(93): Magento\Framework\View\Layout\Generator\UiComponent->generateComponent(Object(Magento\Framework\View\Layout\Data\Structure), 'payone_sales_or...', Array, Object(Magento\Framework\View\Layout\Interceptor)) #24 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/View/Layout/GeneratorPool.php(86): Magento\Framework\View\Layout\Generator\UiComponent->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context)) #25 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/View/Layout.php(327): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context)) #26 /Users/alexlyzun/Projects/code/aboshop3/www/var/generation/Magento/Framework/View/Layout/Interceptor.php(89): Magento\Framework\View\Layout->generateElements() #27 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements() #28 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks() #29 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks() #30 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/View/Layout.php(244): Magento\Framework\View\Layout\Builder->build() #31 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/View/Layout.php(859): Magento\Framework\View\Layout->build() #32 /Users/alexlyzun/Projects/code/aboshop3/www/var/generation/Magento/Framework/View/Layout/Interceptor.php(414): Magento\Framework\View\Layout->getBlock('menu') #33 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/module-backend/Model/View/Result/Page.php(59): Magento\Framework\View\Layout\Interceptor->getBlock('menu') #34 /Users/alexlyzun/Projects/code/aboshop3/www/var/generation/Magento/Backend/Model/View/Result/Page/Interceptor.php(24): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Sales::...') #35 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/module-sales/Controller/Adminhtml/Order.php(140): Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu('Magento_Sales::...') #36 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/module-sales/Controller/Adminhtml/Order/View.php(30): Magento\Sales\Controller\Adminhtml\Order->_initAction() #37 /Users/alexlyzun/Projects/code/aboshop3/www/var/generation/Magento/SalesArchive/Controller/Adminhtml/Order/View/Interceptor.php(24): Magento\Sales\Controller\Adminhtml\Order\View->execute() #38 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/App/Action/Action.php(102): Magento\SalesArchive\Controller\Adminhtml\Order\View\Interceptor->execute() #39 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http)) #40 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http)) #41 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\SalesArchive\Controller\Adminhtml\Order\View\Interceptor->___callParent('dispatch', Array) #42 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\SalesAr...', 'dispatch', Object(Magento\SalesArchive\Controller\Adminhtml\Order\View\Interceptor), Array, 'adminAuthentica...') #43 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http)) #44 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\SalesArchive\Controller\Adminhtml\Order\View\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http)) #45 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\SalesAr...', 'dispatch', Object(Magento\SalesArchive\Controller\Adminhtml\Order\View\Interceptor), Array, 'log') #46 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/module-logging/App/Action/Plugin/Log.php(69): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http)) #47 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Logging\App\Action\Plugin\Log->aroundDispatch(Object(Magento\SalesArchive\Controller\Adminhtml\Order\View\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http)) #48 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\SalesAr...', 'dispatch', Object(Magento\SalesArchive\Controller\Adminhtml\Order\View\Interceptor), Array, 'adminMassaction...') #49 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\SalesArchive\Controller\Adminhtml\Order\View\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #50 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\SalesArchive\Controller\Adminhtml\Order\View\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http)) #51 /Users/alexlyzun/Projects/code/aboshop3/www/var/generation/Magento/SalesArchive/Controller/Adminhtml/Order/View/Interceptor.php(39): Magento\SalesArchive\Controller\Adminhtml\Order\View\Interceptor->___callPlugins('dispatch', Array, Array) #52 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/App/FrontController.php(55): Magento\SalesArchive\Controller\Adminhtml\Order\View\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #53 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http)) #54 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array) #55 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install') #56 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #57 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http)) #58 /Users/alexlyzun/Projects/code/aboshop3/www/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array) #59 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #60 /Users/alexlyzun/Projects/code/aboshop3/www/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()

As you can see from the backtrace its comes from Payone extension which tries to get "sales_*" table, but cannot because database splitted between 3 different and sales tables are in another database then.

@nuzil
Copy link
Author

nuzil commented Jan 24, 2017

I didn't check whole functionality because after this error we rolled back out system to use 1 database only

@fjbender
Copy link
Contributor

Thanks for the feedback, now I know where to look. Currently, we're using \Magento\Framework\App\ResourceConnection's getTableName() method to obtain the table names. I can't, however, find the way to look up table names in a database split setting. I'd expect Magento's database abstraction to take care of that.

@nuzil
Copy link
Author

nuzil commented Jan 24, 2017

Honestly I also expect that Magento will handle it in case if developers using default Resources. But looks like not really

@fjbender
Copy link
Contributor

I'm afraid we will only rely on Magento's database abstraction and not get involved with handling the db ourselves.

Get back to me anytime you get new insights into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants