Fix binlog rotation detection
The rotations of binlogs weren't detected as the file names weren't compared. Moved the indexing of the binlogs to the end of the binlog processing. This way the files can be flushed multiple times before they are indexed.
This commit is contained in:
@ -1000,14 +1000,20 @@ void converter_func(void* data)
|
||||
while (ok && binlog_end == AVRO_OK)
|
||||
{
|
||||
uint64_t start_pos = router->current_pos;
|
||||
char binlog_name[BINLOG_FNAMELEN + 1];
|
||||
strcpy(binlog_name, router->binlog_name);
|
||||
|
||||
if (avro_open_binlog(router->binlogdir, router->binlog_name, &router->binlog_fd))
|
||||
{
|
||||
binlog_end = avro_read_all_events(router);
|
||||
|
||||
if (router->current_pos != start_pos)
|
||||
if (router->current_pos != start_pos || strcmp(binlog_name, router->binlog_name) != 0)
|
||||
{
|
||||
/** We processed some data, reset the conversion task delay */
|
||||
router->task_delay = 1;
|
||||
|
||||
/** Update the GTID index */
|
||||
avro_update_index(router);
|
||||
}
|
||||
|
||||
avro_close_binlog(router->binlog_fd);
|
||||
|
@ -867,9 +867,6 @@ void avro_flush_all_tables(AVRO_INSTANCE *router)
|
||||
}
|
||||
hashtable_iterator_free(iter);
|
||||
}
|
||||
|
||||
/** Update the GTID index */
|
||||
avro_update_index(router);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user