Skip to content

Err: unsupport type 0 in binlog #398

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

Closed
FortuneOSarcasm opened this issue Jun 27, 2019 · 5 comments
Closed

Err: unsupport type 0 in binlog #398

FortuneOSarcasm opened this issue Jun 27, 2019 · 5 comments
Labels

Comments

@FortuneOSarcasm
Copy link

I've been trying to use your library for parsing a MariaDB 10.1.37 binlog and I keep getting the following error

[2019/06/27 13:49:49] binlogstreamer.go:77 [Error] close sync with err: Header &replication.EventHeader{Timestamp:0x5d1496a1, EventType:0x18, ServerID:0xf811c, EventSize:0x6e, LogPos:0x3b28, Flags:0x0}, Data "+\x00\x00\x00\x00\x00\x01\x00\a\xff\xff\x80*\xc7\x0f\nBlah\x12\x00\b\x00      37.00\bAPI70156\x00\x80*\xc7\x0f\nBlah\x12\x00\x06\x00      37.00\bAPI70156\x00", Err: unsupport type 0 in binlog and don't know how to handle

The app crashes afterwards.

@siddontang
Copy link
Collaborator

oh, strange, I can't know the reason now.

can you use mysqlbinlog to parse the binlog file?

@FortuneOSarcasm
Copy link
Author

Yes, it parses fine locally with mysqlbinlog.

@siddontang
Copy link
Collaborator

so can you use go-mysqlbinlog to parse it?

@FortuneOSarcasm
Copy link
Author

I haven't tried. I have only used the binlogstreamer to read the binlog. I'll give it a go.

@dveeden dveeden added the mariadb label Nov 7, 2024
@dveeden
Copy link
Collaborator

dveeden commented Nov 8, 2024

MariaDB server (10.1.48):

podman run -p 3307:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -it mariadb:10.1 --log-bin --binlog-format=row
set global server_id=2;
reset master;

go-mysqlbinlog output

$ ./bin/go-mysqlbinlog -port 3307
[2024/11/08 10:46:50] [info] binlogsyncer.go:189 create BinlogSyncer with config {ServerID:101 Flavor:mysql Host:127.0.0.1 Port:3307 User:root Password: Localhost: Charset: SemiSyncEnabled:false RawModeEnabled:false TLSConfig:<nil> ParseTime:false TimestampStringLocation:UTC UseDecimal:true RecvBufferSize:0 HeartbeatPeriod:0s ReadTimeout:0s MaxReconnectAttempts:0 DisableRetrySync:false VerifyChecksum:false DumpCommandFlag:0 Option:<nil> Logger:0xc0000a62a0 Dialer:0x6d0d00 RowsEventDecodeFunc:<nil> TableMapOptionalMetaDecodeFunc:<nil> DiscardGTIDSet:false EventCacheCount:10240 SynchronousEventHandler:<nil>}
[2024/11/08 10:46:50] [info] binlogsyncer.go:429 begin to sync binlog from position (, 4)
[2024/11/08 10:46:50] [info] binlogsyncer.go:407 Connected to mysql 5.5.5-10.1.48-MariaDB-1~bionic server
[2024/11/08 10:46:50] [info] binlogsyncer.go:846 rotate to (mysqld-bin.000001, 4)
=== RotateEvent ===
Date: 1970-01-01 01:00:00
Log position: 0
Event size: 44
Position: 4
Next log name: mysqld-bin.000001

=== FormatDescriptionEvent ===
Date: 2024-11-08 10:46:29
Log position: 249
Event size: 245
Version: 4
Server version: 10.1.48-MariaDB-1~bionic
Checksum algorithm: 0

=== UserVarEvent ===
Date: 2024-11-08 10:46:29
Log position: 274
Event size: 25
Event data: 
00000000  01 00 00 00 21 01                                 |....!.|

=== QueryEvent ===
Date: 2024-11-08 10:46:29
Log position: 314
Event size: 40
Slave proxy ID: 0
Execution time: 0
Error code: 0
Schema: 
Query: # Dummy

Binlog info:

mysql-5.5.5-10.1.48-MariaDB-1~bionic> show master status;
+-------------------+----------+--------------+------------------+
| File              | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+-------------------+----------+--------------+------------------+
| mysqld-bin.000001 |      314 |              |                  |
+-------------------+----------+--------------+------------------+
1 row in set (0.00 sec)

mysql-5.5.5-10.1.48-MariaDB-1~bionic> show binlog events ;
+-------------------+-----+-------------------+-----------+-------------+-----------------------------------------------------+
| Log_name          | Pos | Event_type        | Server_id | End_log_pos | Info                                                |
+-------------------+-----+-------------------+-----------+-------------+-----------------------------------------------------+
| mysqld-bin.000001 |   4 | Format_desc       |         2 |         249 | Server ver: 10.1.48-MariaDB-1~bionic, Binlog ver: 4 |
| mysqld-bin.000001 | 249 | Gtid_list         |         2 |         274 | []                                                  |
| mysqld-bin.000001 | 274 | Binlog_checkpoint |         2 |         314 | mysqld-bin.000001                                   |
+-------------------+-----+-------------------+-----------+-------------+-----------------------------------------------------+
3 rows in set (0.00 sec)

So this issue seems to be fixed. For the correct decoding of Gtid_list and Binlog_checkpoint I have opened #944

@dveeden dveeden closed this as completed Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants