1
0
mirror of https://github.com/MariaDB/server.git synced 2025-05-01 08:45:04 +03:00

WL#1717 "binlog/innodb consistency".

Final push. Printing some warnings at startup, as --innodb-safe-binlog requires
some other options, to work as expected.
Adding 6 new tests (3 pairs). If they fail on some platforms (so far they have been run only on my Linux),
they should be ignored for the 4.1.3 build (you can just
rm mysql-test/*/rpl_crash_*).
Now going to update doc.


mysql-test/misc/kill_master.sh:
  If the mysqld process has already gone away, 'kill' will fail, so we need to explicitely
  exit 0, so that the non-zero return code of kill does not make mysqltest stop.
sql/log.cc:
  VC++ does not know (ulonglong)(-1)
sql/mysqld.cc:
  When using --innodb-safe-binlog, some options need to automatically be turned on.
This commit is contained in:
unknown 2004-06-23 23:51:40 +02:00
parent 3220a94519
commit 424007ec29
3 changed files with 37 additions and 2 deletions

View File

@ -1 +1,4 @@
kill -9 `cat var/run/master.pid`
# The kill may fail if process has already gone away,
# so don't use the exit code of the kill. Use 0.
exit 0

View File

@ -2059,7 +2059,7 @@ bool MYSQL_LOG::cut_spurious_tail()
*/
char *name= ha_innobase::get_mysql_bin_log_name();
ulonglong pos= ha_innobase::get_mysql_bin_log_pos();
if (name[0] == 0 || pos == (ulonglong)(-1))
if (name[0] == 0 || pos == ULONGLONG_MAX)
{
DBUG_PRINT("info", ("InnoDB has not set binlog info"));
DBUG_RETURN(0);

View File

@ -2544,6 +2544,36 @@ server.");
}
}
if (opt_innodb_safe_binlog)
{
if (innobase_flush_log_at_trx_commit != 1)
{
sql_print_error("Warning: --innodb-safe-binlog is meaningful only if "
"innodb_flush_log_at_trx_commit is 1; now setting it "
"to 1.");
innobase_flush_log_at_trx_commit= 1;
}
if (innobase_unix_file_flush_method)
{
/*
This option has so many values that it's hard to know which value is
good (especially "littlesync", and on Windows... see
srv/srv0start.c).
*/
sql_print_error("Warning: --innodb-safe-binlog requires that "
"the innodb_flush_method actually synchronizes the "
"InnoDB log to disk; it is your responsibility "
"to verify that the method you chose does it.");
}
if (sync_binlog_period != 1)
{
sql_print_error("Warning: --innodb-safe-binlog is meaningful only if "
"the global sync_binlog variable is 1; now setting it "
"to 1.");
sync_binlog_period= 1;
}
}
if (ha_init())
{
sql_print_error("Can't init databases");
@ -2558,8 +2588,10 @@ server.");
crash recovery by InnoDB.
*/
if (opt_innodb_safe_binlog)
{
/* not fatal if fails (but print errors) */
mysql_bin_log.cut_spurious_tail();
}
mysql_bin_log.report_pos_in_innodb();
/* call ha_init_key_cache() on all key caches to init them */
@ -4612,7 +4644,7 @@ replicating a LOAD DATA INFILE command.",
*/
{"innodb_safe_binlog", OPT_INNODB_SAFE_BINLOG,
"After a crash recovery by InnoDB, truncate the binary log to the last \
InnoDB committed transaction. Use only if this server updates only InnoDB \
InnoDB committed transaction. Use only if this server updates ONLY InnoDB \
tables.",
(gptr*) &opt_innodb_safe_binlog, (gptr*) &opt_innodb_safe_binlog,
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},