~percona-dev/percona-server/release-5.5.16-21.1

« back to all changes in this revision

Viewing changes to patches/innodb_extend_slow.patch

  • Committer: Stewart Smith
  • Date: 2011-10-11 23:14:21 UTC
  • mfrom: (187.1.2 5.5.16)
  • Revision ID: stewart@flamingspork.com-20111011231421-2yl28jhosws16l1x
merge 5.5.16 port

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
 /*
50
50
                IMPLEMENTATION OF THE BUFFER POOL
51
 
@@ -1930,8 +1964,16 @@
 
51
@@ -1931,8 +1965,16 @@
52
52
        mutex_t*        block_mutex;
53
53
        ibool           must_read;
54
54
        unsigned        access_time;
65
65
        buf_pool->stat.n_page_gets++;
66
66
 
67
67
        for (;;) {
68
 
@@ -1949,7 +1991,7 @@
 
68
@@ -1950,7 +1992,7 @@
69
69
                //buf_pool_mutex_exit(buf_pool);
70
70
                rw_lock_s_unlock(&buf_pool->page_hash_latch);
71
71
 
74
74
 
75
75
 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
76
76
                ut_a(++buf_dbg_counter % 37 || buf_validate());
77
 
@@ -2045,6 +2087,13 @@
 
77
@@ -2046,6 +2088,13 @@
78
78
                /* Let us wait until the read operation
79
79
                completes */
80
80
 
88
88
                for (;;) {
89
89
                        enum buf_io_fix io_fix;
90
90
 
91
 
@@ -2059,6 +2108,12 @@
 
91
@@ -2060,6 +2109,12 @@
92
92
                                break;
93
93
                        }
94
94
                }
101
101
        }
102
102
 
103
103
 #ifdef UNIV_IBUF_COUNT_DEBUG
104
 
@@ -2374,6 +2429,11 @@
 
104
@@ -2375,6 +2430,11 @@
105
105
        ibool           must_read;
106
106
        ulint           retries = 0;
107
107
        mutex_t*        block_mutex = NULL;
113
113
        buf_pool_t*     buf_pool = buf_pool_get(space, offset);
114
114
 
115
115
        ut_ad(mtr);
116
 
@@ -2403,6 +2463,9 @@
 
116
@@ -2404,6 +2464,9 @@
117
117
              || ibuf_page_low(space, zip_size, offset,
118
118
                               FALSE, file, line, NULL));
119
119
 #endif
123
123
        buf_pool->stat.n_page_gets++;
124
124
        fold = buf_page_address_fold(space, offset);
125
125
 loop:
126
 
@@ -2473,7 +2536,7 @@
 
126
@@ -2474,9 +2537,9 @@
127
127
                        return(NULL);
128
128
                }
129
129
 
130
130
-               if (buf_read_page(space, zip_size, offset)) {
131
131
+               if (buf_read_page(space, zip_size, offset, trx)) {
 
132
                        buf_read_ahead_random(space, zip_size, offset,
 
133
-                                             ibuf_inside(mtr));
 
134
+                                             ibuf_inside(mtr), trx);
 
135
 
132
136
                        retries = 0;
133
137
                } else if (retries < BUF_PAGE_READ_MAX_RETRIES) {
134
 
                        ++retries;
135
 
@@ -2782,6 +2845,13 @@
 
138
@@ -2786,6 +2849,13 @@
136
139
                        /* Let us wait until the read operation
137
140
                        completes */
138
141
 
146
149
                        for (;;) {
147
150
                                enum buf_io_fix io_fix;
148
151
 
149
 
@@ -2796,6 +2866,12 @@
 
152
@@ -2800,6 +2870,12 @@
150
153
                                        break;
151
154
                                }
152
155
                        }
159
162
                }
160
163
 
161
164
                fix_type = MTR_MEMO_BUF_FIX;
162
 
@@ -2822,13 +2898,17 @@
 
165
@@ -2826,13 +2902,17 @@
163
166
                read-ahead */
164
167
 
165
168
                buf_read_ahead_linear(space, zip_size, offset,
178
181
        return(block);
179
182
 }
180
183
 
181
 
@@ -2852,6 +2932,7 @@
 
184
@@ -2856,6 +2936,7 @@
182
185
        unsigned        access_time;
183
186
        ibool           success;
184
187
        ulint           fix_type;
186
189
 
187
190
        ut_ad(block);
188
191
        ut_ad(mtr);
189
 
@@ -2929,6 +3010,10 @@
 
192
@@ -2933,6 +3014,10 @@
190
193
 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
191
194
        ut_a(block->page.file_page_was_freed == FALSE);
192
195
 #endif
