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

« back to all changes in this revision

Viewing changes to innodb_extend_slow.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:
117
117
        buf_pool_t*     buf_pool = buf_pool_get(space, offset);
118
118
 
119
119
        ut_ad(mtr);
120
 
@@ -2840,6 +2900,9 @@
121
 
 #ifndef UNIV_LOG_DEBUG
122
 
        ut_ad(!ibuf_inside() || ibuf_page(space, zip_size, offset, NULL));
 
120
@@ -2841,6 +2901,9 @@
 
121
        ut_ad(!ibuf_inside() || ibuf_page_low(space, zip_size, offset,
 
122
                                              FALSE, file, line, NULL));
123
123
 #endif
124
124
+       if (innobase_get_slow_log()) {
125
125
+               trx = innobase_get_trx();
127
127
        buf_pool->stat.n_page_gets++;
128
128
        fold = buf_page_address_fold(space, offset);
129
129
 loop:
130
 
@@ -2913,7 +2976,7 @@
 
130
@@ -2914,7 +2977,7 @@
131
131
                        return(NULL);
132
132
                }
133
133
 
136
136
                        retries = 0;
137
137
                } else if (retries < BUF_PAGE_READ_MAX_RETRIES) {
138
138
                        ++retries;
139
 
@@ -3216,6 +3279,13 @@
 
139
@@ -3217,6 +3280,13 @@
140
140
                        /* Let us wait until the read operation
141
141
                        completes */
142
142
 
150
150
                        for (;;) {
151
151
                                enum buf_io_fix io_fix;
152
152
 
153
 
@@ -3230,6 +3300,12 @@
 
153
@@ -3231,6 +3301,12 @@
154
154
                                        break;
155
155
                                }
156
156
                        }
163
163
                }
164
164
 
165
165
                fix_type = MTR_MEMO_BUF_FIX;
166
 
@@ -3255,13 +3331,17 @@
 
166
@@ -3256,13 +3332,17 @@
167
167
                /* In the case of a first access, try to apply linear
168
168
                read-ahead */
169
169
 
182
182
        return(block);
183
183
 }
184
184
 
185
 
@@ -3285,6 +3365,7 @@
 
185
@@ -3286,6 +3366,7 @@
186
186
        unsigned        access_time;
187
187
        ibool           success;
188
188
        ulint           fix_type;
190
190
 
191
191
        ut_ad(block);
192
192
        ut_ad(mtr);
193
 
@@ -3362,13 +3443,17 @@
 
193
@@ -3363,13 +3444,17 @@
194
194
 #ifdef UNIV_DEBUG_FILE_ACCESSES
195
195
        ut_a(block->page.file_page_was_freed == FALSE);
196
196
 #endif
209
209
        }
210
210
 
211
211
 #ifdef UNIV_IBUF_COUNT_DEBUG
212
 
@@ -3378,6 +3463,9 @@
 
212
@@ -3379,6 +3464,9 @@
213
213
        buf_pool = buf_pool_from_block(block);
214
214
        buf_pool->stat.n_page_gets++;
215
215
 
219
219
        return(TRUE);
220
220
 }
221
221
 
222
 
@@ -3400,6 +3488,7 @@
 
222
@@ -3401,6 +3489,7 @@
223
223
        buf_pool_t*     buf_pool;
224
224
        ibool           success;
225
225
        ulint           fix_type;
227
227
 
228
228
        ut_ad(mtr);
229
229
        ut_ad(mtr->state == MTR_ACTIVE);
230
 
@@ -3486,6 +3575,11 @@
 
230
@@ -3487,6 +3576,11 @@
231
231
 #endif
232
232
        buf_pool->stat.n_page_gets++;
233
233
 
338
338
diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
339
339
--- a/storage/innobase/fil/fil0fil.c    2010-12-03 15:53:54.610037199 +0900
340
340
+++ b/storage/innobase/fil/fil0fil.c    2010-12-03 17:42:42.079064198 +0900
341
 
@@ -4395,7 +4395,7 @@
 
341
@@ -4423,7 +4423,7 @@
342
342
                                 node->name, node->handle, buf,
343
343
                                 offset_low, offset_high,
344
344
                                 page_size * n_pages,
347
347
 #endif
