我有一个Silverstripe
网站已连接到MySql
上托管的Rackspace
服务器版本5.6.17
我正在努力解决2个不时发生同步的错误,但我无法弄清楚根本原因是什么。
Error: Couldn't run query: COMMIT; Lost connection to MySQL server during query At line 598 in /home/dployio/deployments/production/1733814/framework/model/MySQLDatabase.php SS_CustomLogErrorEmailFormatter->format(Array) Custom_SS_LogEmailWriter.php:43 Custom_SS_LogEmailWriter->_write(Array) Abstract.php:85 Zend_Log_Writer_Abstract->write(Array) Log.php:428 Zend_Log->log(Array,3,) Log.php:178 SS_Log::log(Array,3) Debug.php:301 Debug::fatalHandler(256,Couldn't run query: COMMIT; Lost connection to MySQL server during query,/home/dployio/deployments/production/1733814/framework/model/MySQLDatabase.php,598,Array) Debug.php:553 errorHandler(256,Couldn't run query: COMMIT; Lost connection to MySQL server during query,/home/dployio/deployments/production/1733814/framework/model/MySQLDatabase.php,598) MySQLDatabase.php:598 MySQLDatabase->databaseError(Couldn't run query: COMMIT; Lost connection to MySQL server during query,256) MySQLDatabase.php:150 MySQLDatabase->query(COMMIT;,256) DB.php:208 DB::query(COMMIT;) SapphireTransactionManager.php:69 SapphireTransactionManager->commit() SapphireTransactionManager.php:99 SapphireTransactionManager->transaction(Closure$NewsRequestManager::postNews;280716067)
然后
Error: Couldn't run query: INSERT INTO "News_Tags" ("NewsID","TagID") VALUES (91, 1225) Table './os_production/News_Tags' is marked as crashed and should be repaired At line 598 in /home/dployio/deployments/production/1733814/framework/model/MySQLDatabase.php SS_CustomLogErrorEmailFormatter->format(Array) Custom_SS_LogEmailWriter.php:43 Custom_SS_LogEmailWriter->_write(Array) Abstract.php:85 Zend_Log_Writer_Abstract->write(Array) Log.php:428 Zend_Log->log(Array,3,) Log.php:178 SS_Log::log(Array,3) Debug.php:301 Debug::fatalHandler(256,Couldn't run query: INSERT INTO "News_Tags" ("NewsID","TagID") VALUES (91, 1225) Table './os_production/News_Tags' is marked as crashed and should be repaired,/home/dployio/deployments/production/1733814/framework/model/MySQLDatabase.php,598,Array) Debug.php:553 errorHandler(256,Couldn't run query: INSERT INTO "News_Tags" ("NewsID","TagID") VALUES (91, 1225) Table './os_production/News_Tags' is marked as crashed and should be repaired,/home/dployio/deployments/production/1733814/framework/model/MySQLDatabase.php,598) MySQLDatabase.php:598 MySQLDatabase->databaseError(Couldn't run query: INSERT INTO "News_Tags" ("NewsID","TagID") VALUES (91, 1225) Table './os_production/News_Tags' is marked as crashed and should be repaired,256) MySQLDatabase.php:150 MySQLDatabase->query(INSERT INTO "News_Tags" ("NewsID","TagID") VALUES (91, 1225),256) DB.php:208 DB::query(INSERT INTO "News_Tags" ("NewsID","TagID") VALUES (91, 1225)) UnitOfWork.php:415 UnitOfWork->commit() SapphireTransactionManager.php:62
在包含不超过100条记录的表(News
)上插入记录时发生第一个错误。此表包含几个字段的全文索引(mediumtext
键入所有字段)。
第二次查询它试图插入相关的新闻标签
这里的大问题是,一旦发生这种情况,需要重新生成与此相关的全文索引,以使该模块再次工作。这意味着,一旦发生这对错误,就会永久性地破坏。
这是全文索引定义
FULLTEXT INDEX Headline_SummaryHtmlFree_BodyHtmlFree
(Headline, SummaryHtmlFree, BodyHtmlFree);
我尝试过的事情(显然没有帮助)
News_Tags
表,因为它涉及崩溃状态</ li>
正如我之前提到的,解决此问题的方法是重新创建全文索引Headline_SummaryHtmlFree_BodyHtmlFree
,但我不明白为什么。