~tsarev/percona-server/bug721176

« back to all changes in this revision

Viewing changes to patches/innodb_io_patches.patch

  • Committer: Stewart Smith
  • Date: 2011-08-16 02:52:57 UTC
  • mfrom: (148.1.5 5.5.15-porting)
  • Revision ID: stewart@flamingspork.com-20110816025257-0e7elba7i8tlrf50
merge 5.5.15 rebase

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#!!! notice !!!
6
6
# Any small change to this file in the main branch
7
7
# should be done or reviewed by the maintainer!
8
 
diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
9
 
--- a/storage/innobase/buf/buf0buf.c    2011-07-07 18:43:12.000000000 +0400
10
 
+++ b/storage/innobase/buf/buf0buf.c    2011-07-07 19:01:24.000000000 +0400
 
8
--- a/storage/innobase/buf/buf0buf.c
 
9
+++ b/storage/innobase/buf/buf0buf.c
11
10
@@ -320,6 +320,7 @@
12
11
 
13
12
        /* When we traverse all the flush lists we don't want another
24
23
        log_flush_order_mutex_exit();
25
24
 
26
25
        /* The returned answer may be out of date: the flush_list can
27
 
diff -ruN a/storage/innobase/buf/buf0flu.c b/storage/innobase/buf/buf0flu.c
28
 
--- a/storage/innobase/buf/buf0flu.c    2011-07-07 18:43:12.000000000 +0400
29
 
+++ b/storage/innobase/buf/buf0flu.c    2011-07-07 19:01:24.000000000 +0400
30
 
@@ -855,7 +855,7 @@
 
26
--- a/storage/innobase/buf/buf0flu.c
 
27
+++ b/storage/innobase/buf/buf0flu.c
 
28
@@ -857,7 +857,7 @@
31
29
 flush:
32
30
        /* Now flush the doublewrite buffer data to disk */
33
31
 
36
34
 
37
35
        /* We know that the writes have been flushed to disk now
38
36
        and in recovery we will find them in the doublewrite buffer
39
 
@@ -1376,7 +1376,7 @@
 
37
@@ -1378,7 +1378,7 @@
40
38
 
41
39
        ut_ad(flush_type == BUF_FLUSH_LRU || flush_type == BUF_FLUSH_LIST);
42
40
 
45
43
                /* If there is little space, it is better not to flush
46
44
                any block except from the end of the LRU list */
47
45
 
48
 
diff -ruN a/storage/innobase/buf/buf0rea.c b/storage/innobase/buf/buf0rea.c
49
 
--- a/storage/innobase/buf/buf0rea.c    2011-05-11 15:54:12.000000000 +0400
50
 
+++ b/storage/innobase/buf/buf0rea.c    2011-07-07 19:01:24.000000000 +0400
 
46
--- a/storage/innobase/buf/buf0rea.c
 
47
+++ b/storage/innobase/buf/buf0rea.c
51
48
@@ -260,6 +260,10 @@
52
49
                = BUF_READ_AHEAD_LINEAR_AREA(buf_pool);
53
50
        ulint           threshold;
59
56
        if (UNIV_UNLIKELY(srv_startup_is_before_trx_rollback_phase)) {
60
57
                /* No read-ahead to avoid thread deadlocks */
61
58
                return(0);
62
 
diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
63
 
--- a/storage/innobase/fil/fil0fil.c    2011-07-07 18:43:12.000000000 +0400
64
 
+++ b/storage/innobase/fil/fil0fil.c    2011-07-07 19:01:22.000000000 +0400
 
59
--- a/storage/innobase/fil/fil0fil.c
 
60
+++ b/storage/innobase/fil/fil0fil.c
65
61
@@ -2601,7 +2601,7 @@
66
62
 
67
63
                os_thread_sleep(20000);
136
132
        }
137
133
 
138
134
        mem_free(space_ids);
139
 
diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
140
 
--- a/storage/innobase/handler/ha_innodb.cc     2011-07-07 18:43:12.000000000 +0400
141
 
+++ b/storage/innobase/handler/ha_innodb.cc     2011-07-07 19:01:24.000000000 +0400
 
135
--- a/storage/innobase/handler/ha_innodb.cc
 