348
348
                if (success) {
349
349
                        node->size += n_pages;
350
 
@@ -4722,7 +4722,7 @@
 
350
@@ -4750,7 +4750,7 @@
351
351
 i/o on a tablespace which does not exist */
352
352
 UNIV_INTERN
353
353
 ulint
356
356
 /*===*/
357
357
        ulint   type,           /*!< in: OS_FILE_READ or OS_FILE_WRITE,
358
358
                                ORed to OS_FILE_LOG, if a log i/o
359
 
@@ -4747,8 +4747,9 @@
 
359
@@ -4775,8 +4775,9 @@
360
360
        void*   buf,            /*!< in/out: buffer where to store read data
361
361
                                or from where to write; in aio this must be
362
362
                                appropriately aligned */
367
367
 {
368
368
        ulint           mode;
369
369
        fil_space_t*    space;
370
 
@@ -4918,7 +4919,7 @@
 
370
@@ -4946,7 +4947,7 @@
371
371
 #else
372
372
        /* Queue the aio request */
373
373
        ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,
379
379
diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
380
380
--- a/storage/innobase/handler/ha_innodb.cc     2010-12-03 17:36:44.293955189 +0900
381
381
+++ b/storage/innobase/handler/ha_innodb.cc     2010-12-03 17:42:42.090024586 +0900
382
 
@@ -1526,6 +1526,16 @@
 
382
@@ -1527,6 +1527,16 @@
383
383
        trx->check_unique_secondary = !thd_test_options(
384
384
                thd, OPTION_RELAXED_UNIQUE_CHECKS);
385
385
 
396
396
        DBUG_VOID_RETURN;
397
397
 }
398
398
 
399
 
@@ -1580,6 +1590,32 @@
 
399
@@ -1581,6 +1591,32 @@
400
400
        return(trx);
401
401
 }
402
402
 
429
429
 /*********************************************************************//**
430
430
 Note that a transaction has been registered with MySQL.
431
431
 @return true if transaction is registered with MySQL 2PC coordinator */
432
 
@@ -9205,6 +9241,25 @@
 
432
@@ -9207,6 +9243,25 @@
433
433
        statement has ended */
434
434
 
435
435
        if (trx->n_mysql_tables_in_use == 0) {
566
566
 
567
567
 # define os_file_read_no_error_handling(file, buf, offset,             \
568
568
                                       offset_high, n)                  \
569
 
@@ -690,6 +698,7 @@
 
569
@@ -692,6 +700,7 @@
570
570
        ulint           offset_high,/*!< in: most significant 32 bits of
571
571
                                offset */
572
572
        ulint           n,      /*!< in: number of bytes to read */
574
574
        const char*     src_file,/*!< in: file name where func invoked */
575
575
        ulint           src_line);/*!< in: line where the func invoked */
576
576
 
577
 
@@ -744,6 +753,7 @@
 
577
@@ -746,6 +755,7 @@
578
578
                                (can be used to identify a completed
579
579
                                aio operation); ignored if mode is
580
580
                                 OS_AIO_SYNC */
582
582
        const char*     src_file,/*!< in: file name where func invoked */
583
583
        ulint           src_line);/*!< in: line where the func invoked */
584
584
 /*******************************************************************//**
585
 
@@ -885,7 +895,8 @@
 
585
@@ -887,7 +897,8 @@
586
586
                                offset where to read */
587
587
        ulint           offset_high,/*!< in: most significant 32 bits of
588
588
                                offset */
592
592
 /*******************************************************************//**
593
593
 Rewind file to its start, read at most size - 1 bytes from it to str, and
594
594
 NUL-terminate str. All errors are silently ignored. This function is
595
 
@@ -1044,10 +1055,11 @@
 
595
@@ -1046,10 +1057,11 @@
596
596
                                (can be used to identify a completed
597
597
                                aio operation); ignored if mode is
598
598
                                OS_AIO_SYNC */
652
652
+/* prototypes for new functions added to ha_innodb.cc */
653
653
+ibool  innobase_get_slow_log();
654
654
+
655
 
 /* This is set to TRUE if the MySQL user has set it in MySQL */
656
 
 extern ibool   srv_lower_case_table_names;
 
655
 /* This is set to the MySQL server value for this variable. */
 
656
 extern uint    srv_lower_case_table_names;
657
657
 
658
658
diff -ruN a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
659
659
--- a/storage/innobase/include/trx0trx.h        2010-12-03 15:41:52.049372966 +0900
699
699
 
700
700
        ut_a(que_thr_stop(thr));
701
701
 
702
 
@@ -3692,6 +3698,8 @@
 
702
@@ -3764,6 +3770,8 @@
703
703
 {
704
704
        lock_t* lock;
705
705
        trx_t*  trx;
708
708
 
709
709
        ut_ad(mutex_own(&kernel_mutex));
710
710
 
711
 
@@ -3747,6 +3755,10 @@
 
711
@@ -3819,6 +3827,10 @@
712
712
                return(DB_SUCCESS);
713
713
        }
714
714
 
731
731
 #include "log0recv.h"
732
732
 #ifndef UNIV_HOTBACKUP
733
733
 # include "os0sync.h"
734
 
@@ -2177,13 +2179,18 @@
 
734
@@ -2202,13 +2204,18 @@
735
735
        ulint           n,      /*!< in: number of bytes to read */
736
736
        ulint           offset, /*!< in: least significant 32 bits of file
737
737
                                offset from where to read */
