~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: mordred
  • Date: 2008-11-01 00:46:20 UTC
  • mto: (572.1.1 devel) (575.1.1 devel)
  • mto: This revision was merged to the branch mainline in revision 573.
  • Revision ID: mordred@opensolaris-20081101004620-vd0kzsl9k40hvf4p
Some updates to dtrace support.

Show diffs side-by-side

added added

removed removed

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