問題描述
我們正在創建從 RDS 中的 Mysql 到用于創建搜索索引的彈性搜索的數據管道,為此,使用 debezium cdc 及其 mysql 源和彈性接收器連接器.
We are creating a data pipeline from Mysql in RDS to elastic search for creating search indexes, and for this using debezium cdc with its mysql source and elastic sink connector.
現在,由于 mysql 在 rds 中,我們必須授予 mysql 用戶對兩個我們想要 cdc 表的 LOCK TABLE 權限,如文檔中所述.
Now as the mysql is in rds we have to give the mysql user LOCK TABLE permission for two tables we wanted cdc, as mentioned in docs.
我們還有其他各種 mysql 用戶執行可能需要兩個表中任何一個的事務.
We also have various other mysql users performing transactions which may require any of the two tables.
一旦我們將 mysql 連接器連接到我們的生產數據庫,就會創建一個鎖,我們的整個系統就宕機了,在意識到這一點后,我們很快停止了 kafka 并移除了連接器,但鎖仍然在增加,而且只是在我們通過停止運行生產代碼并手動終止進程來停止所有新查詢后解決.
As soon as we connected the mysql connector to our production database there was a lock created and our whole system went down, after realising this we soon stopped the kafka and also removed the connector, but the locks where still increasing and it only solved after we stop all the new queries by stopping our production code from running and manually killing the processes.
造成這種情況的潛在原因是什么,我們如何防止這種情況發生?
What could be the potential cause for this, and how could we prevent this ?
推薦答案
如果鎖定有問題,并且您無法在鎖定與一致性之間進行權衡,那么請查看 snapshot.locking.mode
配置選項.
If the locking is problem and you cannot afford to tradeoff locking vs consistency then please take a look at snapshot.locking.mode
config option.
這篇關于用于生產中 rds 的 Mysql debezium 連接器導致死鎖的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!