List:Commits« Previous MessageNext Message »
From:Mayank Prasad Date:August 31 2012 12:54pm
Subject:bzr push into mysql-trunk branch (mayank.prasad:4343 to 4344) WL#6372
View as plain text  
 4344 Mayank Prasad	2012-08-31
      wl#6372 : Post-Iris changes to Server defaults.
            
       Details :
        - Addressed review comments from InnoDB Team.
        - Added new test cases.

    added:
      mysql-test/r/server_defaults.result
      mysql-test/r/server_defaults2.result
      mysql-test/t/server_defaults.test
      mysql-test/t/server_defaults2-master.opt
      mysql-test/t/server_defaults2.test
    modified:
      mysql-test/include/default_mysqld.cnf
      storage/innobase/srv/srv0start.cc
 4343 Mayank Prasad	2012-08-31
      wl#6372 : Post-Iris changes to Server defaults.
      
      Details : Probable fix for crash at Sparc-64.

    modified:
      mysys_ssl/my_getopt.cc
=== modified file 'mysql-test/include/default_mysqld.cnf'
--- a/mysql-test/include/default_mysqld.cnf	revid:mayank.prasad@stripped
+++ b/mysql-test/include/default_mysqld.cnf	revid:mayank.prasad@stripped
@@ -25,7 +25,7 @@ connect-timeout=            60
 
 log-bin-trust-function-creators=1
 key_buffer_size=            1M
-sort_buffer=                256K
+sort_buffer=                32K
 max_heap_table_size=        1M
 
 loose-innodb_data_file_path=      ibdata1:10M:autoextend

=== added file 'mysql-test/r/server_defaults.result'
--- a/mysql-test/r/server_defaults.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/server_defaults.result	revid:mayank.prasad@stripped
@@ -0,0 +1,18 @@
+SHOW VARIABLES LIKE "QUERY_CACHE_SIZE";
+Variable_name	Value
+query_cache_size	1048576
+SHOW VARIABLES LIKE "QUERY_CACHE_TYPE";
+Variable_name	Value
+query_cache_type	OFF
+SHOW VARIABLES LIKE "THREAD_CACHE_SIZE";
+Variable_name	Value
+thread_cache_size	9
+SHOW VARIABLES LIKE "HOST_CACHE_SIZE";
+Variable_name	Value
+host_cache_size	279
+SHOW VARIABLES LIKE "SORT_BUFFER_SIZE";
+Variable_name	Value
+sort_buffer_size	32768
+SHOW VARIABLES LIKE "INNODB_LOG_FILE_SIZE";
+Variable_name	Value
+innodb_log_file_size	50331648

=== added file 'mysql-test/r/server_defaults2.result'
--- a/mysql-test/r/server_defaults2.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/server_defaults2.result	revid:mayank.prasad@stripped
@@ -0,0 +1,6 @@
+SHOW VARIABLES LIKE "THREAD_CACHE_SIZE";
+Variable_name	Value
+thread_cache_size	13
+SHOW VARIABLES LIKE "HOST_CACHE_SIZE";
+Variable_name	Value
+host_cache_size	628

=== added file 'mysql-test/t/server_defaults.test'
--- a/mysql-test/t/server_defaults.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/server_defaults.test	revid:mayank.prasad@stripped
@@ -0,0 +1,26 @@
+#
+# default values changes for different server variables.
+#
+
+# query_cache_size 1M.
+SHOW VARIABLES LIKE "QUERY_CACHE_SIZE";
+
+# query_cache_type 0.
+SHOW VARIABLES LIKE "QUERY_CACHE_TYPE";
+
+# thread_cache_size dependent on max_connections.
+# 8 + ( max_connections / 100 ) capped at 100
+SHOW VARIABLES LIKE "THREAD_CACHE_SIZE";
+
+
+# host_cache_size dependent on max_connections.
+# 128 plus 1 for the first 500 of max_connections then add one for
+# every 20 extra. Cap at 2000.
+SHOW VARIABLES LIKE "HOST_CACHE_SIZE";
+
+# sort_buffer_size 32K.
+SHOW VARIABLES LIKE "SORT_BUFFER_SIZE";
+
+# innodb_log_file_size 48M.
+SHOW VARIABLES LIKE "INNODB_LOG_FILE_SIZE";
+

=== added file 'mysql-test/t/server_defaults2-master.opt'
--- a/mysql-test/t/server_defaults2-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/server_defaults2-master.opt	revid:mayank.prasad@stripped
@@ -0,0 +1 @@
+--max_connections=500