197
200
        if (UNIV_UNLIKELY(!access_time)) {
198
201
                /* In the case of a first access, try to apply linear
199
202
                read-ahead */
200
 
@@ -2936,7 +3021,7 @@
 
203
@@ -2940,7 +3025,7 @@
201
204
                buf_read_ahead_linear(buf_block_get_space(block),
202
205
                                      buf_block_get_zip_size(block),
203
206
                                      buf_block_get_page_no(block),
206
209
        }
207
210
 
208
211
 #ifdef UNIV_IBUF_COUNT_DEBUG
209
 
@@ -2946,6 +3031,9 @@
 
212
@@ -2950,6 +3035,9 @@
210
213
        buf_pool = buf_pool_from_block(block);
211
214
        buf_pool->stat.n_page_gets++;
212
215
 
216
219
        return(TRUE);
217
220
 }
218
221
 
219
 
@@ -2968,6 +3056,7 @@
 
222
@@ -2972,6 +3060,7 @@
220
223
        buf_pool_t*     buf_pool;
221
224
        ibool           success;
222
225
        ulint           fix_type;
224
227
 
225
228
        ut_ad(mtr);
226
229
        ut_ad(mtr->state == MTR_ACTIVE);
227
 
@@ -3054,6 +3143,11 @@
 
230
@@ -3058,6 +3147,11 @@
228
231
 #endif
229
232
        buf_pool->stat.n_page_gets++;
230
233
 
238
241
 
239
242
--- a/storage/innobase/buf/buf0rea.c
240
243
+++ b/storage/innobase/buf/buf0rea.c
241
 
@@ -77,7 +77,8 @@
 
244
@@ -79,7 +79,8 @@
242
245
                        treat the tablespace as dropped; this is a timestamp we
243
246
                        use to stop dangling page reads from a tablespace
244
247
                        which we have DISCARDed + IMPORTed back */
248
251
 {
249
252
        buf_page_t*     bpage;
250
253
        ulint           wake_later;
251
 
@@ -179,15 +180,15 @@
 
254
@@ -181,15 +182,15 @@
252
255
 
253
256
        thd_wait_begin(NULL, THD_WAIT_DISKIO);
254
257
        if (zip_size) {
268
271
        }
269
272
        thd_wait_end(NULL);
270
273
        ut_a(*err == DB_SUCCESS);
271
 
@@ -213,7 +214,8 @@
 
274
@@ -226,8 +227,9 @@
 
275
                                or 0 */
 
276
        ulint   offset,         /*!< in: page number of a page which
 
277
                                the current thread wants to access */
 
278
-       ibool   inside_ibuf)    /*!< in: TRUE if we are inside ibuf
 
279
+       ibool   inside_ibuf,    /*!< in: TRUE if we are inside ibuf
 
280
                                routine */
 
281
+       trx_t*  trx)
 
282
 {
 
283
        buf_pool_t*     buf_pool = buf_pool_get(space, offset);
 
284
        ib_int64_t      tablespace_version;
 
285
@@ -330,7 +332,7 @@
 
286
                                &err, FALSE,
 
287
                                ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER,
 
288
                                space, zip_size, FALSE,
 
289
-                               tablespace_version, i);
 
290
+                               tablespace_version, i, trx);
 
