Skip to content

Commit eca5b0f

Browse files
Sunny BainsSunny Bains
authored andcommitted
WL#6769 - Resync with mysql-trunk
1 parent ac542e0 commit eca5b0f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+7781
-7215
lines changed

storage/innobase/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ SET(INNOBASE_SOURCES
4141
dict/dict0mem.cc
4242
dict/dict0stats.cc
4343
dict/dict0stats_bg.cc
44-
dyn/dyn0dyn.cc
4544
eval/eval0eval.cc
4645
eval/eval0proc.cc
4746
fil/fil0fil.cc

storage/innobase/btr/btr0btr.cc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ btr_height_get(
789789
height = btr_page_get_level(buf_block_get_frame(root_block), mtr);
790790

791791
/* Release the S latch on the root page. */
792-
mtr_memo_release(mtr, root_block, MTR_MEMO_PAGE_S_FIX);
792+
mtr->memo_release(root_block, MTR_MEMO_PAGE_S_FIX);
793793
#ifdef UNIV_SYNC_DEBUG
794794
sync_thread_reset_level(&root_block->lock);
795795
#endif /* UNIV_SYNC_DEBUG */
@@ -849,13 +849,13 @@ btr_root_adjust_on_import(
849849
ulint zip_size = dict_table_zip_size(table);
850850
ulint root_page_no = dict_index_get_page(index);
851851

852+
DBUG_EXECUTE_IF("ib_import_trigger_corruption_3",
853+
return(DB_CORRUPTION););
854+
852855
mtr_start(&mtr);
853856

854857
mtr_set_log_mode(&mtr, MTR_LOG_NO_REDO);
855858

856-
DBUG_EXECUTE_IF("ib_import_trigger_corruption_3",
857-
return(DB_CORRUPTION););
858-
859859
block = btr_block_get(
860860
space_id, zip_size, root_page_no, RW_X_LATCH, index, &mtr);
861861

@@ -1714,7 +1714,7 @@ btr_free_but_not_root(
17141714
in bytes or 0 for uncompressed
17151715
pages */
17161716
ulint root_page_no, /*!< in: root page number */
1717-
ulint logging_mode) /*!< in: mtr logging mode */
1717+
mtr_log_t logging_mode) /*!< in: mtr logging mode */
17181718
{
17191719
ibool finished;
17201720
page_t* root;
@@ -1831,7 +1831,6 @@ btr_page_reorganize_low(
18311831
page_zip_des_t* page_zip = buf_block_get_page_zip(block);
18321832
buf_block_t* temp_block;
18331833
page_t* temp_page;
1834-
ulint log_mode;
18351834
ulint data_size1;
18361835
ulint data_size2;
18371836
ulint max_ins_size1;
@@ -1849,7 +1848,7 @@ btr_page_reorganize_low(
18491848
max_ins_size1 = page_get_max_insert_size_after_reorganize(page, 1);
18501849

18511850
/* Turn logging off */
1852-
log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE);
1851+
mtr_log_t log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE);
18531852

18541853
#ifndef UNIV_HOTBACKUP
18551854
temp_block = buf_block_alloc(buf_pool);
@@ -1989,8 +1988,8 @@ btr_page_reorganize_low(
19891988

19901989
#ifndef UNIV_HOTBACKUP
19911990
if (success) {
1992-
byte type;
1993-
byte* log_ptr;
1991+
mlog_id_t type;
1992+
byte* log_ptr;
19941993

19951994
/* Write the log record */
19961995
if (page_zip) {
@@ -3048,8 +3047,8 @@ btr_page_split_and_insert(
30483047
&& page_is_leaf(page)
30493048
&& !dict_index_is_online_ddl(cursor->index)) {
30503049

3051-
mtr_memo_release(mtr, dict_index_get_lock(cursor->index),
3052-
MTR_MEMO_X_LOCK);
3050+
mtr->memo_release(dict_index_get_lock(cursor->index),
3051+
MTR_MEMO_X_LOCK);
30533052
}
30543053

30553054
/* 5. Move then the records to the new page */
@@ -3336,9 +3335,10 @@ UNIV_INLINE
33363335
void
33373336
btr_set_min_rec_mark_log(
33383337
/*=====================*/
3339-
rec_t* rec, /*!< in: record */
3340-
byte type, /*!< in: MLOG_COMP_REC_MIN_MARK or MLOG_REC_MIN_MARK */
3341-
mtr_t* mtr) /*!< in: mtr */
3338+
rec_t* rec, /*!< in: record */
3339+
mlog_id_t type, /*!< in: MLOG_COMP_REC_MIN_MARK or
3340+
MLOG_REC_MIN_MARK */
3341+
mtr_t* mtr) /*!< in: mtr */
33423342
{
33433343
mlog_write_initial_log_record(rec, type, mtr);
33443344

storage/innobase/btr/btr0cur.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4420,17 +4420,17 @@ btr_store_big_rec_extern_fields(
44204420
if (btr_blob_op_is_update(op)) {
44214421
/* Avoid reusing pages that have been previously freed
44224422
in btr_mtr. */
4423-
if (btr_mtr->n_freed_pages) {
4423+
if (btr_mtr->has_freed_pages()) {
44244424
if (heap == NULL) {
44254425
heap = mem_heap_create(
4426-
btr_mtr->n_freed_pages
4426+
btr_mtr->get_freed_pages()
44274427
* sizeof *freed_pages);
44284428
}
44294429

44304430
freed_pages = static_cast<buf_block_t**>(
44314431
mem_heap_alloc(
44324432
heap,
4433-
btr_mtr->n_freed_pages
4433+
btr_mtr->get_freed_pages()
44344434
* sizeof *freed_pages));
44354435
n_freed_pages = 0;
44364436
}
@@ -4530,7 +4530,8 @@ btr_store_big_rec_extern_fields(
45304530
allocate another page for the BLOB data. */
45314531
ut_ad(alloc_mtr == btr_mtr);
45324532
ut_ad(btr_blob_op_is_update(op));
4533-
ut_ad(n_freed_pages < btr_mtr->n_freed_pages);
4533+
ut_ad(n_freed_pages
4534+
< btr_mtr->get_freed_pages());
45344535
freed_pages[n_freed_pages++] = block;
45354536
goto alloc_another;
45364537
}

storage/innobase/btr/btr0pcur.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ btr_pcur_restore_position_func(
241241
mem_heap_t* heap;
242242

243243
ut_ad(mtr);
244-
ut_ad(mtr->state == MTR_ACTIVE);
244+
ut_ad(mtr->is_active());
245245

246246
index = btr_cur_get_index(btr_pcur_get_btr_cur(cursor));
247247

storage/innobase/btr/btr0sea.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Created 2/17/1996 Heikki Tuuri
4242
#include "btr0pcur.h"
4343
#include "btr0btr.h"
4444
#include "ha0ha.h"
45+
#include "srv0mon.h"
4546

4647
/** Flag: has the search system been enabled?
4748
Protected by btr_search_latch. */

storage/innobase/buf/buf0buddy.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ are written.*/
6969

7070
/** Value that we stamp on all buffers that are currently on the zip_free
7171
list. This value is stamped at BUF_BUDDY_STAMP_OFFSET offset */
72-
#define BUF_BUDDY_STAMP_FREE (SRV_LOG_SPACE_FIRST_ID)
72+
#define BUF_BUDDY_STAMP_FREE (0xFFFFFFE0UL)
7373

7474
/** Stamp value for non-free buffers. Will be overwritten by a non-zero
7575
value by the consumer of the block */

storage/innobase/buf/buf0buf.cc

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -510,13 +510,13 @@ buf_page_is_corrupted(
510510
}
511511

512512
#if !defined(UNIV_HOTBACKUP) && !defined(UNIV_INNOCHECKSUM)
513-
if (check_lsn && recv_lsn_checks_on) {
513+
if (check_lsn && recover_ptr->is_lsn_check_on()) {
514514
lsn_t current_lsn;
515515

516516
/* Since we are going to reset the page LSN during the import
517517
phase it makes no sense to spam the log with error messages. */
518518

519-
if (log_peek_lsn(&current_lsn)
519+
if (redo_log->peek_lsn(&current_lsn)
520520
&& current_lsn
521521
< mach_read_from_8(read_buf + FIL_PAGE_LSN)) {
522522
ut_print_timestamp(stderr);
@@ -2576,16 +2576,14 @@ buf_page_get_gen(
25762576
buf_block_t* block;
25772577
ulint fold;
25782578
unsigned access_time;
2579-
ulint fix_type;
25802579
ibool must_read;
25812580
rw_lock_t* hash_lock;
25822581
ib_mutex_t* block_mutex;
25832582
buf_page_t* hash_bpage;
25842583
ulint retries = 0;
25852584
buf_pool_t* buf_pool = buf_pool_get(space, offset);
25862585

2587-
ut_ad(mtr);
2588-
ut_ad(mtr->state == MTR_ACTIVE);
2586+
ut_ad(mtr->is_active());
25892587
ut_ad((rw_latch == RW_S_LATCH)
25902588
|| (rw_latch == RW_X_LATCH)
25912589
|| (rw_latch == RW_NO_LATCH));
@@ -2865,7 +2863,7 @@ buf_page_get_gen(
28652863
verification is not necessary when decompressing the page. */
28662864
ut_a(buf_zip_decompress(block, FALSE));
28672865

2868-
if (UNIV_LIKELY(!recv_no_ibuf_operations)) {
2866+
if (redo_log->is_ibuf_allowed()) {
28692867
if (access_time) {
28702868
#ifdef UNIV_IBUF_COUNT_DEBUG
28712869
ut_a(ibuf_count_get(space, offset) == 0);
@@ -3003,6 +3001,8 @@ buf_page_get_gen(
30033001
ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
30043002
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
30053003

3004+
mtr_memo_type_t fix_type;
3005+
30063006
switch (rw_latch) {
30073007
case RW_NO_LATCH:
30083008
if (must_read) {
@@ -3082,11 +3082,10 @@ buf_page_optimistic_get(
30823082
buf_pool_t* buf_pool;
30833083
unsigned access_time;
30843084
ibool success;
3085-
ulint fix_type;
30863085

30873086
ut_ad(block);
30883087
ut_ad(mtr);
3089-
ut_ad(mtr->state == MTR_ACTIVE);
3088+
ut_ad(mtr->is_active());
30903089
ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH));
30913090

30923091
mutex_enter(&block->mutex);
@@ -3113,6 +3112,8 @@ buf_page_optimistic_get(
31133112
buf_block_get_zip_size(block),
31143113
buf_block_get_page_no(block), NULL));
31153114

3115+
mtr_memo_type_t fix_type;
3116+
31163117
if (rw_latch == RW_S_LATCH) {
31173118
success = rw_lock_s_lock_nowait(&(block->lock),
31183119
file, line);
@@ -3199,10 +3200,8 @@ buf_page_get_known_nowait(
31993200
{
32003201
buf_pool_t* buf_pool;
32013202
ibool success;
3202-
ulint fix_type;
32033203

3204-
ut_ad(mtr);
3205-
ut_ad(mtr->state == MTR_ACTIVE);
3204+
ut_ad(mtr->is_active());
32063205
ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH));
32073206

32083207
mutex_enter(&block->mutex);
@@ -3236,6 +3235,8 @@ buf_page_get_known_nowait(
32363235

32373236
ut_ad(!ibuf_inside(mtr) || mode == BUF_KEEP_OLD);
32383237

3238+
mtr_memo_type_t fix_type;
3239+
32393240
if (rw_latch == RW_S_LATCH) {
32403241
success = rw_lock_s_lock_nowait(&(block->lock),
32413242
file, line);
@@ -3303,12 +3304,11 @@ buf_page_try_get_func(
33033304
{
33043305
buf_block_t* block;
33053306
ibool success;
3306-
ulint fix_type;
33073307
buf_pool_t* buf_pool = buf_pool_get(space_id, page_no);
33083308
rw_lock_t* hash_lock;
33093309

33103310
ut_ad(mtr);
3311-
ut_ad(mtr->state == MTR_ACTIVE);
3311+
ut_ad(mtr->is_active());
33123312

33133313
block = buf_block_hash_get_s_locked(buf_pool, space_id,
33143314
page_no, &hash_lock);
@@ -3334,7 +3334,7 @@ buf_page_try_get_func(
33343334
buf_block_buf_fix_inc(block, file, line);
33353335
mutex_exit(&block->mutex);
33363336

3337-
fix_type = MTR_MEMO_PAGE_S_FIX;
3337+
mtr_memo_type_t fix_type = MTR_MEMO_PAGE_S_FIX;
33383338
success = rw_lock_s_lock_nowait(&block->lock, file, line);
33393339

33403340
if (!success) {
@@ -3530,7 +3530,7 @@ buf_page_init_for_read(
35303530

35313531
ibuf_mtr_start(&mtr);
35323532

3533-
if (!recv_no_ibuf_operations
3533+
if (redo_log->is_ibuf_allowed()
35343534
&& !ibuf_page(space, zip_size, offset, &mtr)) {
35353535

35363536
ibuf_mtr_commit(&mtr);
@@ -3541,7 +3541,7 @@ buf_page_init_for_read(
35413541
ut_ad(mode == BUF_READ_ANY_PAGE);
35423542
}
35433543

3544-
if (zip_size && !unzip && !recv_recovery_is_on()) {
3544+
if (zip_size && !unzip && !redo_log->is_recovery_on()) {
35453545
block = NULL;
35463546
} else {
35473547
block = buf_LRU_get_free_block(buf_pool);
@@ -3760,8 +3760,7 @@ buf_page_create(
37603760
buf_pool_t* buf_pool = buf_pool_get(space, offset);
37613761
rw_lock_t* hash_lock;
37623762

3763-
ut_ad(mtr);
3764-
ut_ad(mtr->state == MTR_ACTIVE);
3763+
ut_ad(mtr->is_active());
37653764
ut_ad(space || !zip_size);
37663765

37673766
free_block = buf_LRU_get_free_block(buf_pool);
@@ -4194,17 +4193,18 @@ buf_page_io_complete(
41944193
DBUG_EXECUTE_IF("buf_page_is_corrupt_failure",
41954194
page_not_corrupt: bpage = bpage; );
41964195

4197-
if (recv_recovery_is_on()) {
4196+
if (redo_log->is_recovery_on()) {
41984197
/* Pages must be uncompressed for crash recovery. */
41994198
ut_a(uncompressed);
4200-
recv_recover_page(TRUE, (buf_block_t*) bpage);
4199+
recover_ptr->recover_page(TRUE, (buf_block_t*) bpage);
42014200
}
42024201

42034202
/* If space is being truncated then avoid ibuf operation.
42044203
During re-init we have already freed ibuf entries. */
42054204
if (uncompressed
4206-
&& !recv_no_ibuf_operations
4205+
&& redo_log->is_ibuf_allowed()
42074206
&& !srv_is_tablespace_truncated(bpage->space)) {
4207+
42084208
ibuf_merge_or_delete_for_page(
42094209
(buf_block_t*) bpage, bpage->space,
42104210
bpage->offset, buf_page_get_zip_size(bpage),

storage/innobase/buf/buf0dblwr.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Created 2011/12/19
2424
*******************************************************/
2525

2626
#include "ha_prototypes.h"
27-
2827
#include "buf0dblwr.h"
2928

3029
#ifdef UNIV_NONINL
@@ -38,6 +37,8 @@ Created 2011/12/19
3837
#include "page0zip.h"
3938
#include "trx0sys.h"
4039

40+
#include "buf0dblwr.h"
41+
4142
#ifndef UNIV_HOTBACKUP
4243

4344
#ifdef UNIV_PFS_MUTEX
@@ -339,7 +340,7 @@ buf_dblwr_create(void)
339340
mtr_commit(&mtr);
340341

341342
/* Flush the modified pages to disk and make a checkpoint */
342-
log_make_checkpoint_at(LSN_MAX, TRUE);
343+
redo_log->checkpoint_at(LSN_MAX, true);
343344

344345
/* Remove doublewrite pages from LRU */
345346
buf_pool_invalidate();

storage/innobase/buf/buf0flu.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,9 @@ buf_flush_write_block_low(
917917
}
918918
#else
919919
/* Force the log to the disk before writing the modified block */
920-
log_write_up_to(bpage->newest_modification, LOG_WAIT_ALL_GROUPS, TRUE);
920+
redo_log->write_up_to(
921+
bpage->newest_modification,
922+
redo_log_t::WAIT_MODE_ALL_GROUPS, true);
921923
#endif
922924
switch (buf_page_get_state(bpage)) {
923925
case BUF_BLOCK_POOL_WATCH:
@@ -2195,14 +2197,14 @@ af_get_pct_for_lsn(
21952197
lsn_t max_async_age;
21962198
lsn_t lsn_age_factor;
21972199
lsn_t af_lwm = (srv_adaptive_flushing_lwm
2198-
* log_get_capacity()) / 100;
2200+
* redo_log->get_capacity()) / 100;
21992201

22002202
if (age < af_lwm) {
22012203
/* No adaptive flushing. */
22022204
return(0);
22032205
}
22042206

2205-
max_async_age = log_get_max_modified_age_async();
2207+
max_async_age = redo_log->get_max_modified_age_async();
22062208

22072209
if (age < max_async_age && !srv_adaptive_flushing) {
22082210
/* We have still not reached the max_async point and
@@ -2252,7 +2254,7 @@ page_cleaner_flush_pages_if_needed(void)
22522254
ulint pct_total = 0;
22532255
int age_factor = 0;
22542256

2255-
cur_lsn = log_get_lsn();
2257+
cur_lsn = redo_log->get_lsn();
22562258

22572259
if (prev_lsn == 0) {
22582260
/* First time around. */

0 commit comments

Comments
 (0)