Binlog server: handle filestem in blr_handle_missing_files()
Routine blr_handle_missing_files() is called by blr_handle_fake_rotate(). Field ‘filestem’ is updated in order to avoid wrong file name creation. Additionally router is not creating any missing filenames if router->binlog_name is empty (no previous binlog files)
This commit is contained in:
@ -3370,7 +3370,26 @@ static bool blr_handle_missing_files(ROUTER_INSTANCE *router,
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (router->fileroot)
|
||||
{
|
||||
MXS_FREE(router->fileroot);
|
||||
}
|
||||
/* set filestem */
|
||||
router->fileroot = MXS_STRNDUP_A(new_file, fptr - new_file);
|
||||
|
||||
new_fseqno = atol(fptr + 1);
|
||||
|
||||
if (!*router->binlog_name)
|
||||
{
|
||||
MXS_INFO("Fake ROTATE_EVENT comes with %s log file."
|
||||
" Current router binlog file has not been set yet."
|
||||
" Skipping creation of empty files"
|
||||
" before sequence %" PRIu32 "",
|
||||
new_file,
|
||||
new_fseqno);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (*router->binlog_name &&
|
||||
(fptr = strrchr(router->binlog_name, '.')) == NULL)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user