=== added file 'mysql-test/t/server_defaults2.test'
--- a/mysql-test/t/server_defaults2.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/server_defaults2.test	revid:mayank.prasad@stripped
@@ -0,0 +1,13 @@
+#
+# default values changes for different server variables.
+#
+
+# thread_cache_size dependent on max_connections.
+# 8 + ( max_connections / 100 ) capped at 100
+SHOW VARIABLES LIKE "THREAD_CACHE_SIZE";
+
+
+# host_cache_size dependent on max_connections.
+# 128 plus 1 for the first 500 of max_connections then add one for
+# every 20 extra. Cap at 2000.
+SHOW VARIABLES LIKE "HOST_CACHE_SIZE";

=== modified file 'storage/innobase/srv/srv0start.cc'
--- a/storage/innobase/srv/srv0start.cc	revid:mayank.prasad@stripped
+++ b/storage/innobase/srv/srv0start.cc	revid:mayank.prasad@stripped
@@ -583,39 +583,50 @@ srv_normalize_path_for_win(
 /*********************************************************************//**
 Creates or opens the log files and closes them.
 @return	DB_SUCCESS or error code */
-#define CREATE_NEW_LOG_FILE\
-        *log_file_created = TRUE;\
-\
-        ut_print_timestamp(stderr);\
-\
-        fprintf(stderr,\
-            " InnoDB: Log file %s did not exist:"\
-            " new to be created\n",\
-            name);\
-        if (log_file_has_been_opened) {\
-\
-            return(DB_ERROR);\
-        }\
-\
-        fprintf(stderr, "InnoDB: Setting log file %s size to %lu MB\n",\
-            name, (ulong) srv_log_file_size\
-            >> (20 - UNIV_PAGE_SIZE_SHIFT));\
-\
-        fprintf(stderr,\
-            "InnoDB: Database physically writes the file"\
-            " full: wait...\n");\
-\
-        ret = os_file_set_size(name, files[i],\
-                       (os_offset_t) srv_log_file_size\
-                       << UNIV_PAGE_SIZE_SHIFT);\
-        if (!ret) {\
-            fprintf(stderr,\
-                "InnoDB: Error in creating %s:"\
-                " probably out of disk space\n",\
-                name);\
-\
-            return(DB_ERROR);\
-		}
+static
+ibool create_new_log_file(
+	 char*   name,
+	 ulint   i,
+	 ibool*  log_file_created,
+	 ibool   log_file_has_been_opened)
+{
+	ibool		ret;
+
+	*log_file_created = TRUE;
+
+	ut_print_timestamp(stderr);
+
+	fprintf(stderr,
+		" InnoDB: Log file %s did not exist:"
+		" new to be created\n",
+		name);
+	if (log_file_has_been_opened) {
+
+		return(TRUE);
+	}
+
+	fprintf(stderr, "InnoDB: Setting log file %s size to %lu MB\n",
+		name, (ulong) srv_log_file_size
+		>> (20 - UNIV_PAGE_SIZE_SHIFT));
+
+	fprintf(stderr,
+		"InnoDB: Database physically writes the file"
+		" full: wait...\n");
+
+	ret = os_file_set_size(name, files[i],
+		       (os_offset_t) srv_log_file_size
+		       << UNIV_PAGE_SIZE_SHIFT);
+	if (!ret) {
+		fprintf(stderr,
+			"InnoDB: Error in creating %s:"
+			" probably out of disk space\n",
+			name);
+
+		return(TRUE);
+	}
+	/* Success  */
+	return(FALSE);
+}
 
 static __attribute__((nonnull, warn_unused_result))
 dberr_t
@@ -706,7 +717,11 @@ open_or_create_log_file(
 	               files[i] = os_file_create(innodb_file_log_key, name,
 		              	                 OS_FILE_CREATE, OS_FILE_NORMAL,
 			                         OS_LOG_FILE, &ret);
-                       CREATE_NEW_LOG_FILE;
+                       if(create_new_log_file(name, i, log_file_created,
+                                              log_file_has_been_opened))
+                       {
+                         return(DB_ERROR);
+                       }
                   }
                   else
                   {
@@ -723,7 +738,11 @@ open_or_create_log_file(
 		  }
                 }
 	} else {
-               CREATE_NEW_LOG_FILE;
+               if(create_new_log_file(name, i, log_file_created,
+                                      log_file_has_been_opened))
+               {
+                 return(DB_ERROR);
+               }
 	}
 
 	ret = os_file_close(files[i]);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (mayank.prasad:4343 to 4344) WL#6372Mayank Prasad1 Sep