136
+++ b/storage/innobase/handler/ha_innodb.cc
142
137
@@ -445,6 +445,12 @@
143
138
   "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.",
144
139
   NULL, NULL, 50, 1, 1024 * 1024 * 1024, 0);
170
165
 /********************************************************************//**
171
166
 Obtain the InnoDB transaction of a MySQL thread.
172
167
 @return        reference to transaction pointer */
173
 
@@ -2443,6 +2460,9 @@
 
168
@@ -2442,6 +2459,9 @@
174
169
        srv_n_read_io_threads = (ulint) innobase_read_io_threads;
175
170
        srv_n_write_io_threads = (ulint) innobase_write_io_threads;
176
171
 
180
175
        srv_force_recovery = (ulint) innobase_force_recovery;
181
176
 
182
177
        srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
183
 
@@ -11037,7 +11057,7 @@
 
178
@@ -11036,7 +11056,7 @@
184
179
   PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
185
180
   "Purge threads can be either 0 or 1.",
186
181
   NULL, NULL,
189
184
   0,                   /* Minimum value */
190
185
   1, 0);               /* Maximum value */
191
186
 
192
 
@@ -11079,12 +11099,18 @@
 
187
@@ -11078,12 +11098,18 @@
193
188
   innodb_file_format_max_validate,
194
189
   innodb_file_format_max_update, "Antelope");
195
190
 
214
209
 
