Merge lp:~linuxjedi/drizzle/trunk-bug-700099 into lp:drizzle/7.0

Proposed by Andrew Hutchings
Status: Merged
Approved by: Monty Taylor
Approved revision: 2065
Merged at revision: 2068
Proposed branch: lp:~linuxjedi/drizzle/trunk-bug-700099
Merge into: lp:drizzle/7.0
Diff against target: 202 lines (+80/-10)
7 files modified
drizzled/include.am (+1/-0)
m4/pandora_have_libaio.m4 (+56/-0)
plugin/innobase/docs/index.rst (+11/-0)
plugin/innobase/handler/ha_innodb.cc (+5/-5)
plugin/innobase/os/os0file.cc (+5/-5)
plugin/innobase/plugin.ac (+1/-0)
plugin/innobase/plugin.am (+1/-0)
To merge this branch: bzr merge lp:~linuxjedi/drizzle/trunk-bug-700099
Reviewer Review Type Date Requested Status
Monty Taylor Approve
Review via email: mp+45610@code.launchpad.net

Description of the change

1. InnoDB Linux native AIO support in pandora (also a section in docs)
2. Fix InnoDB trinary option which were breaking on uint16_t -> uint32_t casting
3. Set the default InnoDB autoextend-increment the same as MySQL 5.5

To post a comment you must log in.
Revision history for this message
Monty Taylor (mordred) wrote :

