{"record":{"id":"33e6ec9a00242866","repo":"vitessio/vitess","slug":"can-t-get-gtid-from-binlog-event-v-event-data","errorCode":null,"errorMessage":"can't get GTID from binlog event: %v, event data: %#v","messagePattern":"can't get GTID from binlog event: (.+?), event data: %#v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/binlog/binlog_streamer.go","lineNumber":350,"sourceCode":"\t\t\t// is a fake ROTATE_EVENT, which the primary sends to tell us the name\n\t\t\t// of the current log file.\n\t\t\tif ev.IsRotate() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn pos, fmt.Errorf(\"got a real event before FORMAT_DESCRIPTION_EVENT: %#v\", ev)\n\t\t}\n\n\t\t// Strip the checksum, if any. We don't actually verify the checksum, so discard it.\n\t\tev, _, err = ev.StripChecksum(format)\n\t\tif err != nil {\n\t\t\treturn pos, fmt.Errorf(\"can't strip checksum from binlog event: %v, event data: %#v\", err, ev)\n\t\t}\n\n\t\tswitch {\n\t\tcase ev.IsPseudo():\n\t\t\tgtid, _, _, _, err = ev.GTID(format)\n\t\t\tif err != nil {\n\t\t\t\treturn pos, fmt.Errorf(\"can't get GTID from binlog event: %v, event data: %#v\", err, ev)\n\t\t\t}\n\t\t\toldpos := pos\n\t\t\tpos = replication.AppendGTID(pos, gtid)\n\t\t\t// If the event is received outside of a transaction, it must\n\t\t\t// be sent. Otherwise, it will get lost and the targets will go out\n\t\t\t// of sync.\n\t\t\tif autocommit && !pos.Equal(oldpos) {\n\t\t\t\tif err = commit(ev.Timestamp()); err != nil {\n\t\t\t\t\treturn pos, err\n\t\t\t\t}\n\t\t\t}\n\t\tcase ev.IsGTID(): // GTID_EVENT: update current GTID, maybe BEGIN.\n\t\t\tvar hasBegin bool\n\t\t\tgtid, hasBegin, _, _, err = ev.GTID(format)\n\t\t\tif err != nil {\n\t\t\t\treturn pos, fmt.Errorf(\"can't get GTID from binlog event: %v, event data: %#v\", err, ev)\n\t\t\t}\n\t\t\tpos = replication.AppendGTID(pos, gtid)","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/binlog/binlog_streamer.go#L332-L368","documentation":"For pseudo (e.g. PREVIOUS_GTIDS/anonymous) events, parseEvents extracts the GTID via ev.GTID(format) to track stream position. If GTID extraction fails — the event's GTID format is unsupported or the buffer is malformed — the streamer cannot maintain position and aborts.","triggerScenarios":"During Stream/parseEvents, ev.IsPseudo() is true and ev.GTID(format) errors — e.g. a GTID flavor (MySQL, MariaDB) the client cannot decode, or corrupt GTID payload bytes.","commonSituations":"Mixing GTID modes/flavors (MySQL GTID vs MariaDB) across a topology; binlog data from an unsupported server version; corrupted GTID event payload.","solutions":["Ensure the source server's GTID mode/flavor matches what Vitess expects (gtid_mode=ON for MySQL; matching MariaDB flavor builds)","Check that the tablet is built with support for the source's GTID flavor","Validate the binlog with mysqlbinlog to rule out corruption","Restart the stream from a known-good position; if it persists, upgrade Vitess","If GTID is intentionally off, confirm the flavor's GTID representation is still parseable by Vitess"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// confirm GTID mode is configured consistently before streaming\n// mysql> SELECT @@global.gtid_mode; -- expect ON for MySQL sources","typeGuard":null,"tryCatchPattern":"if err := streamer.Stream(ctx); err != nil {\n\tif strings.Contains(err.Error(), \"can't get GTID\") {\n\t\t// GTID flavor mismatch/corruption: verify gtid_mode and flavor, restart from good position\n\t}\n}","preventionTips":["Use matching GTID flavors (MySQL vs MariaDB) across the topology","Set gtid_mode=ON on MySQL sources used for filtered replication","Validate binlog flavor compatibility when provisioning tablets"],"tags":["binlog","gtid","parsing"],"backgroundTag":"gtid-parse-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}