215
210
 static MYSQL_SYSVAR_STR(flush_method, innobase_file_flush_method,
216
211
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
217
 
@@ -11184,7 +11210,7 @@
 
212
@@ -11183,7 +11209,7 @@
218
213
 static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
219
214
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
220
215
   "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
223
218
 
224
219
 static MYSQL_SYSVAR_LONG(buffer_pool_instances, innobase_buffer_pool_instances,
225
220
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
226
 
@@ -11336,6 +11362,95 @@
 
221
@@ -11335,6 +11361,95 @@
227
222
   "trigger a readahead.",
228
223
   NULL, NULL, 56, 0, 64, 0);
229
224
 
319
314
 static struct st_mysql_sys_var* innobase_system_variables[]= {
320
315
   MYSQL_SYSVAR(additional_mem_pool_size),
321
316
   MYSQL_SYSVAR(autoextend_increment),
322
 
@@ -11356,6 +11471,7 @@
 
317
@@ -11355,6 +11470,7 @@
323
318
   MYSQL_SYSVAR(file_format_check),
324
319
   MYSQL_SYSVAR(file_format_max),
325
320
   MYSQL_SYSVAR(flush_log_at_trx_commit),
327
322
   MYSQL_SYSVAR(flush_method),
328
323
   MYSQL_SYSVAR(force_recovery),
329
324
   MYSQL_SYSVAR(large_prefix),
330
 
@@ -11394,6 +11510,13 @@
 
325
@@ -11393,6 +11509,13 @@
331
326
   MYSQL_SYSVAR(show_verbose_locks),
332
327
   MYSQL_SYSVAR(show_locks_held),
333
328
   MYSQL_SYSVAR(version),
341
336
   MYSQL_SYSVAR(use_sys_malloc),
342
337
   MYSQL_SYSVAR(use_native_aio),
343
338
   MYSQL_SYSVAR(change_buffering),
344
 
diff -ruN a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
345
 
--- a/storage/innobase/ibuf/ibuf0ibuf.c 2011-05-11 15:54:12.000000000 +0400
346
 
+++ b/storage/innobase/ibuf/ibuf0ibuf.c 2011-07-07 19:01:23.000000000 +0400
 
339
--- a/storage/innobase/ibuf/ibuf0ibuf.c
 
340
+++ b/storage/innobase/ibuf/ibuf0ibuf.c
347
341
@@ -514,8 +514,10 @@
348
342
        grow in size, as the references on the upper levels of the tree can
349
343
        change */
369
363
 
370
364
        sync = (size >= max_size + IBUF_CONTRACT_ON_INSERT_SYNC);
371
365
 
372
 
diff -ruN a/storage/innobase/include/buf0rea.h b/storage/innobase/include/buf0rea.h
373
 
--- a/storage/innobase/include/buf0rea.h        2011-05-11 15:54:12.000000000 +0400
374
 
+++ b/storage/innobase/include/buf0rea.h        2011-07-07 19:01:21.000000000 +0400
 
366
--- a/storage/innobase/include/buf0rea.h
 
367
+++ b/storage/innobase/include/buf0rea.h
375
368
@@ -124,8 +124,7 @@
376
369
 
377
370
 /** The size in pages of the area which the read-ahead algorithms read if
382
375
 
383
376
 /** @name Modes used in read-ahead @{ */
384
377
 /** read only pages belonging to the insert buffer tree */
385
 
diff -ruN a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
386
 
--- a/storage/innobase/include/fil0fil.h        2011-07-07 18:43:12.000000000 +0400
387
 
+++ b/storage/innobase/include/fil0fil.h        2011-07-07 19:01:21.000000000 +0400
 
378
--- a/storage/innobase/include/fil0fil.h
 
379
+++ b/storage/innobase/include/fil0fil.h
388
380
@@ -658,8 +658,9 @@
389
381
 void
390
382
 fil_flush(
396
388
 /**********************************************************************//**
397
389
 Flushes to disk writes in file spaces of the given type possibly cached by
398
390
 the OS. */
399
 
diff -ruN a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
400
 
--- a/storage/innobase/include/ha_prototypes.h  2011-05-11 15:54:12.000000000 +0400
401
 
+++ b/storage/innobase/include/ha_prototypes.h  2011-07-07 18:43:13.000000000 +0400
 
391
--- a/storage/innobase/include/ha_prototypes.h
 
392
+++ b/storage/innobase/include/ha_prototypes.h
402
393
@@ -284,6 +284,13 @@
403
394
 /*===================*/
404
395
         void*   thd,   /*!< in: thread handle (THD*) */
413
404
 
414
405
 /**********************************************************************//**
415
406
 Get the current setting of the lower_case_table_names global parameter from
416
 
diff -ruN a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
417
 
--- a/storage/innobase/include/os0file.h        2011-05-11 15:54:12.000000000 +0400
418
 
+++ b/storage/innobase/include/os0file.h        2011-07-07 19:01:21.000000000 +0400
 
407
--- a/storage/innobase/include/os0file.h
 
408
+++ b/storage/innobase/include/os0file.h
419
409
@@ -296,8 +296,8 @@
420
410
        pfs_os_file_write_func(name, file, buf, offset, offset_high,    \
421
411
                               n, __FILE__, __LINE__)
454
444
 /***********************************************************************//**
455
445
 Retrieves the last error number if an error occurs in a file io function.
456
446
 The number should be retrieved before any other OS calls (because they may
457
 
diff -ruN a/storage/innobase/include/os0file.ic b/storage/innobase/include/os0file.ic
458
 
--- a/storage/innobase/include/os0file.ic       2011-05-11 15:54:12.000000000 +0400
459
 
+++ b/storage/innobase/include/os0file.ic       2011-07-07 19:01:21.000000000 +0400
 
447
--- a/storage/innobase/include/os0file.ic
 
448
+++ b/storage/innobase/include/os0file.ic
460
449
@@ -369,6 +369,7 @@
461
450
 pfs_os_file_flush_func(
462
451
 /*===================*/
474
463
 
475
464
        register_pfs_file_io_end(locker, 0);
476
465
 
477
 
diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
478
 
--- a/storage/innobase/include/srv0srv.h        2011-07-07 18:43:12.000000000 +0400
479
 
+++ b/storage/innobase/include/srv0srv.h        2011-07-07 19:01:23.000000000 +0400
 
466
--- a/storage/innobase/include/srv0srv.h
 
467
+++ b/storage/innobase/include/srv0srv.h
480
468
@@ -138,7 +138,8 @@
481
469
 extern ulint   srv_n_log_files;
482
470
 extern ulint   srv_log_file_size;
515
503
 };
516
504
 
517
505
 /** Alternatives for file i/o in Windows */
518
 
diff -ruN a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c
519
 
--- a/storage/innobase/log/log0log.c    2011-05-11 15:54:12.000000000 +0400
520
 
+++ b/storage/innobase/log/log0log.c    2011-07-07 19:01:19.000000000 +0400
 
506
--- a/storage/innobase/log/log0log.c
 
507
+++ b/storage/innobase/log/log0log.c
521
508
@@ -48,6 +48,7 @@
522
509
 #include "srv0start.h"
523
510
 #include "trx0sys.h"
674
661
        current_time = time(NULL);
675
662
 
676
663
        time_elapsed = 0.001 + difftime(current_time,
677
 
diff -ruN a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
678
 
--- a/storage/innobase/log/log0recv.c   2011-05-11 15:54:12.000000000 +0400
679
 
+++ b/storage/innobase/log/log0recv.c   2011-07-07 19:01:22.000000000 +0400
 
664
--- a/storage/innobase/log/log0recv.c
 
665
+++ b/storage/innobase/log/log0recv.c
680
666
@@ -2906,9 +2906,12 @@
681
667
        ib_uint64_t     archived_lsn;
682
668
 #endif /* UNIV_LOG_ARCHIVE */
709
695
        os_file_close(log_file);
710
696
 
711
697
        ut_free(buf);
712
 
diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
713
 
--- a/storage/innobase/os/os0file.c     2011-05-11 15:54:12.000000000 +0400
714
 
+++ b/storage/innobase/os/os0file.c     2011-07-07 19:01:37.000000000 +0400
 
698
--- a/storage/innobase/os/os0file.c
 
699
+++ b/storage/innobase/os/os0file.c
715
700
@@ -1424,7 +1424,7 @@
716
701
 #endif
717
702
 #ifdef UNIV_NON_BUFFERED_IO
855
840
                        ut_error;
856
841
                }
857
842
 #endif /* UNIV_DO_FLUSH */
858
 
diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
859
 
--- a/storage/innobase/srv/srv0srv.c    2011-07-07 18:43:13.000000000 +0400
860
 
+++ b/storage/innobase/srv/srv0srv.c    2011-07-07 19:01:23.000000000 +0400
 
843
--- a/storage/innobase/srv/srv0srv.c
 
844
+++ b/storage/innobase/srv/srv0srv.c
861
845
@@ -183,7 +183,8 @@
862
846
 UNIV_INTERN ulint      srv_log_file_size       = ULINT_MAX;
863
847
 /* size in database pages */
1301
1285
        }
1302
1286
 
1303
1287
        mutex_enter(&kernel_mutex);
1304
 
diff -ruN a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
1305
 
--- a/storage/innobase/srv/srv0start.c  2011-05-11 15:54:12.000000000 +0400
1306
 
+++ b/storage/innobase/srv/srv0start.c  2011-07-07 19:01:21.000000000 +0400
 
1288
--- a/storage/innobase/srv/srv0start.c
 
1289
+++ b/storage/innobase/srv/srv0start.c
1307
1290
@@ -1217,6 +1217,9 @@
1308
1291
        } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT")) {
