From 73411a2ed52f2d4c7a7eca19c0f2b4795fae688b Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Thu, 10 Jun 2004 15:56:13 +0200 Subject: WL#1595 "Optionally fsync() the binlog after every statement": New option --sync-binlog=x (and global settable variable) which will fsync the binlog after every x-th disk write to it. That is, if in autocommit mode, after every x-th statement written to the binlog; if using transactions, after every x-th transaction written to the binlog. x==0 means no fsync. x==1 is the slowest. There is no test added for this, I have just checked that it works as --sync-binlog=1 dramatically slows down mysqld. Made sync-frm a global settable variable. --- sql/set_var.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sql/set_var.h') diff --git a/sql/set_var.h b/sql/set_var.h index 64bdfdb718b..9bed6f01dcc 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -462,7 +462,7 @@ public: }; -#ifndef EMBEDDED_LIBRARY +#ifdef HAVE_REPLICATION class sys_var_slave_skip_counter :public sys_var { public: @@ -475,6 +475,14 @@ public: type() or value_ptr() */ }; + +class sys_var_sync_binlog_period :public sys_var_long_ptr +{ +public: + sys_var_sync_binlog_period(const char *name_arg, ulong *value_ptr) + :sys_var_long_ptr(name_arg,value_ptr) {} + bool update(THD *thd, set_var *var); +}; #endif class sys_var_rand_seed1 :public sys_var -- cgit v1.2.1