~percona-dev/percona-server/windows-fixes

« back to all changes in this revision

Viewing changes to innodb_io_patches.patch

  • Committer: kinoyasu
  • Date: 2011-02-14 10:30:18 UTC
  • Revision ID: kinoyasu@gauntlet4-20110214103018-f14xhxs0lp9n3xlj
port Yasufumi patches to 5.5.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
diff -ruN a/storage/innobase/buf/buf0flu.c b/storage/innobase/buf/buf0flu.c
28
28
--- a/storage/innobase/buf/buf0flu.c    2010-11-03 07:01:13.000000000 +0900
29
29
+++ b/storage/innobase/buf/buf0flu.c    2010-12-03 15:10:08.934990091 +0900
30
 
@@ -1348,7 +1348,7 @@
 
30
@@ -1376,7 +1376,7 @@
31
31
 
32
32
        ut_ad(flush_type == BUF_FLUSH_LRU || flush_type == BUF_FLUSH_LIST);
33
33
 
53
53
diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
54
54
--- a/storage/innobase/handler/ha_innodb.cc     2010-12-03 15:09:51.283956391 +0900
55
55
+++ b/storage/innobase/handler/ha_innodb.cc     2010-12-03 15:10:08.963980444 +0900
56
 
@@ -425,6 +425,12 @@
 
56
@@ -426,6 +426,12 @@
57
57
   "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.",
58
58
   NULL, NULL, 50, 1, 1024 * 1024 * 1024, 0);
59
59
 
66
66
 
67
67
 static handler *innobase_create_handler(handlerton *hton,
68
68
                                         TABLE_SHARE *table,
69
 
@@ -819,6 +825,17 @@
 
69
@@ -820,6 +826,17 @@
70
70
        }
71
71
 }
72
72
 
84
84
 /********************************************************************//**
85
85
 Obtain the InnoDB transaction of a MySQL thread.
86
86
 @return        reference to transaction pointer */
87
 
@@ -2390,6 +2407,9 @@
 
87
@@ -2391,6 +2408,9 @@
88
88
        srv_n_read_io_threads = (ulint) innobase_read_io_threads;
89
89
        srv_n_write_io_threads = (ulint) innobase_write_io_threads;
90
90
 
94
94
        srv_force_recovery = (ulint) innobase_force_recovery;
95
95
 
96
96
        srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
97
 
@@ -10107,6 +10127,10 @@
 
97
@@ -10109,6 +10129,10 @@
98
98
            && (all
99
99
                || !thd_test_options(
100
100
                        thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) {
105
105
 
106
106
                /* For ibbackup to work the order of transactions in binlog
107
107
                and InnoDB must be the same. Consider the situation
108
 
@@ -10917,9 +10941,9 @@
 
108
@@ -10919,9 +10943,9 @@
109
109
 
110
110
 static MYSQL_SYSVAR_ULONG(purge_threads, srv_n_purge_threads,
111
111
   PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
117
117
   0,                   /* Minimum value */
118
118
   1, 0);               /* Maximum value */
119
119
 
120
 
@@ -10961,12 +10985,18 @@
 
120
@@ -10963,12 +10987,18 @@
121
121
   innodb_file_format_max_validate,
122
122
   innodb_file_format_max_update, "Antelope");
123
123
 
142
142
 
