meituan-dianping / myflash Goto Github PK
View Code? Open in Web Editor NEWflashback mysql data to any point
License: Other
flashback mysql data to any point
License: Other
大佬,支持mysql8的版本,会更新吗?
编译指令是否有所不同
[root@testdb ~]# flashback --binlogFileNames=3999-binlog.000005 --sqlTypes=delete --databaseNames=testdb --tableNames=a --outBinlogFileNameBase=aaa --logLevel=debug
** (flashback:6719): DEBUG: just skip the FORMAT_DESCRIPTION_EVENT
** (flashback:6719): DEBUG: have 1167371 events
Killed
select version();
+---------------+
| version() |
+---------------+
| 5.7.19-17-log |
+---------------+
1 row in set (0.00 sec)
如题,运行报「Segmentation fault」
flashback --binlogFileNames=/data/mysql/mysql-bin.000001
Segmentation fault
请问这是什么原因呢?MySQL 版本为5.7,操作系统 centos6.8
Kudos on the great work. Thank you for sharing. What license is MyFlash available under: GPL/MIT/BSD?
请问是否支持 mysql8 的 binlog 闪回
/usr/bin/ld: /usr/lib64/libglib-2.0.a(libglib_2_0_la-gthread-posix.o): undefined reference to symbol 'pthread_setname_np@@GLIBC_2.12'
静态编译报错。
/usr/src/MyFlash# bash build.sh
/tmp/cc2yjKH9.o: In function checkPotentialConflictOutputFile': /usr/src/MyFlash/source/binlogParseGlib.c:305: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:315: undefined reference to g_log' /tmp/cc2yjKH9.o: In function
constructFileNameWithPostfixIndex':
/usr/src/MyFlash/source/binlogParseGlib.c:330: undefined reference to g_strdup_printf' /usr/src/MyFlash/source/binlogParseGlib.c:333: undefined reference to
g_strdup_printf'
/tmp/cc2yjKH9.o: In function rotateFile': /usr/src/MyFlash/source/binlogParseGlib.c:347: undefined reference to
g_log'
/tmp/cc2yjKH9.o: In function rotateOutputBinlogFileNames': /usr/src/MyFlash/source/binlogParseGlib.c:354: undefined reference to
g_strdup_printf'
/tmp/cc2yjKH9.o: In function packUuidInto16Bytes': /usr/src/MyFlash/source/binlogParseGlib.c:397: undefined reference to
g_malloc0_n'
/usr/src/MyFlash/source/binlogParseGlib.c:411: undefined reference to g_ascii_tolower' /usr/src/MyFlash/source/binlogParseGlib.c:411: undefined reference to
g_ascii_tolower'
/usr/src/MyFlash/source/binlogParseGlib.c:412: undefined reference to g_ascii_tolower' /tmp/cc2yjKH9.o: In function
isDatabaseShouldApply':
/usr/src/MyFlash/source/binlogParseGlib.c:432: undefined reference to g_strsplit' /usr/src/MyFlash/source/binlogParseGlib.c:435: undefined reference to
g_ascii_strcasecmp'
/tmp/cc2yjKH9.o: In function isTableShouldApply': /usr/src/MyFlash/source/binlogParseGlib.c:448: undefined reference to
g_strsplit'
/usr/src/MyFlash/source/binlogParseGlib.c:451: undefined reference to g_ascii_strcasecmp' /tmp/cc2yjKH9.o: In function
isEventTypeShouldApply':
/usr/src/MyFlash/source/binlogParseGlib.c:466: undefined reference to g_strsplit' /usr/src/MyFlash/source/binlogParseGlib.c:469: undefined reference to
g_ascii_strcasecmp'
/usr/src/MyFlash/source/binlogParseGlib.c:471: undefined reference to g_ascii_strcasecmp' /usr/src/MyFlash/source/binlogParseGlib.c:473: undefined reference to
g_ascii_strcasecmp'
/tmp/cc2yjKH9.o: In function getIoChannelForWrite': /usr/src/MyFlash/source/binlogParseGlib.c:585: undefined reference to
g_io_channel_new_file'
/usr/src/MyFlash/source/binlogParseGlib.c:587: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:591: undefined reference to
g_io_channel_set_encoding'
/usr/src/MyFlash/source/binlogParseGlib.c:593: undefined reference to g_log' /tmp/cc2yjKH9.o: In function
printHex':
/usr/src/MyFlash/source/binlogParseGlib.c:687: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:689: undefined reference to
g_log'
/tmp/cc2yjKH9.o: In function printEventInHex': /usr/src/MyFlash/source/binlogParseGlib.c:697: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:699: undefined reference to g_log' /tmp/cc2yjKH9.o:/usr/src/MyFlash/source/binlogParseGlib.c:745: more undefined references to
g_log' follow
/tmp/cc2yjKH9.o: In function isTransactionBeginText': /usr/src/MyFlash/source/binlogParseGlib.c:802: undefined reference to
g_ascii_strcasecmp'
/tmp/cc2yjKH9.o: In function initTableMapEvent': /usr/src/MyFlash/source/binlogParseGlib.c:1465: undefined reference to
g_byte_array_new'
/tmp/cc2yjKH9.o: In function parseQueryLogEvent': /usr/src/MyFlash/source/binlogParseGlib.c:1503: undefined reference to
g_malloc0_n'
/usr/src/MyFlash/source/binlogParseGlib.c:1507: undefined reference to g_malloc0_n' /usr/src/MyFlash/source/binlogParseGlib.c:1516: undefined reference to
g_malloc0_n'
/tmp/cc2yjKH9.o: In function parseGtidEvent': /usr/src/MyFlash/source/binlogParseGlib.c:1535: undefined reference to
g_malloc0_n'
/tmp/cc2yjKH9.o: In function parseTableMapEventData': /usr/src/MyFlash/source/binlogParseGlib.c:1564: undefined reference to
g_malloc0_n'
/tmp/cc2yjKH9.o:/usr/src/MyFlash/source/binlogParseGlib.c:1573: more undefined references to g_malloc0_n' follow /tmp/cc2yjKH9.o: In function
parseTableMapEventData':
/usr/src/MyFlash/source/binlogParseGlib.c:1586: undefined reference to g_byte_array_append' /tmp/cc2yjKH9.o: In function
appendToAllEventList':
/usr/src/MyFlash/source/binlogParseGlib.c:1628: undefined reference to g_malloc0_n' /usr/src/MyFlash/source/binlogParseGlib.c:1631: undefined reference to
g_list_prepend'
/tmp/cc2yjKH9.o: In function deepCopyEventHeader': /usr/src/MyFlash/source/binlogParseGlib.c:1647: undefined reference to
g_malloc0_n'
/usr/src/MyFlash/source/binlogParseGlib.c:1656: undefined reference to g_malloc0_n' /tmp/cc2yjKH9.o: In function
deepCopyEventWrapper':
/usr/src/MyFlash/source/binlogParseGlib.c:1666: undefined reference to g_malloc0_n' /usr/src/MyFlash/source/binlogParseGlib.c:1672: undefined reference to
g_malloc0_n'
/usr/src/MyFlash/source/binlogParseGlib.c:1677: undefined reference to g_malloc0_n' /tmp/cc2yjKH9.o:/usr/src/MyFlash/source/binlogParseGlib.c:1686: more undefined references to
g_malloc0_n' follow
/tmp/cc2yjKH9.o: In function deepCopyEventWrapper': /usr/src/MyFlash/source/binlogParseGlib.c:1715: undefined reference to
g_byte_array_new'
/usr/src/MyFlash/source/binlogParseGlib.c:1718: undefined reference to g_byte_array_append' /usr/src/MyFlash/source/binlogParseGlib.c:1749: undefined reference to
g_malloc0_n'
/usr/src/MyFlash/source/binlogParseGlib.c:1754: undefined reference to g_malloc0_n' /usr/src/MyFlash/source/binlogParseGlib.c:1763: undefined reference to
g_malloc0_n'
/usr/src/MyFlash/source/binlogParseGlib.c:1769: undefined reference to g_malloc0_n' /usr/src/MyFlash/source/binlogParseGlib.c:1774: undefined reference to
g_malloc0_n'
/tmp/cc2yjKH9.o:/usr/src/MyFlash/source/binlogParseGlib.c:1779: more undefined references to g_malloc0_n' follow /tmp/cc2yjKH9.o: In function
isLeastExecutionUnitShouldKeep':
/usr/src/MyFlash/source/binlogParseGlib.c:1822: undefined reference to g_log' /tmp/cc2yjKH9.o: In function
constructLeastExecutionUnitFromAllEventsList':
/usr/src/MyFlash/source/binlogParseGlib.c:1854: undefined reference to g_malloc0_n' /usr/src/MyFlash/source/binlogParseGlib.c:1856: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:1859: undefined reference to g_list_append' /usr/src/MyFlash/source/binlogParseGlib.c:1861: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:1869: undefined reference to g_list_append' /usr/src/MyFlash/source/binlogParseGlib.c:1873: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:1881: undefined reference to g_list_length' /usr/src/MyFlash/source/binlogParseGlib.c:1881: undefined reference to
g_log'
/tmp/cc2yjKH9.o: In function exchangeBeforeRowImageWithAfterRowImage': /usr/src/MyFlash/source/binlogParseGlib.c:1889: undefined reference to
g_malloc0_n'
/tmp/cc2yjKH9.o: In function reverseLeastExecutionUnitEventsForUpdateRowEvent': /usr/src/MyFlash/source/binlogParseGlib.c:1932: undefined reference to
g_malloc0_n'
/usr/src/MyFlash/source/binlogParseGlib.c:1936: undefined reference to g_malloc0_n' /usr/src/MyFlash/source/binlogParseGlib.c:1960: undefined reference to
g_malloc0_n'
/usr/src/MyFlash/source/binlogParseGlib.c:1972: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:1988: undefined reference to
g_log'
/tmp/cc2yjKH9.o: In function reverseLeastExecutionUnitEventsForWriteOrDeleteRowEvent': /usr/src/MyFlash/source/binlogParseGlib.c:2006: undefined reference to
g_log'
/tmp/cc2yjKH9.o: In function appendFormatDescriptionEventToChannel': /usr/src/MyFlash/source/binlogParseGlib.c:2050: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:2055: undefined reference to g_io_channel_write_chars' /usr/src/MyFlash/source/binlogParseGlib.c:2057: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:2061: undefined reference to g_io_channel_write_chars' /usr/src/MyFlash/source/binlogParseGlib.c:2063: undefined reference to
g_log'
/tmp/cc2yjKH9.o: In function constructBinlogFromEventListWithSizeLimit': /usr/src/MyFlash/source/binlogParseGlib.c:2075: undefined reference to
g_io_channel_write_chars'
/usr/src/MyFlash/source/binlogParseGlib.c:2077: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2092: undefined reference to
g_io_channel_write_chars'
/usr/src/MyFlash/source/binlogParseGlib.c:2094: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2097: undefined reference to
g_io_channel_write_chars'
/usr/src/MyFlash/source/binlogParseGlib.c:2099: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2111: undefined reference to
g_io_channel_flush'
/usr/src/MyFlash/source/binlogParseGlib.c:2113: undefined reference to g_log' /tmp/cc2yjKH9.o: In function
splitBigRowEventsToTableMapWithRowEventForEventList':
/usr/src/MyFlash/source/binlogParseGlib.c:2126: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2136: undefined reference to
g_list_prepend'
/usr/src/MyFlash/source/binlogParseGlib.c:2137: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2139: undefined reference to
g_list_prepend'
/usr/src/MyFlash/source/binlogParseGlib.c:2147: undefined reference to g_list_reverse' /tmp/cc2yjKH9.o: In function
constructBinlogFromLeastExecutionUintList':
/usr/src/MyFlash/source/binlogParseGlib.c:2173: undefined reference to g_strdup_printf' /usr/src/MyFlash/source/binlogParseGlib.c:2179: undefined reference to
g_io_channel_write_chars'
/usr/src/MyFlash/source/binlogParseGlib.c:2181: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2195: undefined reference to
g_io_channel_write_chars'
/usr/src/MyFlash/source/binlogParseGlib.c:2197: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2200: undefined reference to
g_io_channel_write_chars'
/usr/src/MyFlash/source/binlogParseGlib.c:2202: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2215: undefined reference to
g_io_channel_write_chars'
/usr/src/MyFlash/source/binlogParseGlib.c:2217: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2221: undefined reference to
g_io_channel_write_chars'
/usr/src/MyFlash/source/binlogParseGlib.c:2223: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2231: undefined reference to
g_io_channel_flush'
/tmp/cc2yjKH9.o: In function flashbackAllEvents': /usr/src/MyFlash/source/binlogParseGlib.c:2244: undefined reference to
g_list_prepend'
/usr/src/MyFlash/source/binlogParseGlib.c:2248: undefined reference to g_list_reverse' /usr/src/MyFlash/source/binlogParseGlib.c:2252: undefined reference to
g_list_length'
/usr/src/MyFlash/source/binlogParseGlib.c:2252: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2263: undefined reference to
g_list_reverse'
/tmp/cc2yjKH9.o: In function processBinlog': /usr/src/MyFlash/source/binlogParseGlib.c:2279: undefined reference to
g_io_channel_seek_position'
/usr/src/MyFlash/source/binlogParseGlib.c:2281: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2291: undefined reference to
g_malloc0_n'
/usr/src/MyFlash/source/binlogParseGlib.c:2294: undefined reference to g_io_channel_seek_position' /usr/src/MyFlash/source/binlogParseGlib.c:2295: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:2298: undefined reference to g_malloc0_n' /usr/src/MyFlash/source/binlogParseGlib.c:2301: undefined reference to
g_io_channel_read_chars'
/usr/src/MyFlash/source/binlogParseGlib.c:2302: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2305: undefined reference to
g_malloc0_n'
/usr/src/MyFlash/source/binlogParseGlib.c:2313: undefined reference to g_malloc0_n' /usr/src/MyFlash/source/binlogParseGlib.c:2316: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:2323: undefined reference to g_malloc0_n' /usr/src/MyFlash/source/binlogParseGlib.c:2330: undefined reference to
g_malloc0_n'
/usr/src/MyFlash/source/binlogParseGlib.c:2338: undefined reference to g_malloc0_n' /usr/src/MyFlash/source/binlogParseGlib.c:2344: undefined reference to
g_malloc0_n'
/usr/src/MyFlash/source/binlogParseGlib.c:2361: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2368: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:2371: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2373: undefined reference to
g_list_delete_link'
/usr/src/MyFlash/source/binlogParseGlib.c:2377: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2379: undefined reference to
g_list_delete_link'
/usr/src/MyFlash/source/binlogParseGlib.c:2382: undefined reference to g_io_channel_seek_position' /usr/src/MyFlash/source/binlogParseGlib.c:2383: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:2289: undefined reference to g_io_channel_read_chars' /usr/src/MyFlash/source/binlogParseGlib.c:2392: undefined reference to
g_list_length'
/usr/src/MyFlash/source/binlogParseGlib.c:2392: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2394: undefined reference to
g_list_reverse'
/usr/src/MyFlash/source/binlogParseGlib.c:2397: undefined reference to g_log' /tmp/cc2yjKH9.o: In function
parsemultipleGtidSetToGtidSetInfoArray':
/usr/src/MyFlash/source/binlogParseGlib.c:2428: undefined reference to g_array_new' /usr/src/MyFlash/source/binlogParseGlib.c:2431: undefined reference to
g_strsplit'
/usr/src/MyFlash/source/binlogParseGlib.c:2437: undefined reference to g_malloc0_n' /usr/src/MyFlash/source/binlogParseGlib.c:2438: undefined reference to
g_strsplit'
/usr/src/MyFlash/source/binlogParseGlib.c:2440: undefined reference to g_strsplit' /usr/src/MyFlash/source/binlogParseGlib.c:2443: undefined reference to
g_strv_length'
/usr/src/MyFlash/source/binlogParseGlib.c:2453: undefined reference to g_array_append_vals' /tmp/cc2yjKH9.o: In function
parseOption':
/usr/src/MyFlash/source/binlogParseGlib.c:2482: undefined reference to g_option_context_new' /usr/src/MyFlash/source/binlogParseGlib.c:2483: undefined reference to
g_option_context_add_main_entries'
/usr/src/MyFlash/source/binlogParseGlib.c:2484: undefined reference to g_option_context_parse' /usr/src/MyFlash/source/binlogParseGlib.c:2486: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:2492: undefined reference to g_malloc0_n' /usr/src/MyFlash/source/binlogParseGlib.c:2501: undefined reference to
g_malloc0_n'
/usr/src/MyFlash/source/binlogParseGlib.c:2513: undefined reference to g_log' /usr/src/MyFlash/source/binlogParseGlib.c:2523: undefined reference to
g_log'
/tmp/cc2yjKH9.o: In function setLogHandler': /usr/src/MyFlash/source/binlogParseGlib.c:2548: undefined reference to
g_log_set_handler'
/usr/src/MyFlash/source/binlogParseGlib.c:2549: undefined reference to g_ascii_strcasecmp' /usr/src/MyFlash/source/binlogParseGlib.c:2550: undefined reference to
g_log_default_handler'
/usr/src/MyFlash/source/binlogParseGlib.c:2550: undefined reference to g_log_set_handler' /usr/src/MyFlash/source/binlogParseGlib.c:2551: undefined reference to
g_ascii_strcasecmp'
/usr/src/MyFlash/source/binlogParseGlib.c:2552: undefined reference to g_log_default_handler' /usr/src/MyFlash/source/binlogParseGlib.c:2552: undefined reference to
g_log_set_handler'
/usr/src/MyFlash/source/binlogParseGlib.c:2554: undefined reference to g_log_default_handler' /usr/src/MyFlash/source/binlogParseGlib.c:2554: undefined reference to
g_log_set_handler'
/tmp/cc2yjKH9.o: In function main': /usr/src/MyFlash/source/binlogParseGlib.c:2568: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:2571: undefined reference to g_strsplit' /usr/src/MyFlash/source/binlogParseGlib.c:2583: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:2590: undefined reference to g_io_channel_new_file' /usr/src/MyFlash/source/binlogParseGlib.c:2592: undefined reference to
g_log'
/usr/src/MyFlash/source/binlogParseGlib.c:2595: undefined reference to g_io_channel_set_encoding' /usr/src/MyFlash/source/binlogParseGlib.c:2597: undefined reference to
g_log'
collect2: error: ld returned 1 exit status
调整编译参数循序后,就可以了,什么原因?
gcc source/binlogParseGlib.c -o binary/flashback -w pkg-config --cflags --libs glib-2.0
/usr/src/MyFlash# binary/flashback --help
Usage:
flashback [OPTION...]
Help Options:
-h, --help Show help options
Application Options:
--databaseNames databaseName to apply. if multiple, seperate by comma(,)
--tableNames tableName to apply. if multiple, seperate by comma(,)
--start-position start position
--stop-position stop position
--start-datetime start time (format %Y-%m-%d %H:%M:%S)
--stop-datetime stop time (format %Y-%m-%d %H:%M:%S)
--sqlTypes sql type to filter . support INSERT, UPDATE ,DELETE. if multiple, seperate by comma(,)
--maxSplitSize max file size after split, the uint is M
--binlogFileNames binlog files to process. if multiple, seperate by comma(,)
--outBinlogFileNameBase output binlog file name base
--logLevel log level, available option is debug,warning,error
--include-gtids gtids to process
--exclude-gtids gtids to skip
阿里云,RDS不支持
binary/flashback --binlogFileNames=bin-log.000010
Segmentation fault (core dumped)
[root@slave2 binary]# ./mysqlbinlog20160408 binlog_output_base.flashback --skip-gtids |mysql -uroot -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1782 (HY000) at line 18: @@SESSION.GTID_NEXT cannot be set to ANONYMOUS when @@GLOBAL.GTID_MODE = ON.
在开启GTID的mysql中按照FAQ的指导加上了skip-gtids恢复,依然报错。
使用以下命令时报错mysqlbinlog --skip-gtids binlog_output_base.flashback -d jjc | mysql -hlocalhost -P3308 -uroot
错误信息为ERROR 1105 (HY000) at line 17: Unknown error
15行 #230824 15:59:47 server id 23042158 end_log_pos 374 CRC32 0xe4e9d7df Write_rows: table id 152 flags: STMT_END_F
16行 (空白)
17行 BINLOG '
服务器版本centos6.9
数据库版本mysql5.7.29
请教下这种问题需要如何处理
解析RDS的binlog时,无报错。正常运行完后,无结果。
根据日志,感觉是事件类型解析错误
日志打印:** (flashback:26528): DEBUG: skip the event QUERY_EVENT
** (flashback:5846): WARNING **: option parsing failed: Integer value '3122794731' for --stop-position out of range
对于一些大表来讲,超过2GB的binlog position挺常见的,目前MyFlash仅支持int32的position
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.