Thanks for the catch!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzled/include.am'
2--- drizzled/include.am 2011-01-06 16:43:31 +0000
3+++ drizzled/include.am 2011-01-08 16:04:52 +0000
4@@ -494,6 +494,7 @@
5 $(LTLIBPROTOBUF) \
6 $(LIBTBB) \
7 $(BOOST_LIBS) \
8+ $(LTLIBAIO) \
9 $(GCOV_LIBS)
10
11 drizzled_drizzled_DEPENDENCIES= \
12
13=== added file 'm4/pandora_have_libaio.m4'
14--- m4/pandora_have_libaio.m4 1970-01-01 00:00:00 +0000
15+++ m4/pandora_have_libaio.m4 2011-01-08 16:04:52 +0000
16@@ -0,0 +1,56 @@
17+dnl Copyright (C) 2011 Andrew Hutchings
18+dnl This file is free software; Sun Microsystems, Inc.
19+dnl gives unlimited permission to copy and/or distribute it,
20+dnl with or without modifications, as long as this notice is preserved.
21+
22+#--------------------------------------------------------------------
23+# Check for libaio
24+#--------------------------------------------------------------------
25+
26+
27+AC_DEFUN([_PANDORA_SEARCH_LIBAIO],[
28+ AC_REQUIRE([AC_LIB_PREFIX])
29+
30+ AC_CHECK_HEADERS(libaio.h)
31+ AC_LIB_HAVE_LINKFLAGS(aio,,
32+ [
33+ #include <libaio.h>
34+ ],
35+ [
36+ int aio_cmd= IO_CMD_PREAD;
37+ ])
38+
39+ AM_CONDITIONAL(HAVE_LIBAIO, [test "x${ac_cv_libaio}" = "xyes"])
40+
41+ AS_IF([test "x${ac_cv_libaio}" = "xyes"],[
42+ AC_DEFINE([LINUX_NATIVE_AIO], [1], [Enabel libaio support in InnoDB])
43+ ])
44+])
45+
46+AC_DEFUN([_PANDORA_HAVE_LIBAIO],[
47+
48+ AC_ARG_ENABLE([libaio],
49+ [AS_HELP_STRING([--disable-libaio],
50+ [Build with libaio support @<:@default=on@:>@])],
51+ [ac_enable_libaio="$enableval"],
52+ [ac_enable_libaio="yes"])
53+
54+ _PANDORA_SEARCH_LIBAIO
55+])
56+
57+
58+AC_DEFUN([PANDORA_HAVE_LIBAIO],[
59+ AC_REQUIRE([_PANDORA_HAVE_LIBAIO])
60+])
61+
62+AC_DEFUN([_PANDORA_REQUIRE_LIBAIO],[
63+ ac_enable_libaio="yes"
64+ _PANDORA_SEARCH_LIBAIO
65+ AS_IF([test "x$ac_cv_header_libaio_h" = "xno"],[
66+ AC_MSG_ERROR([Couldn't find libaio.h. On Debian this can be found in libaio-dev. On Redhat this can be found in libaio-devel.])
67+ ])
68+])
69+
70+AC_DEFUN([PANDORA_REQUIRE_LIBAIO],[
71+ AC_REQUIRE([_PANDORA_REQUIRE_LIBAIO])
72+])
73
74=== modified file 'plugin/innobase/docs/index.rst'
75--- plugin/innobase/docs/index.rst 2010-11-03 03:49:08 +0000
76+++ plugin/innobase/docs/index.rst 2011-01-08 16:04:52 +0000
77@@ -22,6 +22,17 @@
78 * AUTO_INCREMENT behaves the standard way (as in MyISAM)
79 * Supports four byte UTF-8 with the same index size
80
81+AIO support
82+-----------
83+
84+InnoDB supports Linux native AIO when compiled on platforms that have the
85+libaio development files installed (typically a package called libaio-dev or
86+libaio-devel). For more information on the advantages of this please see
87+http://blogs.innodb.com/wp/2010/04/innodb-performance-aio-linux/
88+
89+To confirm that Linux native AIO is enabled execute this command:
90+"show global variables like 'innodb_use_native_aio';"
91+
92 Compatibility with MySQL
93 ------------------------
94
95
96=== modified file 'plugin/innobase/handler/ha_innodb.cc'
97--- plugin/innobase/handler/ha_innodb.cc 2011-01-02 23:51:43 +0000
98+++ plugin/innobase/handler/ha_innodb.cc 2011-01-08 16:04:52 +0000
99@@ -202,7 +202,7 @@
100 static purge_batch_constraint innodb_purge_batch_size;
101 typedef constrained_check<uint32_t, 1, 0> purge_threads_constraint;
102 static purge_threads_constraint innodb_n_purge_threads;
103-typedef constrained_check<uint16_t, 2, 0> trinary_constraint;
104+typedef constrained_check<uint32_t, 2, 0> trinary_constraint;
105 static trinary_constraint innodb_flush_log_at_trx_commit;
106 typedef constrained_check<unsigned int, 99, 0> max_dirty_pages_constraint;
107 static max_dirty_pages_constraint innodb_max_dirty_pages_pct;
108@@ -251,7 +251,7 @@
109 /* Below we have boolean-valued start-up parameters, and their default
110 values */
111
112-typedef constrained_check<uint16_t, 2, 0> trinary_constraint;
113+typedef constrained_check<uint32_t, 2, 0> trinary_constraint;
114 static trinary_constraint innobase_fast_shutdown;
115
116 /* "innobase_file_format_check" decides whether we would continue
117@@ -2426,7 +2426,7 @@
118 context.registerVariable(new sys_var_constrained_value<uint32_t>("purge_threads",
119 innodb_n_purge_threads,
120 purge_threads_update));
121- context.registerVariable(new sys_var_constrained_value<uint16_t>("fast_shutdown", innobase_fast_shutdown));
122+ context.registerVariable(new sys_var_constrained_value<uint32_t>("fast_shutdown", innobase_fast_shutdown));
123 context.registerVariable(new sys_var_std_string("file_format",
124 innobase_file_format_name,
125 innodb_file_format_name_validate));
126@@ -2438,7 +2438,7 @@
127 innodb_file_format_max_validate));
128 context.registerVariable(new sys_var_constrained_value_readonly<size_t>("buffer_pool_size", innobase_buffer_pool_size));
129 context.registerVariable(new sys_var_constrained_value_readonly<int64_t>("log_file_size", innobase_log_file_size));
130- context.registerVariable(new sys_var_constrained_value_readonly<uint16_t>("flush_log_at_trx_commit",
131+ context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("flush_log_at_trx_commit",
132 innodb_flush_log_at_trx_commit));
133 context.registerVariable(new sys_var_constrained_value_readonly<unsigned int>("max_dirty_pages_pct",
134 innodb_max_dirty_pages_pct));
135@@ -9298,7 +9298,7 @@
136 po::value<additional_mem_pool_constraint>(&innobase_additional_mem_pool_size)->default_value(8*1024*1024L),
137 "Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.");
138 context("autoextend-increment",
139- po::value<autoextend_constraint>(&innodb_auto_extend_increment)->default_value(8L),
140+ po::value<autoextend_constraint>(&innodb_auto_extend_increment)->default_value(64L),
141 "Data file autoextend increment in megabytes");
142 context("buffer-pool-size",
143 po::value<buffer_pool_constraint>(&innobase_buffer_pool_size)->default_value(128*1024*1024L),
144
145=== modified file 'plugin/innobase/os/os0file.cc'
146--- plugin/innobase/os/os0file.cc 2010-12-27 18:39:11 +0000
147+++ plugin/innobase/os/os0file.cc 2011-01-08 16:04:52 +0000
148@@ -3215,7 +3215,7 @@
149 #ifdef WIN_ASYNC_IO
150 OVERLAPPED* over;
151 #elif defined(LINUX_NATIVE_AIO)
152- struct io_event* io_event = NULL;
153+ struct io_event* aio_event = NULL;
154 #endif
155 ut_a(n > 0);
156 ut_a(n_segments > 0);
157@@ -3250,7 +3250,7 @@
158 /* Initialize the io_context array. One io_context
159 per segment in the array. */
160
161- array->aio_ctx = ut_malloc(n_segments *
162+ array->aio_ctx = (io_context**) ut_malloc(n_segments *
163 sizeof(*array->aio_ctx));
164 for (i = 0; i < n_segments; ++i) {
165 if (!os_aio_linux_create_io_ctx(n/n_segments,
166@@ -3266,9 +3266,9 @@
167 }
168
169 /* Initialize the event array. One event per slot. */
170- io_event = ut_malloc(n * sizeof(*io_event));
171- memset(io_event, 0x0, sizeof(*io_event) * n);
172- array->aio_events = io_event;
173+ aio_event = (io_event*) ut_malloc(n * sizeof(io_event));
174+ memset(aio_event, 0x0, sizeof(io_event) * n);
175+ array->aio_events = aio_event;
176
177 skip_native_aio:
178 #endif /* LINUX_NATIVE_AIO */
179
180=== modified file 'plugin/innobase/plugin.ac'
181--- plugin/innobase/plugin.ac 2010-12-18 04:43:40 +0000
182+++ plugin/innobase/plugin.ac 2011-01-08 16:04:52 +0000
183@@ -16,6 +16,7 @@
184
185 AC_DEFUN([AC_INNODB_ACTIONS],[
186 PANDORA_REQUIRE_FLEX
187+ PANDORA_HAVE_LIBAIO
188
189 AC_REQUIRE([AC_FUNC_MMAP])
190
191
192=== modified file 'plugin/innobase/plugin.am'
193--- plugin/innobase/plugin.am 2010-12-27 18:39:11 +0000
194+++ plugin/innobase/plugin.am 2011-01-08 16:04:52 +0000
195@@ -226,6 +226,7 @@
196 endif
197
198 plugin_innobase_libinnobase_la_CXXFLAGS=${AM_CXXFLAGS} ${INNOBASE_SKIP_WARNINGS} -I${top_builddir}/plugin/innobase/include -I$(top_srcdir)/plugin/innobase/include -DBUILD_DRIZZLE
199+plugin_innobase_libinnobase_la_LDDADD= ${LTLIBAIO}
200 plugin_innobase_libinnobase_la_SOURCES= \
201 plugin/innobase/btr/btr0btr.cc \
202 plugin/innobase/btr/btr0cur.cc \

Subscribers

People subscribed via source and target branches