~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/buf/buf0rea.c

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "trx0sys.h"
20
20
#include "os0file.h"
21
21
#include "srv0start.h"
 
22
#include "srv0srv.h"
22
23
 
23
24
/* The size in blocks of the area where the random read-ahead algorithm counts
24
25
the accessed pages when deciding whether to read-ahead */
26
27
 
27
28
/* There must be at least this many pages in buf_pool in the area to start
28
29
a random read-ahead */
29
 
#define BUF_READ_AHEAD_RANDOM_THRESHOLD (5 + BUF_READ_AHEAD_RANDOM_AREA / 8)
 
30
#define BUF_READ_AHEAD_RANDOM_THRESHOLD (5 + buf_read_ahead_random_area / 8)
30
31
 
31
32
/* The linear read-ahead area size */
32
33
#define BUF_READ_AHEAD_LINEAR_AREA      BUF_READ_AHEAD_AREA
33
34
 
34
35
/* The linear read-ahead threshold */
35
 
#define BUF_READ_AHEAD_LINEAR_THRESHOLD (3 * BUF_READ_AHEAD_LINEAR_AREA / 8)
 
36
#define LINEAR_AREA_THRESHOLD_COEF      5 / 8
36
37
 
37
38
/* If there are buf_pool->curr_size per the number below pending reads, then
38
39
read-ahead is not done: this is to prevent flooding the buffer pool with
61
62
                        ORed to OS_AIO_SIMULATED_WAKE_LATER (see below
62
63
                        at read-ahead functions) */
63
64
        ulint   space,  /* in: space id */
64
 
        ib_longlong tablespace_version, /* in: if the space memory object has
 
65
        ulint   zip_size,/* in: compressed page size, or 0 */
 
66
        ibool   unzip,  /* in: TRUE=request uncompressed page */
 
67
        ib_int64_t tablespace_version, /* in: if the space memory object has
65
68
                        this timestamp different from what we are giving here,
66
69
                        treat the tablespace as dropped; this is a timestamp we
67
70
                        use to stop dangling page reads from a tablespace
68
71
                        which we have DISCARDed + IMPORTed back */
69
72
        ulint   offset) /* in: page number */
70
73
{
71
 
        buf_block_t*    block;
 
74
        buf_page_t*     bpage;
72
75
        ulint           wake_later;
73
76
 
74
77
        *err = DB_SUCCESS;
92
95
                return(0);
93
96
        }
94
97
 
