MXS-1266: files are saved in GTID repo at creation time

Files are saved in GTID repo at creation time: this allows to show
files without transactions via SHOW [FULL] BINARY LOGS

The FULL keywords add domain_id and server id to the output as file
prefix: 0/10122/mysql-bin.000080
This commit is contained in:
MassimilianoPinto
2017-05-29 10:58:02 +02:00
parent a6e4ff1c10
commit f66623c382
5 changed files with 111 additions and 20 deletions

View File

@ -1103,6 +1103,7 @@ blr_handle_binlog_record(ROUTER_INSTANCE *router, GWBUF *pkt)
strcpy(router->pending_transaction.gtid, mariadb_gtid);
/* Save the pending GTID components */
router->pending_transaction.gtid_elms.domain_id = domainid;
/* This is the master id, no override */
router->pending_transaction.gtid_elms.server_id = hdr.serverid;
router->pending_transaction.gtid_elms.seq_no = n_sequence;
}
@ -2274,6 +2275,12 @@ static void blr_register_heartbeat(ROUTER_INSTANCE *router, GWBUF *buf)
"serverid",
buf);
/**
* Keep the original master server id
* for any further reference.
*/
router->orig_masterid = atoi(val);
/**
* Set router->masterid from master server-id
* if it's not set by the config option