mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
MDEV-13821 : mariabackup sometimes could lose ib_logf(FATAL) messages,
The messages are getting lost because they are written with fprintf() but without fflush(), so abort() would lose buffered text. Applied fix from 10.2, which makes in_logf() use sql_print_information(), which in turn does proper flush after each message
This commit is contained in:
parent
93087d5fe7
commit
ad17e8e518
2 changed files with 21 additions and 21 deletions
|
@ -95,6 +95,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
#include <sql_plugin.h>
|
||||
#include <srv0srv.h>
|
||||
#include <crc_glue.h>
|
||||
#include <log.h>
|
||||
|
||||
/* TODO: replace with appropriate macros used in InnoDB 5.6 */
|
||||
#define PAGE_ZIP_MIN_SIZE_SHIFT 10
|
||||
|
@ -6483,6 +6484,11 @@ int main(int argc, char **argv)
|
|||
system_charset_info = &my_charset_utf8_general_ci;
|
||||
key_map_full.set_all();
|
||||
|
||||
logger.init_base();
|
||||
logger.set_handlers(LOG_FILE, LOG_NONE, LOG_NONE);
|
||||
mysql_mutex_init(key_LOCK_error_log, &LOCK_error_log,
|
||||
MY_MUTEX_INIT_FAST);
|
||||
|
||||
handle_options(argc, argv, &client_defaults, &server_defaults);
|
||||
|
||||
int argc_server;
|
||||
|
|
|
@ -21949,27 +21949,21 @@ ib_logf(
|
|||
str = static_cast<char*>(malloc(BUFSIZ));
|
||||
my_vsnprintf(str, BUFSIZ, format, args);
|
||||
#endif /* __WIN__ */
|
||||
if (!IS_XTRABACKUP()) {
|
||||
switch (level) {
|
||||
case IB_LOG_LEVEL_INFO:
|
||||
sql_print_information("InnoDB: %s", str);
|
||||
break;
|
||||
case IB_LOG_LEVEL_WARN:
|
||||
sql_print_warning("InnoDB: %s", str);
|
||||
break;
|
||||
case IB_LOG_LEVEL_ERROR:
|
||||
sql_print_error("InnoDB: %s", str);
|
||||
sd_notifyf(0, "STATUS=InnoDB: Error: %s", str);
|
||||
break;
|
||||
case IB_LOG_LEVEL_FATAL:
|
||||
sql_print_error("InnoDB: %s", str);
|
||||
sd_notifyf(0, "STATUS=InnoDB: Fatal: %s", str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Don't use server logger for XtraBackup, just print to stderr. */
|
||||
fprintf(stderr, "InnoDB: %s\n", str);
|
||||
switch (level) {
|
||||
case IB_LOG_LEVEL_INFO:
|
||||
sql_print_information("InnoDB: %s", str);
|
||||
break;
|
||||
case IB_LOG_LEVEL_WARN:
|
||||
sql_print_warning("InnoDB: %s", str);
|
||||
break;
|
||||
case IB_LOG_LEVEL_ERROR:
|
||||
sql_print_error("InnoDB: %s", str);
|
||||
sd_notifyf(0, "STATUS=InnoDB: Error: %s", str);
|
||||
break;
|
||||
case IB_LOG_LEVEL_FATAL:
|
||||
sql_print_error("InnoDB: %s", str);
|
||||
sd_notifyf(0, "STATUS=InnoDB: Fatal: %s", str);
|
||||
break;
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
|
|
Loading…
Reference in a new issue