95
 
        if (ibuf_bitmap_page(offset) || trx_sys_hdr_page(space, offset)) {
 
98
        if (ibuf_bitmap_page(zip_size, offset)
 
99
            || trx_sys_hdr_page(space, offset)) {
96
100
 
97
101
                /* Trx sys header is so low in the latching order that we play
98
102
                safe and do not leave the i/o-completion to an asynchronous
107
111
        or is being dropped; if we succeed in initing the page in the buffer
108
112
        pool for read, then DISCARD cannot proceed until the read has
109
113
        completed */
110
 
        block = buf_page_init_for_read(err, mode, space, tablespace_version,
111
 
                                       offset);
112
 
        if (block == NULL) {
 
114
        bpage = buf_page_init_for_read(err, mode, space, zip_size, unzip,
 
115
                                       tablespace_version, offset);
 
116
        if (bpage == NULL) {
113
117
 
114
118
                return(0);
115
119
        }
123
127
        }
124
128
#endif
125
129
 
126
 
        ut_a(block->state == BUF_BLOCK_FILE_PAGE);
127
 
 
128
 
        *err = fil_io(OS_FILE_READ | wake_later,
129
 
                      sync, space,
130
 
                      offset, 0, UNIV_PAGE_SIZE,
131
 
                      (void*)block->frame, (void*)block);
 
130
        ut_ad(buf_page_in_file(bpage));
 
131
 
 
132
        if (zip_size) {
 
133
                *err = fil_io(OS_FILE_READ | wake_later,
 
134
                              sync, space, zip_size, offset, 0, zip_size,
 
135
                              bpage->zip.data, bpage);
 
136
        } else {
 
137
                ut_a(buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE);
 
138
 
 
139
                *err = fil_io(OS_FILE_READ | wake_later,
 
140
                              sync, space, 0, offset, 0, UNIV_PAGE_SIZE,
 
141
                              ((buf_block_t*) bpage)->frame, bpage);
 
142
        }
132
143
        ut_a(*err == DB_SUCCESS);
133
144
 
134
145
        if (sync) {
135
146
                /* The i/o is already completed when we arrive from
136
147
                fil_read */
137
 
                buf_page_io_complete(block);
 
148
                buf_page_io_complete(bpage);
138
149
        }
139
150
 
140
151
        return(1);
159
170
                        the page at the given page number does not get
160
171
                        read even if we return a value > 0! */
161
172
        ulint   space,  /* in: space id */
 
173
        ulint   zip_size,/* in: compressed page size in bytes, or 0 */
162
174
        ulint   offset) /* in: page number of a page which the current thread
163
175
                        wants to access */
164
176
{
165
 
        ib_longlong     tablespace_version;
166
 
        buf_block_t*    block;
 
177
        ib_int64_t      tablespace_version;
167
178
        ulint           recent_blocks   = 0;
168
179
        ulint           count;
169
180
        ulint           LRU_recent_limit;
171
182
        ulint           low, high;
172
183
        ulint           err;
173
184
        ulint           i;
 
185
        ulint           buf_read_ahead_random_area;
174
186
 
175
187
        if (srv_startup_is_before_trx_rollback_phase) {
176
188
                /* No read-ahead to avoid thread deadlocks */
177
189
                return(0);
178
190
        }
179
191
 
180
 
        if (ibuf_bitmap_page(offset) || trx_sys_hdr_page(space, offset)) {
 
192
        if (ibuf_bitmap_page(zip_size, offset)
 
193
            || trx_sys_hdr_page(space, offset)) {
181
194
 
182
195
                /* If it is an ibuf bitmap page or trx sys hdr, we do
183
196
                no read-ahead, as that could break the ibuf page access
192
205
 
193
206
        tablespace_version = fil_space_get_version(space);
194
207
 
195
 
        low  = (offset / BUF_READ_AHEAD_RANDOM_AREA)
196
 
                * BUF_READ_AHEAD_RANDOM_AREA;
197
 
        high = (offset / BUF_READ_AHEAD_RANDOM_AREA + 1)
198
 
                * BUF_READ_AHEAD_RANDOM_AREA;
 
208
        buf_read_ahead_random_area = BUF_READ_AHEAD_RANDOM_AREA;
 
209
 
 
210
        low  = (offset / buf_read_ahead_random_area)
 
211
                * buf_read_ahead_random_area;
 
212
        high = (offset / buf_read_ahead_random_area + 1)
 
213
                * buf_read_ahead_random_area;
199
214
        if (high > fil_space_get_size(space)) {
200
215
 
201
216
                high = fil_space_get_size(space);
207
222
 
208
223
        LRU_recent_limit = buf_LRU_get_recent_limit();
209
224
 
210
 
        mutex_enter(&(buf_pool->mutex));
 
225
        buf_pool_mutex_enter();
211
226
 
212
227
        if (buf_pool->n_pend_reads
213
228
            > buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
214
 
                mutex_exit(&(buf_pool->mutex));
 
229
                buf_pool_mutex_exit();
215
230
 
216
231
                return(0);
217
232
        }
220
235
        that is, reside near the start of the LRU list. */
221
236
 
222
237
        for (i = low; i < high; i++) {
223
 
                block = buf_page_hash_get(space, i);
 
238
                const buf_page_t*       bpage = buf_page_hash_get(space, i);
224
239
 
225
 
                if ((block)
226
 
                    && (block->LRU_position > LRU_recent_limit)
227
 
                    && block->accessed) {
 
240
                if (bpage
 
241
                    && buf_page_is_accessed(bpage)
 
242
                    && (buf_page_get_LRU_position(bpage) > LRU_recent_limit)) {
228
243
 
229
244
                        recent_blocks++;
 
245
 
 
246
                        if (recent_blocks >= BUF_READ_AHEAD_RANDOM_THRESHOLD) {
 
247
 
 
248
                                buf_pool_mutex_exit();
 
249
                                goto read_ahead;
 
250
                        }
230
251
                }
231
252
        }
232
253
 
233
 
        mutex_exit(&(buf_pool->mutex));
234
 
 
235
 
        if (recent_blocks < BUF_READ_AHEAD_RANDOM_THRESHOLD) {
236
 
                /* Do nothing */
237
 
 
238
 
                return(0);
239
 
        }
240
 
 
 
254
        buf_pool_mutex_exit();
 
255
        /* Do nothing */
 
256
        return(0);
 
257
 
 
258
read_ahead:
241
259
        /* Read all the suitable blocks within the area */
242
260
 
243
261
        if (ibuf_inside()) {
252
270
                /* It is only sensible to do read-ahead in the non-sync aio
253
271
                mode: hence FALSE as the first parameter */
254
272
 
255
 
                if (!ibuf_bitmap_page(i)) {
 
273
                if (!ibuf_bitmap_page(zip_size, i)) {
256
274
                        count += buf_read_page_low(
257
275
                                &err, FALSE,
258
276
                                ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER,
259
 
                                space, tablespace_version, i);
 
277
                                space, zip_size, FALSE,
 
278
                                tablespace_version, i);
260
279
                        if (err == DB_TABLESPACE_DELETED) {
261
280
                                ut_print_timestamp(stderr);
262
281
                                fprintf(stderr,
295
314
an exclusive lock on the buffer frame. The flag is cleared and the x-lock
296
315
released by the i/o-handler thread. Does a random read-ahead if it seems
297
316
sensible. */
298
 
 
 
317
UNIV_INTERN
299
318
ulint
300
319
buf_read_page(
301
320
/*==========*/
302
321
                        /* out: number of page read requests issued: this can
303
322
                        be > 1 if read-ahead occurred */
304
323
        ulint   space,  /* in: space id */
 
324
        ulint   zip_size,/* in: compressed page size in bytes, or 0 */
305
325
        ulint   offset) /* in: page number */
306
326
{
307
 
        ib_longlong     tablespace_version;
 
327
        ib_int64_t      tablespace_version;
308
328
        ulint           count;
309
329
        ulint           count2;
310
330
        ulint           err;
311
331
 
312
332
        tablespace_version = fil_space_get_version(space);
313
333
 
314
 
        count = buf_read_ahead_random(space, offset);
 
334
        count = buf_read_ahead_random(space, zip_size, offset);
315
335
 
316
336
        /* We do the i/o in the synchronous aio mode to save thread
317
337
        switches: hence TRUE */
318
338
 
319
339
        count2 = buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space,
 
340
                                   zip_size, FALSE,
320
341
                                   tablespace_version, offset);
321
342
        srv_buf_pool_reads+= count2;
322
343
        if (err == DB_TABLESPACE_DELETED) {
332
353
        /* Flush pages from the end of the LRU list if necessary */
333
354
        buf_flush_free_margin();
334
355
 
 
356
        /* Increment number of I/O operations used for LRU policy. */
 
357
        buf_LRU_stat_inc_io();
 
358
 
335
359
        return(count + count2);
336
360
}
337
361
 
358
382
NOTE 3: the calling thread must want access to the page given: this rule is
359
383
set to prevent unintended read-aheads performed by ibuf routines, a situation
360
384
which could result in a deadlock if the OS does not support asynchronous io. */
361
 
 
 
385
UNIV_INTERN
362
386
ulint
363
387
buf_read_ahead_linear(
364
388
/*==================*/
365
389
                        /* out: number of page read requests issued */
366
390
        ulint   space,  /* in: space id */
 
391
        ulint   zip_size,/* in: compressed page size in bytes, or 0 */
367
392
        ulint   offset) /* in: page number of a page; NOTE: the current thread
368
393
                        must want access to this page (see NOTE 3 above) */
369
394
{
370
 
        ib_longlong     tablespace_version;
371
 
        buf_block_t*    block;
 
395
        ib_int64_t      tablespace_version;
 
396
        buf_page_t*     bpage;
372
397
        buf_frame_t*    frame;
373
 
        buf_block_t*    pred_block      = NULL;
 
398
        buf_page_t*     pred_bpage      = NULL;
374
399
        ulint           pred_offset;
375
400
        ulint           succ_offset;
376
401
        ulint           count;
381
406
        ulint           low, high;
382
407
        ulint           err;
383
408
        ulint           i;
 
409
        const ulint     buf_read_ahead_linear_area
 
410
                = BUF_READ_AHEAD_LINEAR_AREA;
384
411
 
385
 
        if (srv_startup_is_before_trx_rollback_phase) {
 
412
        if (UNIV_UNLIKELY(srv_startup_is_before_trx_rollback_phase)) {
386
413
                /* No read-ahead to avoid thread deadlocks */
387
414
                return(0);
388
415
        }
389
416
 
390
 
        if (ibuf_bitmap_page(offset) || trx_sys_hdr_page(space, offset)) {
391
 
 
392
 
                /* If it is an ibuf bitmap page or trx sys hdr, we do
393
 
                no read-ahead, as that could break the ibuf page access
394
 
                order */
395
 
 
396
 
                return(0);
397
 
        }
398
 
 
399
 
        low  = (offset / BUF_READ_AHEAD_LINEAR_AREA)
400
 
                * BUF_READ_AHEAD_LINEAR_AREA;
401
 
        high = (offset / BUF_READ_AHEAD_LINEAR_AREA + 1)
402
 
                * BUF_READ_AHEAD_LINEAR_AREA;
 
417
        low  = (offset / buf_read_ahead_linear_area)
 
418
                * buf_read_ahead_linear_area;
 
419
        high = (offset / buf_read_ahead_linear_area + 1)
 
420
                * buf_read_ahead_linear_area;
403
421
 
404
422
        if ((offset != low) && (offset != high - 1)) {
405
423
                /* This is not a border page of the area: return */
407
425
                return(0);
408
426
        }
409
427
 
 
428
        if (ibuf_bitmap_page(zip_size, offset)
 
429
            || trx_sys_hdr_page(space, offset)) {
 
430
 
 
431
                /* If it is an ibuf bitmap page or trx sys hdr, we do
 
432
                no read-ahead, as that could break the ibuf page access
 
433
                order */
 
434
 
 
435
                return(0);
 
436
        }
 
437
 
410
438
        /* Remember the tablespace version before we ask te tablespace size
411
439
        below: if DISCARD + IMPORT changes the actual .ibd file meanwhile, we
412
440
        do not try to read outside the bounds of the tablespace! */
413
441
 
414
442
        tablespace_version = fil_space_get_version(space);
415
443
 
416
 
        mutex_enter(&(buf_pool->mutex));
 
444
        buf_pool_mutex_enter();
417
445
 
418
446
        if (high > fil_space_get_size(space)) {
419
 
                mutex_exit(&(buf_pool->mutex));
 
447
                buf_pool_mutex_exit();
420
448
                /* The area is not whole, return */
421
449
 
422
450
                return(0);
424
452
 
425
453
        if (buf_pool->n_pend_reads
426
454
            > buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
427
 
                mutex_exit(&(buf_pool->mutex));
 
455
                buf_pool_mutex_exit();
428
456
 
429
457
                return(0);
430
458
        }
442
470
        fail_count = 0;
443
471
 
444
472
        for (i = low; i < high; i++) {
445
 
                block = buf_page_hash_get(space, i);
 
473
                bpage = buf_page_hash_get(space, i);
446
474
 
447
 
                if ((block == NULL) || !block->accessed) {
 
475
                if ((bpage == NULL) || !buf_page_is_accessed(bpage)) {
448
476
                        /* Not accessed */
449
477
                        fail_count++;
450
478
 
451
 
                } else if (pred_block
452
 
                           && (ut_ulint_cmp(block->LRU_position,
453
 
                                            pred_block->LRU_position)
 
479
                } else if (pred_bpage
 
480
                           && (ut_ulint_cmp(
 
481
                                       buf_page_get_LRU_position(bpage),
 
482
                                       buf_page_get_LRU_position(pred_bpage))
454
483
                               != asc_or_desc)) {
455
484
                        /* Accesses not in the right order */
456
485
 
457
486
                        fail_count++;
458
 
                        pred_block = block;
 
487
                        pred_bpage = bpage;
459
488
                }
460
489
        }
461
490
 
462
 
        if (fail_count > BUF_READ_AHEAD_LINEAR_AREA
463
 
            - BUF_READ_AHEAD_LINEAR_THRESHOLD) {
 
491
        if (fail_count > buf_read_ahead_linear_area
 
492
            * LINEAR_AREA_THRESHOLD_COEF) {
464
493
                /* Too many failures: return */
465
494
 
466
 
                mutex_exit(&(buf_pool->mutex));
 
495
                buf_pool_mutex_exit();
467
496
 
468
497
                return(0);
469
498
        }
471
500
        /* If we got this far, we know that enough pages in the area have
472
501
        been accessed in the right order: linear read-ahead can be sensible */
473
502
 
474
 
        block = buf_page_hash_get(space, offset);
 
503
        bpage = buf_page_hash_get(space, offset);
475
504
 
476
 
        if (block == NULL) {
477
 
                mutex_exit(&(buf_pool->mutex));
 
505
        if (bpage == NULL) {
 
506
                buf_pool_mutex_exit();
478
507
 
479
508
                return(0);
480
509
        }
481
510
 
482
 
        frame = block->frame;
 
511
        switch (buf_page_get_state(bpage)) {
 
512
        case BUF_BLOCK_ZIP_PAGE:
 
513
                frame = bpage->zip.data;
 
514
                break;
 
515
        case BUF_BLOCK_FILE_PAGE:
 
516
                frame = ((buf_block_t*) bpage)->frame;
 
517
                break;
 
518
        default:
 
519
                ut_error;
 
520
                break;
 
521
        }
483
522
 
484
523
        /* Read the natural predecessor and successor page addresses from
485
524
        the page; NOTE that because the calling thread may have an x-latch
490
529
        pred_offset = fil_page_get_prev(frame);
491
530
        succ_offset = fil_page_get_next(frame);
492
531
 
493
 
        mutex_exit(&(buf_pool->mutex));
 
532
        buf_pool_mutex_exit();
494
533
 
495
534
        if ((offset == low) && (succ_offset == offset + 1)) {
496
535
 
507
546
                return(0);
508
547
        }
509
548
 
510
 
        low  = (new_offset / BUF_READ_AHEAD_LINEAR_AREA)
511
 
                * BUF_READ_AHEAD_LINEAR_AREA;
512
 
        high = (new_offset / BUF_READ_AHEAD_LINEAR_AREA + 1)
513
 
                * BUF_READ_AHEAD_LINEAR_AREA;
 
549
        low  = (new_offset / buf_read_ahead_linear_area)
 
550
                * buf_read_ahead_linear_area;
 
551
        high = (new_offset / buf_read_ahead_linear_area + 1)
 
552
                * buf_read_ahead_linear_area;
514
553
 
515
554
        if ((new_offset != low) && (new_offset != high - 1)) {
516
555
                /* This is not a border page of the area: return */
544
583
                /* It is only sensible to do read-ahead in the non-sync
545
584
                aio mode: hence FALSE as the first parameter */
546
585
 
547
 
                if (!ibuf_bitmap_page(i)) {
 
586
                if (!ibuf_bitmap_page(zip_size, i)) {
548
587
                        count += buf_read_page_low(
549
588
                                &err, FALSE,
550
589
                                ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER,
551
 
                                space, tablespace_version, i);
 
590
                                space, zip_size, FALSE, tablespace_version, i);
552
591
                        if (err == DB_TABLESPACE_DELETED) {
553
592
                                ut_print_timestamp(stderr);
554
593
                                fprintf(stderr,
579
618
        }
580
619
#endif /* UNIV_DEBUG */
581
620
 
 
621
        /* Read ahead is considered one I/O operation for the purpose of
 
622
        LRU policy decision. */
 
623
        buf_LRU_stat_inc_io();
 
624
 
582
625
        ++srv_read_ahead_seq;
583
626
        return(count);
584
627
}
587
630
Issues read requests for pages which the ibuf module wants to read in, in
588
631
order to contract the insert buffer tree. Technically, this function is like
589
632
a read-ahead function. */
590
 
 
 
633
UNIV_INTERN
591
634
void
592
635
buf_read_ibuf_merge_pages(
593
636
/*======================*/
594
 
        ibool   sync,           /* in: TRUE if the caller wants this function
595
 
                                to wait for the highest address page to get
596
 
                                read in, before this function returns */
597
 
        ulint*  space_ids,      /* in: array of space ids */
598
 
        ib_longlong* space_versions,/* in: the spaces must have this version
599
 
                                number (timestamp), otherwise we discard the
600
 
                                read; we use this to cancel reads if
601
 
                                DISCARD + IMPORT may have changed the
602
 
                                tablespace size */
603
 
        ulint*  page_nos,       /* in: array of page numbers to read, with the
604
 
                                highest page number the last in the array */
605
 
        ulint   n_stored)       /* in: number of page numbers in the array */
 
637
        ibool           sync,           /* in: TRUE if the caller
 
638
                                        wants this function to wait
 
639
                                        for the highest address page
 
640
                                        to get read in, before this
 
641
                                        function returns */
 
642
        const ulint*    space_ids,      /* in: array of space ids */
 
643
        const ib_int64_t* space_versions,/* in: the spaces must have
 
644
                                        this version number
 
645
                                        (timestamp), otherwise we
 
646
                                        discard the read; we use this
 
647
                                        to cancel reads if DISCARD +
 
648
                                        IMPORT may have changed the
 
649
                                        tablespace size */
 
650
        const ulint*    page_nos,       /* in: array of page numbers
 
651
                                        to read, with the highest page
 
652
                                        number the last in the
 
653
                                        array */
 
654
        ulint           n_stored)       /* in: number of elements
 
655
                                        in the arrays */
606
656
{
607
 
        ulint   err;
608
657
        ulint   i;
609
658
 
610
659
        ut_ad(!ibuf_inside());
617
666
        }
618
667
 
619
668
        for (i = 0; i < n_stored; i++) {
620
 
                buf_read_page_low(&err,
621
 
                                  (i + 1 == n_stored) && sync,
622
 
                                  BUF_READ_ANY_PAGE,
623
 
                                  space_ids[i], space_versions[i],
 
669
                ulint   zip_size = fil_space_get_zip_size(space_ids[i]);
 
670
                ulint   err;
 
671
 
 
672
                if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) {
 
673
 
 
674
                        goto tablespace_deleted;
 
675
                }
 
676
 
 
677
                buf_read_page_low(&err, sync && (i + 1 == n_stored),
 
678
                                  BUF_READ_ANY_PAGE, space_ids[i],
 
679
                                  zip_size, TRUE, space_versions[i],
624
680
                                  page_nos[i]);
625
681
 
626
 
                if (err == DB_TABLESPACE_DELETED) {
 
682
                if (UNIV_UNLIKELY(err == DB_TABLESPACE_DELETED)) {
 
683
tablespace_deleted:
627
684
                        /* We have deleted or are deleting the single-table
628
685
                        tablespace: remove the entries for that page */
629
686
 
630
687
                        ibuf_merge_or_delete_for_page(NULL, space_ids[i],
631
 
                                                      page_nos[i], FALSE);
 
688
                                                      page_nos[i],
 
689
                                                      zip_size, FALSE);
632
690
                }
633
691
        }
634
692
 
648
706
 
649
707
/************************************************************************
650
708
Issues read requests for pages which recovery wants to read in. */
651
 
 
 
709
UNIV_INTERN
652
710
void
653
711
buf_read_recv_pages(
654
712
/*================*/
655
 
        ibool   sync,           /* in: TRUE if the caller wants this function
656
 
                                to wait for the highest address page to get
657
 
                                read in, before this function returns */
658
 
        ulint   space,          /* in: space id */
659
 
        ulint*  page_nos,       /* in: array of page numbers to read, with the
660
 
                                highest page number the last in the array */
661
 
        ulint   n_stored)       /* in: number of page numbers in the array */
 
713
        ibool           sync,           /* in: TRUE if the caller
 
714
                                        wants this function to wait
 
715
                                        for the highest address page
 
716
                                        to get read in, before this
 
717
                                        function returns */
 
718
        ulint           space,          /* in: space id */
 
719
        ulint           zip_size,       /* in: compressed page size in
 
720
                                        bytes, or 0 */
 
721
        const ulint*    page_nos,       /* in: array of page numbers
 
722
                                        to read, with the highest page
 
723
                                        number the last in the
 
724
                                        array */
 
725
        ulint           n_stored)       /* in: number of page numbers
 
726
                                        in the array */
662
727
{
663
 
        ib_longlong     tablespace_version;
 
728
        ib_int64_t      tablespace_version;
664
729
        ulint           count;
665
730
        ulint           err;
666
731
        ulint           i;
667
732
 
 
733
        zip_size = fil_space_get_zip_size(space);
668
734
        tablespace_version = fil_space_get_version(space);
669
735
 
670
736
        for (i = 0; i < n_stored; i++) {
698
764
                os_aio_print_debug = FALSE;
699
765
 
700
766
                if ((i + 1 == n_stored) && sync) {
701
 
                        buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE,
702
 
                                          space, tablespace_version,
 
767
                        buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space,
 
768
                                          zip_size, TRUE, tablespace_version,
703
769
                                          page_nos[i]);
704
770
                } else {
705
771
                        buf_read_page_low(&err, FALSE, BUF_READ_ANY_PAGE
706
772
                                          | OS_AIO_SIMULATED_WAKE_LATER,
707
 
                                          space, tablespace_version,
708
 
                                          page_nos[i]);
 
773
                                          space, zip_size, TRUE,
 
774
                                          tablespace_version, page_nos[i]);
709
775
                }
710
776
        }
711
777