diff options
author | monty@mashka.mysql.fi <> | 2002-09-11 14:49:38 +0300 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2002-09-11 14:49:38 +0300 |
commit | 8b7521eb7f8bf0ebcceacf308b8c6c36f31735c5 (patch) | |
tree | 780174860f876a082066a96b632c69be18d7282f /innobase | |
parent | fa4e07bf978d62fe72b295dac42b31374a2e012e (diff) | |
parent | 75a39efa416cc9db479a1902ecb03a9772e85ebb (diff) | |
download | mariadb-git-8b7521eb7f8bf0ebcceacf308b8c6c36f31735c5.tar.gz |
Merge with 3.23.53
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/btr/btr0cur.c | 25 | ||||
-rw-r--r-- | innobase/os/os0file.c | 2 | ||||
-rw-r--r-- | innobase/os/os0sync.c | 6 | ||||
-rw-r--r-- | innobase/srv/srv0srv.c | 13 | ||||
-rw-r--r-- | innobase/sync/sync0arr.c | 2 | ||||
-rw-r--r-- | innobase/trx/trx0undo.c | 7 |
6 files changed, 48 insertions, 7 deletions
diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c index 25a7060883c..e35ff2ca69e 100644 --- a/innobase/btr/btr0cur.c +++ b/innobase/btr/btr0cur.c @@ -302,6 +302,9 @@ btr_cur_search_to_nth_level( rw_lock_s_unlock(&btr_search_latch); } + /* Store the position of the tree latch we push to mtr so that we + know how to release it when we have latched leaf node(s) */ + savepoint = mtr_set_savepoint(mtr); tree = index->tree; @@ -506,12 +509,18 @@ btr_cur_open_at_index_side( ulint root_height = 0; /* remove warning */ rec_t* node_ptr; ulint estimate; + ulint savepoint; estimate = latch_mode & BTR_ESTIMATE; latch_mode = latch_mode & ~BTR_ESTIMATE; tree = index->tree; + /* Store the position of the tree latch we push to mtr so that we + know how to release it when we have latched the leaf node */ + + savepoint = mtr_set_savepoint(mtr); + if (latch_mode == BTR_MODIFY_TREE) { mtr_x_lock(dict_tree_get_lock(tree), mtr); } else { @@ -544,6 +553,22 @@ btr_cur_open_at_index_side( if (height == 0) { btr_cur_latch_leaves(tree, page, space, page_no, latch_mode, cursor, mtr); + + /* In versions <= 3.23.52 we had forgotten to + release the tree latch here. If in an index scan + we had to scan far to find a record visible to the + current transaction, that could starve others + waiting for the tree latch. */ + + if ((latch_mode != BTR_MODIFY_TREE) + && (latch_mode != BTR_CONT_MODIFY_TREE)) { + + /* Release the tree s-latch */ + + mtr_release_s_latch_at_savepoint( + mtr, savepoint, + dict_tree_get_lock(tree)); + } } if (from_left) { diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 0297388c413..6f122f38107 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -2278,7 +2278,7 @@ consecutive_loop: ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: ERROR: The page to be written seems corrupt!\n"); - page_print(combined_buf + len2); + buf_page_print(combined_buf + len2); fprintf(stderr, "InnoDB: ERROR: The page to be written seems corrupt!\n"); } diff --git a/innobase/os/os0sync.c b/innobase/os/os0sync.c index c1345de0d55..14677ede20f 100644 --- a/innobase/os/os0sync.c +++ b/innobase/os/os0sync.c @@ -49,6 +49,12 @@ os_event_create( TRUE, /* Manual reset */ FALSE, /* Initial state nonsignaled */ name); + if (!event) { + fprintf(stderr, +"InnoDB: Could not create a Windows event semaphore; Windows error %lu\n", + (ulint)GetLastError()); + } + ut_a(event); return(event); diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index d0ac011e60f..95bcd2351cd 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -2825,7 +2825,11 @@ background_loop: srv_main_thread_op_info = (char*)"purging"; - n_pages_purged = trx_purge(); + if (srv_fast_shutdown && srv_shutdown_state > 0) { + n_pages_purged = 0; + } else { + n_pages_purged = trx_purge(); + } srv_main_thread_op_info = (char*)"reserving kernel mutex"; @@ -2837,7 +2841,12 @@ background_loop: mutex_exit(&kernel_mutex); srv_main_thread_op_info = (char*)"doing insert buffer merge"; - n_bytes_merged = ibuf_contract_for_n_pages(TRUE, 20); + + if (srv_fast_shutdown && srv_shutdown_state > 0) { + n_bytes_merged = 0; + } else { + n_bytes_merged = ibuf_contract_for_n_pages(TRUE, 20); + } srv_main_thread_op_info = (char*)"reserving kernel mutex"; diff --git a/innobase/sync/sync0arr.c b/innobase/sync/sync0arr.c index 4d14c32b1ae..4854b40409e 100644 --- a/innobase/sync/sync0arr.c +++ b/innobase/sync/sync0arr.c @@ -924,7 +924,7 @@ sync_array_print_long_waits(void) } if (cell->wait_object != NULL - && difftime(time(NULL), cell->reservation_time) > 420) { + && difftime(time(NULL), cell->reservation_time) > 600) { fprintf(stderr, "InnoDB: Error: semaphore wait has lasted > 600 seconds\n" diff --git a/innobase/trx/trx0undo.c b/innobase/trx/trx0undo.c index 6303c5bbcdd..34f56dba130 100644 --- a/innobase/trx/trx0undo.c +++ b/innobase/trx/trx0undo.c @@ -401,6 +401,10 @@ trx_undo_seg_create( slot_no = trx_rsegf_undo_find_free(rseg_hdr, mtr); if (slot_no == ULINT_UNDEFINED) { + ut_print_timestamp(stderr); + fprintf(stderr, +"InnoDB: Warning: cannot find a free slot for an undo log. Do you have too\n" +"InnoDB: many active transactions running concurrently?"); return(NULL); } @@ -1532,9 +1536,6 @@ trx_undo_assign_undo( mutex_exit(&(rseg->mutex)); mtr_commit(&mtr); - fprintf(stderr, "InnoDB: no undo log slots free\n"); - ut_a(0); - return(NULL); } } |