291
                        if (err == DB_TABLESPACE_DELETED) {
 
292
                                ut_print_timestamp(stderr);
 
293
                                fprintf(stderr,
 
294
@@ -380,7 +382,8 @@
272
295
 /*==========*/
273
296
        ulint   space,  /*!< in: space id */
274
297
        ulint   zip_size,/*!< in: compressed page size in bytes, or 0 */
278
301
 {
279
302
        buf_pool_t*     buf_pool = buf_pool_get(space, offset);
280
303
        ib_int64_t      tablespace_version;
281
 
@@ -227,7 +229,7 @@
 
304
@@ -394,7 +397,7 @@
282
305
 
283
306
        count = buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space,
284
307
                                  zip_size, FALSE,
287
310
        srv_buf_pool_reads += count;
288
311
        if (err == DB_TABLESPACE_DELETED) {
289
312
                ut_print_timestamp(stderr);
290
 
@@ -279,7 +281,8 @@
 
313
@@ -446,7 +449,8 @@
291
314
        ulint   space,          /*!< in: space id */
292
315
        ulint   zip_size,       /*!< in: compressed page size in bytes, or 0 */
293
316
        ulint   offset,         /*!< in: page number; see NOTE 3 above */
297
320
 {
298
321
        buf_pool_t*     buf_pool = buf_pool_get(space, offset);
299
322
        ib_int64_t      tablespace_version;
300
 
@@ -498,7 +501,7 @@
 
323
@@ -665,7 +669,7 @@
301
324
                        count += buf_read_page_low(
302
325
                                &err, FALSE,
303
326
                                ibuf_mode,
306
329
                        if (err == DB_TABLESPACE_DELETED) {
307
330
                                ut_print_timestamp(stderr);
308
331
                                fprintf(stderr,
309
 
@@ -591,7 +594,7 @@
 
332
@@ -758,7 +762,7 @@
310
333
                buf_read_page_low(&err, sync && (i + 1 == n_stored),
311
334
                                  BUF_READ_ANY_PAGE, space_ids[i],
312
335
                                  zip_size, TRUE, space_versions[i],
315
338
 
316
339
                if (UNIV_UNLIKELY(err == DB_TABLESPACE_DELETED)) {
317
340
 tablespace_deleted:
318
 
@@ -733,12 +736,12 @@
 
341
@@ -900,12 +904,12 @@
319
342
                if ((i + 1 == n_stored) && sync) {
320
343
                        buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space,
321
344
                                          zip_size, TRUE, tablespace_version,
372
395
 
373
396
--- a/storage/innobase/handler/ha_innodb.cc
374
397
+++ b/storage/innobase/handler/ha_innodb.cc
375
 
@@ -1578,6 +1578,16 @@
 
398
@@ -1580,6 +1580,16 @@
376
399
        trx->check_unique_secondary = !thd_test_options(
377
400
                thd, OPTION_RELAXED_UNIQUE_CHECKS);
378
401
 
389
412
        DBUG_VOID_RETURN;
390
413
 }
391
414
 
392
 
@@ -1632,6 +1642,32 @@
 
415
@@ -1634,6 +1644,32 @@
393
416
        return(trx);
394
417
 }
395
418
 
422
445
 /*********************************************************************//**
423
446
 Note that a transaction has been registered with MySQL.
424
447
 @return true if transaction is registered with MySQL 2PC coordinator */
425
 
@@ -9312,6 +9348,25 @@
 
448
@@ -9302,6 +9338,25 @@
426
449
        statement has ended */
427
450
 
428
451
        if (trx->n_mysql_tables_in_use == 0) {
466
489
+       ulint   offset, /*!< in: page number */
467
490
+       trx_t*  trx);
468
491
 /********************************************************************//**
 
492
 Applies a random read-ahead in buf_pool if there are at least a threshold
 
493
 value of accessed pages from the random read-ahead area. Does not read any
 
494
@@ -65,8 +67,9 @@
 
495
                                or 0 */
 
496
        ulint   offset,         /*!< in: page number of a page which
 
497
                                the current thread wants to access */
 
498
-       ibool   inside_ibuf);   /*!< in: TRUE if we are inside ibuf
 
499
+       ibool   inside_ibuf,    /*!< in: TRUE if we are inside ibuf
 
500
                                routine */
 
501
+       trx_t*  trx);
 
502
 /********************************************************************//**
469
503
 Applies linear read-ahead if in the buf_pool the page is a border page of
470
504
 a linear read-ahead area and all the pages in the area have been accessed.
471
 
@@ -73,7 +75,8 @@
 
505
@@ -98,7 +101,8 @@
472
506
        ulint   space,          /*!< in: space id */
473
507
        ulint   zip_size,       /*!< in: compressed page size in bytes, or 0 */
474
508
        ulint   offset,         /*!< in: page number; see NOTE 3 above */
853
887
 /* The following counter is incremented whenever there is some user activity
854
888
 in the server */
855
889
 UNIV_INTERN ulint      srv_activity_count      = 0;
856
 
@@ -1232,6 +1235,10 @@
 
890
@@ -1234,6 +1237,10 @@
857
891
        ibool                   has_slept = FALSE;
858
892
        srv_conc_slot_t*        slot      = NULL;
859
893
        ulint                   i;
864
898
 
865
899
 #ifdef UNIV_SYNC_DEBUG
866
900
        ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
867
 
@@ -1312,6 +1319,7 @@
 
901
@@ -1314,6 +1321,7 @@
868
902
                switches. */
869
903
                if (SRV_THREAD_SLEEP_DELAY > 0) {
870
904
                        os_thread_sleep(SRV_THREAD_SLEEP_DELAY);
872
906
                }
873
907
 
874
908
                trx->op_info = "";
875
 
@@ -1371,6 +1379,14 @@
 
909
@@ -1373,6 +1381,14 @@
876
910
 #ifdef UNIV_SYNC_DEBUG
877
911
        ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
878
912
 #endif /* UNIV_SYNC_DEBUG */
887
921
        trx->op_info = "waiting in InnoDB queue";
888
922
 
889
923
        thd_wait_begin(trx->mysql_thd, THD_WAIT_USER_LOCK);
890
 
@@ -1379,6 +1395,12 @@
 
924
@@ -1381,6 +1397,12 @@
891
925
 
892
926
        trx->op_info = "";
893
927