MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Marko Mäkelä Date:July 26 2005 11:03am
Subject:bk commit into 4.1 tree (marko:1.2348) BUG#12125
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of marko. When marko does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2348 05/07/26 14:03:34 marko@stripped +3 -0
  InnoDB: Do not flush after each write, not even when creating the
  data files.  Previously, writes were flushed until the doublewrite
  buffer was created.  That would be too slow on systems where
  os_file_flush() [or fsync(2)] is slow.  (Bug #12125)

  innobase/trx/trx0sys.c
    1.32 05/07/26 14:03:26 marko@stripped +2 -1
    Disable os_do_not_call_flush_at_each_write unless #ifdef UNIV_DO_FLUSH

  innobase/os/os0file.c
    1.103 05/07/26 14:03:26 marko@stripped +14 -0
    Disable os_do_not_call_flush_at_each_write unless #ifdef UNIV_DO_FLUSH

  innobase/include/os0file.h
    1.35 05/07/26 14:03:26 marko@stripped +2 -0
    Disable os_do_not_call_flush_at_each_write unless #ifdef UNIV_DO_FLUSH

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	marko
# Host:	hundin.mysql.fi
# Root:	/home/marko/mysql-4.1

--- 1.34/innobase/include/os0file.h	2005-06-27 17:04:51 +03:00
+++ 1.35/innobase/include/os0file.h	2005-07-26 14:03:26 +03:00
@@ -17,7 +17,9 @@
 #include <time.h>
 #endif
 
+#ifdef UNIV_DO_FLUSH
 extern ibool	os_do_not_call_flush_at_each_write;
+#endif /* UNIV_DO_FLUSH */
 extern ibool	os_has_said_disk_full;
 extern ibool	os_aio_print_debug;
 

--- 1.102/innobase/os/os0file.c	2005-06-27 17:25:30 +03:00
+++ 1.103/innobase/os/os0file.c	2005-07-26 14:03:26 +03:00
@@ -33,9 +33,13 @@
 ulint	os_innodb_umask		= 0;
 #endif
 
+#ifdef UNIV_DO_FLUSH
 /* If the following is set to TRUE, we do not call os_file_flush in every
 os_file_write. We can set this TRUE when the doublewrite buffer is used. */
 ibool	os_do_not_call_flush_at_each_write	= FALSE;
+#else
+/* We do not call os_file_flush in every os_file_write. */
+#endif /* UNIV_DO_FLUSH */
 
 /* We use these mutexes to protect lseek + file i/o operation, if the
 OS does not provide an atomic pread or pwrite, or similar */
@@ -1974,6 +1978,7 @@
 	os_file_n_pending_pwrites--;
         os_mutex_exit(os_file_count_mutex);
 
+# ifdef UNIV_DO_FLUSH
 	if (srv_unix_file_flush_method != SRV_UNIX_LITTLESYNC
 	    && srv_unix_file_flush_method != SRV_UNIX_NOSYNC
 	    && !os_do_not_call_flush_at_each_write) {
@@ -1984,6 +1989,7 @@
 
 	        ut_a(TRUE == os_file_flush(file));
 	}
+# endif /* UNIV_DO_FLUSH */
 
         return(ret);
 #else
@@ -2006,6 +2012,7 @@
 	
 	ret = write(file, buf, (ssize_t)n);
 
+# ifdef UNIV_DO_FLUSH
 	if (srv_unix_file_flush_method != SRV_UNIX_LITTLESYNC
 	    && srv_unix_file_flush_method != SRV_UNIX_NOSYNC
 	    && !os_do_not_call_flush_at_each_write) {
@@ -2016,6 +2023,7 @@
 
 	        ut_a(TRUE == os_file_flush(file));
 	}
+# endif /* UNIV_DO_FLUSH */
 
 	os_mutex_exit(os_file_seek_mutexes[i]);
 
@@ -2282,9 +2290,11 @@
 	/* Always do fsync to reduce the probability that when the OS crashes,
 	a database page is only partially physically written to disk. */
 
+# ifdef UNIV_DO_FLUSH
 	if (!os_do_not_call_flush_at_each_write) {
 		ut_a(TRUE == os_file_flush(file));
 	}
+# endif /* UNIV_DO_FLUSH */
 
 	os_mutex_exit(os_file_seek_mutexes[i]);
 
@@ -3498,10 +3508,12 @@
 	if (ret && len == slot->len) {
 		ret_val = TRUE;
 
+# ifdef UNIV_DO_FLUSH
 		if (slot->type == OS_FILE_WRITE
 				&& !os_do_not_call_flush_at_each_write) {
 		         ut_a(TRUE == os_file_flush(slot->file));
 		}
+# endif /* UNIV_DO_FLUSH */
 	} else {
 		os_file_handle_error(slot->name, "Windows aio");
 		
@@ -3582,10 +3594,12 @@
 	*message1 = slot->message1;
 	*message2 = slot->message2;
 
+# ifdef UNIV_DO_FLUSH
 	if (slot->type == OS_FILE_WRITE
 				&& !os_do_not_call_flush_at_each_write) {
 		ut_a(TRUE == os_file_flush(slot->file));
 	}
+# endif /* UNIV_DO_FLUSH */
 
 	os_mutex_exit(array->mutex);
 

--- 1.31/innobase/trx/trx0sys.c	2005-03-07 12:03:27 +02:00
+++ 1.32/innobase/trx/trx0sys.c	2005-07-26 14:03:26 +03:00
@@ -97,8 +97,9 @@
 
 	/* Since we now start to use the doublewrite buffer, no need to call
 	fsync() after every write to a data file */
-
+#ifdef UNIV_DO_FLUSH
 	os_do_not_call_flush_at_each_write = TRUE;
+#endif /* UNIV_DO_FLUSH */
 
 	mutex_create(&(trx_doublewrite->mutex));
 	mutex_set_level(&(trx_doublewrite->mutex), SYNC_DOUBLEWRITE);
Thread
bk commit into 4.1 tree (marko:1.2348) BUG#12125Marko Mäkelä26 Jul