1309
1292
                srv_unix_file_flush_method = SRV_UNIX_O_DIRECT;
1314
1297
        } else if (0 == ut_strcmp(srv_file_flush_method_str, "littlesync")) {
1315
1298
                srv_unix_file_flush_method = SRV_UNIX_LITTLESYNC;
1316
1299
 
1317
 
diff -ruN a/storage/innobase/trx/trx0purge.c b/storage/innobase/trx/trx0purge.c
1318
 
--- a/storage/innobase/trx/trx0purge.c  2011-07-07 18:43:13.000000000 +0400
1319
 
+++ b/storage/innobase/trx/trx0purge.c  2011-07-07 19:01:19.000000000 +0400
 
1300
--- a/storage/innobase/trx/trx0purge.c
 
1301
+++ b/storage/innobase/trx/trx0purge.c
1320
1302
@@ -392,10 +392,10 @@
1321
1303
        trx_sys->rseg_history_len++;
1322
1304
        mutex_exit(&kernel_mutex);
1330
1312
 }
1331
1313
 
1332
1314
 /**********************************************************************//**
1333
 
diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
1334
 
--- a/storage/innobase/trx/trx0trx.c    2011-05-11 15:54:12.000000000 +0400
1335
 
+++ b/storage/innobase/trx/trx0trx.c    2011-07-07 19:01:24.000000000 +0400
 
1315
--- a/storage/innobase/trx/trx0trx.c
 
1316
+++ b/storage/innobase/trx/trx0trx.c
1336
1317
@@ -984,6 +984,7 @@
1337
1318
        trx->read_view = NULL;
1338
1319