环境
数据库:mysql5.7.39
ogg: 19.1.0.3
问题
配置完一套ogg,数据初始化都正常,抽取推送复制进程配置完也正常启动
等过了几个小时,抽取进程abend了,查看report有如下报错
File Name or Source
-------------------------
E_TOK.rpt
Description
--------------
Relevant Information Collection
---------------------------------------
***********************************************************************
Oracle GoldenGate Capture for MySQL
Version 19.1.0.0.3 OGGCORE_19.1.0.0.0_PLATFORMS_190907.0144
Linux, x64, 64bit (optimized), MySQL Enterprise on Sep 7 2019 08:46:34
Copyright (C) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
Starting at 2024-01-03 18:31:56
***********************************************************************
Operating System Version:
Linux
Version #1 SMP Wed Mar 13 12:02:46 UTC 2019, Release 4.18.0-80.el8.x86_64
Node: BEJRUN-N-81011
Machine: x86_64
2024-01-03 18:31:56 INFO OGG-02095 Successfully set environment variable MYSQL_UNIX_PORT=/var/lib/mysql/mysql.sock.
EXTRACT e_tok
setenv ( MYSQL_TCP_PORT=3306)
setenv ( MYSQL_UNIX_PORT=/var/lib/mysql/mysql.sock)
sourcedb token_service_provider@10.146.81.27:3306, USERID ogg, PASSWORD ***
exttrail /u01/ogg/dirdat/to
discardfile /u01/ogg/dirrpt/to_1.dsc, append, megabytes 500
TranLogOptions AltLogDest /var/lib/mysql/binary-log.index
table token_service_provider.primary_account_number;
table token_service_provider.token;
2024-01-03 18:31:57 INFO OGG-06507 MAP (TABLE) resolved (entry token_service_provider.token): table "token_service_provider"."token".
2024-01-03 18:31:57 INFO OGG-06509 Using the following key columns for source table token_service_provider.token: TOKEN_ID.
Source Context :
SourceModule : [ggvam.gen]
SourceID : [../gglib/ggvam/cvamgen.cpp]
SourceMethod : [vamRead]
SourceLine : [758]
ThreadBacktrace : [15] elements
: [/u01/ogg/libgglog.so(CMessageContext::AddThreadContext())]
: [/u01/ogg/libgglog.so(CMessageFactory::CreateMessage(CSourceContext*, unsigned int, ...))]
: [/u01/ogg/libgglog.so(_MSG_String_Int32_String(CSourceContext*, int, char const*, int, char const*, CMessageFactory::MessageDisposition))]
: [/u01/ogg/extract(com_goldengate_vam::CVamGen::vamRead())]
: [/u01/ogg/extract(com_goldengate_vam::CVAMEXT_read(ggs::gglib::gglcr::CommonLCR*))]
: [/u01/ogg/extract(ggs::er::VAMDataSource::readLCR(ggs::gglib::gglcr::CommonLCR**, long&, bool&))]
: [/u01/ogg/extract(ggs::er::ExtractContext::processExtractLoop())]
: [/u01/ogg/extract(ggs::er::ExtractContext::run())]
: [/u01/ogg/extract()]
: [/u01/ogg/extract(ggs::gglib::MultiThreading::MainThread::ExecMain())]
: [/u01/ogg/extract(ggs::gglib::MultiThreading::Thread::RunThread(ggs::gglib::MultiThreading::Thread::ThreadArgs*))]
: [/u01/ogg/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
: [/u01/ogg/extract(main)]
: [/lib64/libc.so.6(__libc_start_main)]
: [/u01/ogg/extract()]
2024-01-03 18:31:57 ERROR OGG-00146 Call to VAMRead returned with error status 600: VAM Client Report <CAUSE OF FAILURE : XA transaction is not supported. XA transaction encountered at Log number:1, offset:347611448
WHEN FAILED : While reading log event from binary log
WHERE FAILED : MySQLBinLog Reader Module
CONTEXT OF FAILURE : No Information Available!>.
分析
从日志报错来看是因为mysq binlog里面包含了XA transaction ,但是我比较疑惑的是我这个单机怎么会有分布式事务产生呢?
后来给oracle开了个SR咨询了一下,对方回复如下:
当前在您的binary log 中应该是有XA的transaction,但ogg 并不支持capture XA transaction,这样进程abend:
https://docs.oracle.com/en/middleware/goldengate/core/19.1/gghdb/understanding-whats-supported-mysql.html#GUID-DA5CE4D3-8336-4EC8-8894-A86880D2066B
==>
Note:XA transactions are not supported for capture and any XA transactions logged in binlog cause Extract to abend. So, you must not use XA transactions against a database that Extract is configured to capture.
If XA transactions are being used for databases that are not configured for Oracle GoldenGate capture, then exclude those databases from logging into MySQL binary logs by using the parameter binlog-ignore-db in the MySQL server configuration file.
我想可能是其他的数据库执行分布式的事务在您的这个数据库上执行引起的。关于mysql的数据库的相关问题,建议联系您的mysql的团队进行进一步的确认。
问oracle是否能在oGG中设置避免此类问题发生,对方回复
我看了一些类似的案例,这个在ogg这边解决不了。需要binary log中不包含了XA transaction,extract 应该就能工作正常。
跟开发那边确认,人家也回复说不知道所谓的分布式事务,哎,木有办法,只能将相关数据重新初始化,重新同步。
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