143
143
 static MYSQL_SYSVAR_STR(flush_method, innobase_file_flush_method,
144
144
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
145
 
@@ -11061,7 +11091,7 @@
 
145
@@ -11063,7 +11093,7 @@
146
146
 static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
147
147
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
148
148
   "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
151
151
 
152
152
 static MYSQL_SYSVAR_LONG(buffer_pool_instances, innobase_buffer_pool_instances,
153
153
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
154
 
@@ -11206,6 +11236,100 @@
 
154
@@ -11208,6 +11238,100 @@
155
155
   "trigger a readahead.",
156
156
   NULL, NULL, 56, 0, 64, 0);
157
157
 
252
252
 static struct st_mysql_sys_var* innobase_system_variables[]= {
253
253
   MYSQL_SYSVAR(additional_mem_pool_size),
254
254
   MYSQL_SYSVAR(autoextend_increment),
255
 
@@ -11226,6 +11350,7 @@
 
255
@@ -11228,6 +11352,7 @@
256
256
   MYSQL_SYSVAR(file_format_check),
257
257
   MYSQL_SYSVAR(file_format_max),
258
258
   MYSQL_SYSVAR(flush_log_at_trx_commit),
260
260
   MYSQL_SYSVAR(flush_method),
261
261
   MYSQL_SYSVAR(force_recovery),
262
262
   MYSQL_SYSVAR(locks_unsafe_for_binlog),
263
 
@@ -11262,6 +11387,14 @@
 
263
@@ -11264,6 +11389,14 @@
264
264
   MYSQL_SYSVAR(show_verbose_locks),
265
265
   MYSQL_SYSVAR(show_locks_held),
266
266
   MYSQL_SYSVAR(version),
291
291
 
292
292
        mutex_create(ibuf_pessimistic_insert_mutex_key,
293
293
                     &ibuf_pessimistic_insert_mutex,
294
 
@@ -2651,9 +2653,11 @@
 
294
@@ -2729,9 +2731,11 @@
295
295
        size = ibuf->size;
296
296
        max_size = ibuf->max_size;
297
297
 
527
527
diff -ruN a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
528
528
--- a/storage/innobase/os/os0file.c     2010-11-03 07:01:13.000000000 +0900
529
529
+++ b/storage/innobase/os/os0file.c     2010-12-03 15:10:09.093023540 +0900
530
 
@@ -1399,7 +1399,7 @@
 
530
@@ -1424,7 +1424,7 @@
531
531
 #endif
532
532
 #ifdef UNIV_NON_BUFFERED_IO
533
533
 # ifndef UNIV_HOTBACKUP
536
536
                        /* Do not use unbuffered i/o to log files because
537
537
                        value 2 denotes that we do not flush the log at every
538
538
                        commit, but only once per second */
539
 
@@ -1415,7 +1415,7 @@
 
539
@@ -1440,7 +1440,7 @@
540
540
                attributes = 0;
541
541
 #ifdef UNIV_NON_BUFFERED_IO
542
542
 # ifndef UNIV_HOTBACKUP
545
545
                        /* Do not use unbuffered i/o to log files because
546
546
                        value 2 denotes that we do not flush the log at every
547
547
                        commit, but only once per second */
548
 
@@ -1560,6 +1560,11 @@
 
548
@@ -1585,6 +1585,11 @@
549
549
                os_file_set_nocache(file, name, mode_str);
550
550
        }
551
551
 
560
560
diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
561
561
--- a/storage/innobase/srv/srv0srv.c    2010-12-03 15:09:51.301987792 +0900
562
562
+++ b/storage/innobase/srv/srv0srv.c    2010-12-03 15:13:29.369986988 +0900
563
 
@@ -188,7 +188,8 @@
 
563
@@ -190,7 +190,8 @@
564
564
 UNIV_INTERN ulint      srv_log_file_size       = ULINT_MAX;
565
565
 /* size in database pages */
566
566
 UNIV_INTERN ulint      srv_log_buffer_size     = ULINT_MAX;
570
570
 
571
571
 /* Try to flush dirty pages so as to avoid IO bursts at
572
572
 the checkpoints. */
573
 
@@ -399,6 +400,17 @@
 
573
@@ -401,6 +402,17 @@
574
574
 
575
575
 UNIV_INTERN ulong      srv_replication_delay           = 0;
576
576
 
588
588
 /*-------------------------------------------*/
589
589
 UNIV_INTERN ulong      srv_n_spin_wait_rounds  = 30;
590
590
 UNIV_INTERN ulong      srv_n_free_tickets_to_enter = 500;
591
 
@@ -2703,6 +2715,7 @@
 
591
@@ -2737,6 +2749,7 @@
592
592
        ulint           n_pages_purged  = 0;
593
593
        ulint           n_bytes_merged;
594
594
        ulint           n_pages_flushed;
596
596
        ulint           n_bytes_archived;
597
597
        ulint           n_tables_to_drop;
598
598
        ulint           n_ios;
599
 
@@ -2710,7 +2723,20 @@
 
599
@@ -2744,7 +2757,20 @@
600
600
        ulint           n_ios_very_old;
601
601
        ulint           n_pend_ios;
602
602
        ulint           next_itr_time;
617
617
 
618
618
 #ifdef UNIV_DEBUG_THREAD_CREATION
619
619
        fprintf(stderr, "Master thread starts, id %lu\n",
620
 
@@ -2732,6 +2758,9 @@
 
620
@@ -2766,6 +2792,9 @@
621
621
 
622
622
        mutex_exit(&kernel_mutex);
623
623
 
627
627
 loop:
628
628
        /*****************************************************************/
629
629
        /* ---- When there is database activity by users, we cycle in this
630
 
@@ -2762,9 +2791,13 @@
 
630
@@ -2796,9 +2825,13 @@
631
631
        /* Sleep for 1 second on entrying the for loop below the first time. */
632
632
        next_itr_time = ut_time_ms() + 1000;
633
633
 
641
641
                /* ALTER TABLE in MySQL requires on Unix that the table handler
642
642
                can drop tables lazily after there no longer are SELECT
643
643
                queries to them. */
644
 
@@ -2788,6 +2821,7 @@
 
644
@@ -2822,6 +2855,7 @@
645
645
                srv_main_thread_op_info = "sleeping";
646
646
                srv_main_1_second_loops++;
647
647
 
649
649
                if (next_itr_time > cur_time
650
650
                    && srv_shutdown_state == SRV_SHUTDOWN_NONE) {
651
651
 
652
 
@@ -2798,10 +2832,26 @@
 
652
@@ -2832,10 +2866,26 @@
653
653
                                        (next_itr_time - cur_time)
654
654
                                         * 1000));
655
655
                        srv_main_sleeps++;
676
676
 
677
677
                /* Flush logs if needed */
678
678
                srv_sync_log_buffer_in_background();
679
 
@@ -2821,7 +2871,7 @@
 
679
@@ -2855,7 +2905,7 @@
680
680
                if (n_pend_ios < SRV_PEND_IO_THRESHOLD
681
681
                    && (n_ios - n_ios_old < SRV_RECENT_IO_ACTIVITY)) {
682
682
                        srv_main_thread_op_info = "doing insert buffer merge";
685
685
 
686
686
                        /* Flush logs if needed */
687
687
                        srv_sync_log_buffer_in_background();
688
 
@@ -2838,7 +2888,11 @@
 
688
@@ -2872,7 +2922,11 @@
689
689
                        n_pages_flushed = buf_flush_list(
690
690
                                PCT_IO(100), IB_ULONGLONG_MAX);
691
691
 
698
698
 
699
699
                        /* Try to keep the rate of flushing of dirty
700
700
                        pages such that redo log generation does not
701
 
@@ -2854,6 +2908,224 @@
 
701
@@ -2888,6 +2942,224 @@
702
702
                                                n_flush,
703
703
                                                IB_ULONGLONG_MAX);
704
704
                        }
923
923
                }
924
924
 
925
925
                if (srv_activity_count == old_activity_count) {
926
 
@@ -2902,7 +3174,7 @@
 
926
@@ -2936,7 +3208,7 @@
927
927
        even if the server were active */
928
928
 
929
929
        srv_main_thread_op_info = "doing insert buffer merge";
932
932
 
933
933
        /* Flush logs if needed */
934
934
        srv_sync_log_buffer_in_background();
935
 
@@ -3010,7 +3282,7 @@
 
935
@@ -3044,7 +3316,7 @@
936
936
                buf_flush_list below. Otherwise, the system favors
937
937
                clean pages over cleanup throughput. */
938
938
                n_bytes_merged = ibuf_contract_for_n_pages(FALSE,
941
941
        }
942
942
 
943
943
        srv_main_thread_op_info = "reserving kernel mutex";
944
 
@@ -3156,6 +3428,7 @@
 
944
@@ -3190,6 +3462,7 @@
945
945
        srv_slot_t*     slot;
946
946
        ulint           slot_no = ULINT_UNDEFINED;
947
947
        ulint           n_total_purged = ULINT_UNDEFINED;
949
949
 
950
950
        ut_a(srv_n_purge_threads == 1);
951
951
 
952
 
@@ -3178,9 +3451,12 @@
 
952
@@ -3212,9 +3485,12 @@
953
953
 
954
954
        mutex_exit(&kernel_mutex);
955
955
 
962
962
 
963
963
                /* If there are very few records to purge or the last
964
964
                purge didn't purge any records then wait for activity.
965
 
@@ -3221,6 +3497,16 @@
 
965
@@ -3255,6 +3531,16 @@
966
966
                } while (n_pages_purged > 0 && !srv_fast_shutdown);
967
967
 
968
968
                srv_sync_log_buffer_in_background();
982
982
diff -ruN a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
983
983
--- a/storage/innobase/srv/srv0start.c  2010-11-03 07:01:13.000000000 +0900
984
984
+++ b/storage/innobase/srv/srv0start.c  2010-12-03 15:10:09.103023543 +0900
985
 
@@ -1184,6 +1184,9 @@
 
985
@@ -1212,6 +1212,9 @@
986
986
        } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT")) {
987
987
                srv_unix_file_flush_method = SRV_UNIX_O_DIRECT;
988
988