#At file:///media/sda3/work/mysql/bzrwork/b31665/5.0/
2637 He Zhenxing 2008-10-15
Fixes to improve performance of patch for BUG#31665
modified:
sql/slave.cc
=== modified file 'sql/slave.cc'
--- a/sql/slave.cc 2008-09-22 12:33:39 +0000
+++ b/sql/slave.cc 2008-10-15 10:44:38 +0000
@@ -2604,10 +2604,10 @@ int flush_master_info(MASTER_INFO* mi, b
if (flush_io_cache(log_file))
DBUG_RETURN(2);
- /* Sync to disk if --sync-relay-log is set */
- if (sync_relaylog_period &&
- my_sync(log_file->file, MY_WME))
- DBUG_RETURN(2);
+// /* Sync to disk if --sync-relay-log is set */
+// if (sync_relaylog_period &&
+// my_sync(log_file->file, MY_WME))
+// DBUG_RETURN(2);
}
/*
@@ -2636,8 +2636,13 @@ int flush_master_info(MASTER_INFO* mi, b
(int)(mi->ssl), mi->ssl_ca, mi->ssl_capath, mi->ssl_cert,
mi->ssl_cipher, mi->ssl_key);
err= flush_io_cache(file);
- if (sync_relaylog_period && !err)
+ static unsigned int count=1;
+ if (sync_relaylog_period && !err && count > sync_relaylog_period)
+ {
err= my_sync(mi->fd, MYF(MY_WME));
+ count= 1;
+ }
+ count++;
DBUG_RETURN(-err);
}
@@ -4885,10 +4890,16 @@ bool flush_relay_log_info(RELAY_LOG_INFO
error=1;
if (flush_io_cache(file))
error=1;
+ static unsigned int count= 1;
if (sync_relaylog_period &&
!error &&
- my_sync(rli->info_fd, MYF(MY_WME)))
- error=1;
+ count > sync_relaylog_period)
+ {
+ if (my_sync(rli->info_fd, MYF(MY_WME)))
+ error=1;
+ count= 1;
+ }
+ count++;
/* Flushing the relay log is done by the slave I/O thread */
return error;
}
| Thread |
|---|
| • bzr commit into mysql-5.0 branch (hezx:2637) Bug#31665 | He Zhenxing | 15 Oct |