751
751
 
752
752
        ut_a((offset & 0xFFFFFFFFUL) == offset);
753
753
 
754
 
@@ -2204,6 +2211,15 @@
 
754
@@ -2229,6 +2236,15 @@
755
755
 
756
756
        os_n_file_reads++;
757
757
 
767
767
 #if defined(HAVE_PREAD) && !defined(HAVE_BROKEN_PREAD)
768
768
        os_mutex_enter(os_file_count_mutex);
769
769
        os_file_n_pending_preads++;
770
 
@@ -2217,6 +2233,13 @@
 
770
@@ -2242,6 +2258,13 @@
771
771
        os_n_pending_reads--;
772
772
        os_mutex_exit(os_file_count_mutex);
773
773
 
781
781
        return(n_bytes);
782
782
 #else
783
783
        {
784
 
@@ -2253,6 +2276,13 @@
 
784
@@ -2278,6 +2301,13 @@
785
785
                os_n_pending_reads--;
786
786
                os_mutex_exit(os_file_count_mutex);
787
787
 
795
795
                return(ret);
796
796
        }
797
797
 #endif
798
 
@@ -2393,7 +2423,8 @@
 
798
@@ -2418,7 +2448,8 @@
799
799
                                offset where to read */
800
800
        ulint           offset_high, /*!< in: most significant 32 bits of
801
801
                                offset */
805
805
 {
806
806
 #ifdef __WIN__
807
807
        BOOL            ret;
808
 
@@ -2468,7 +2499,7 @@
 
808
@@ -2493,7 +2524,7 @@
809
809
        os_bytes_read_since_printout += n;
810
810
 
811
811
 try_again:
814
814
 
815
815
        if ((ulint)ret == n) {
816
816
 
817
 
@@ -2597,7 +2628,7 @@
 
817
@@ -2622,7 +2653,7 @@
818
818
        os_bytes_read_since_printout += n;
819
819
 
820
820
 try_again:
823
823
 
824
824
        if ((ulint)ret == n) {
825
825
 
826
 
@@ -3991,10 +4022,11 @@
 
826
@@ -4016,10 +4047,11 @@
827
827
                                (can be used to identify a completed
828
828
                                aio operation); ignored if mode is
829
829
                                OS_AIO_SYNC */
836
836
 {
837
837
        os_aio_array_t* array;
838
838
        os_aio_slot_t*  slot;
839
 
@@ -4035,8 +4067,8 @@
 
839
@@ -4060,8 +4092,8 @@
840
840
                wait in the Windows case. */
841
841
 
842
842
                if (type == OS_FILE_READ) {
847
847
                }
848
848
 
849
849
                ut_a(type == OS_FILE_WRITE);
850
 
@@ -4074,6 +4106,11 @@
 
850
@@ -4099,6 +4131,11 @@
851
851
                ut_error;
852
852
        }
853
853
 
869
869
+/* prototypes for new functions added to ha_innodb.cc */
870
870
+ibool  innobase_get_slow_log();
871
871
+
872
 
 /* This is set to TRUE if the MySQL user has set it in MySQL; currently
873
 
 affects only FOREIGN KEY definition parsing */
874
 
 UNIV_INTERN ibool      srv_lower_case_table_names      = FALSE;
875
 
@@ -1219,6 +1222,10 @@
 
872
 /* This is set to the MySQL server value for this variable.  It is only
 
873
 needed for FOREIGN KEY definition parsing since FOREIGN KEY names are not
 
874
 stored in the server metadata. The server stores and enforces it for
 
875
@@ -1253,6 +1256,10 @@
876
876
        ibool                   has_slept = FALSE;
877
877
        srv_conc_slot_t*        slot      = NULL;
878
878
        ulint                   i;
883
883
 
884
884
        if (trx->mysql_thd != NULL
885
885
            && thd_is_replication_slave_thread(trx->mysql_thd)) {
886
 
@@ -1295,6 +1302,7 @@
 
886
@@ -1329,6 +1336,7 @@
887
887
                switches. */
888
888
                if (SRV_THREAD_SLEEP_DELAY > 0) {
889
889
                        os_thread_sleep(SRV_THREAD_SLEEP_DELAY);
891
891
                }
892
892
 
893
893
                trx->op_info = "";
894
 
@@ -1350,6 +1358,13 @@
 
894
@@ -1384,6 +1392,13 @@
895
895
        /* Go to wait for the event; when a thread leaves InnoDB it will
896
896
        release this thread */
897
897
 
905
905
        trx->op_info = "waiting in InnoDB queue";
906
906
 
907
907
        thd_wait_begin(trx->mysql_thd, THD_WAIT_ROW_TABLE_LOCK);
908
 
@@ -1358,6 +1373,12 @@
 
908
@@ -1392,6 +1407,12 @@
909
909
 
910
910
        trx->op_info = "";
911
911