MXS-1209: added blr_handle_fake_gtid_list

New routine blr_handle_fake_gtid_list added for fake GTID_LIST_EVENT.

blr_file_append O_APPEND is set only if mariadb10_master_gtid is not
set.

blr_file_append() routine could change name in next commits
This commit is contained in:
MassimilianoPinto
2017-05-05 15:42:23 +02:00
parent 1eaed91867
commit ab89685075
4 changed files with 166 additions and 43 deletions

View File

@ -463,12 +463,19 @@ blr_file_append(ROUTER_INSTANCE *router, char *file)
{
char path[PATH_MAX + 1] = "";
int fd;
int flags = O_RDWR;
/* If Master GTID registration is not set, then use append */
if (!router->mariadb10_master_gtid)
{
flags |= O_APPEND;
}
strcpy(path, router->binlogdir);
strcat(path, "/");
strcat(path, file);
if ((fd = open(path, O_RDWR | O_APPEND, 0666)) == -1)
if ((fd = open(path, flags, 0666)) == -1)
{
MXS_ERROR("Failed to open binlog file %s for append.",
path);