summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/btr/btr0btr.cc13
-rw-r--r--storage/innobase/btr/btr0cur.cc21
-rw-r--r--storage/innobase/btr/btr0sea.cc20
-rw-r--r--storage/innobase/buf/buf0buf.cc19
-rw-r--r--storage/innobase/buf/buf0flu.cc4
-rw-r--r--storage/innobase/dict/dict0dict.cc1
-rw-r--r--storage/innobase/handler/ha_innodb.cc48
-rw-r--r--storage/innobase/handler/handler0alter.cc5
-rw-r--r--storage/innobase/include/srv0srv.h25
-rw-r--r--storage/innobase/log/log0log.cc3
-rw-r--r--storage/innobase/log/log0recv.cc5
-rw-r--r--storage/innobase/row/row0mysql.cc2
-rw-r--r--storage/innobase/row/row0vers.cc8
-rw-r--r--storage/innobase/srv/srv0srv.cc100
-rw-r--r--storage/innobase/srv/srv0start.cc4
-rw-r--r--storage/innobase/trx/trx0roll.cc8
-rw-r--r--storage/innobase/trx/trx0trx.cc6
-rw-r--r--storage/rocksdb/CMakeLists.txt7
-rw-r--r--storage/rocksdb/build_rocksdb.cmake26
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test2
20 files changed, 124 insertions, 203 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 736413d2473..786755cb1ab 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -5051,11 +5051,14 @@ loop:
mtr_release_block_at_savepoint(
&mtr, savepoint, right_block);
- btr_block_get(
- page_id_t(index->table->space_id,
- parent_right_page_no),
- table_page_size,
- RW_SX_LATCH, index, &mtr);
+ if (parent_right_page_no != FIL_NULL) {
+ btr_block_get(
+ page_id_t(index->table
+ ->space_id,
+ parent_right_page_no),
+ table_page_size,
+ RW_SX_LATCH, index, &mtr);
+ }
right_block = btr_block_get(
page_id_t(index->table->space_id,
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 2d0f92aa499..957fa48a938 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -638,6 +638,7 @@ btr_cur_optimistic_latch_leaves(
{
ulint mode;
ulint left_page_no;
+ ulint curr_page_no;
switch (*latch_mode) {
case BTR_SEARCH_LEAF:
@@ -664,17 +665,33 @@ btr_cur_optimistic_latch_leaves(
goto unpin_failed;
}
+
+ curr_page_no = block->page.id.page_no();
left_page_no = btr_page_get_prev(
buf_block_get_frame(block));
rw_lock_s_unlock(&block->lock);
if (left_page_no != FIL_NULL) {
- cursor->left_block = btr_block_get(
+ dberr_t err = DB_SUCCESS;
+ cursor->left_block = buf_page_get_gen(
page_id_t(cursor->index->table->space_id,
left_page_no),
page_size_t(cursor->index->table->space
->flags),
- mode, cursor->index, mtr);
+ mode, NULL, BUF_GET_POSSIBLY_FREED,
+ __FILE__, __LINE__, mtr, &err);
+
+ if (err == DB_DECRYPTION_FAILED) {
+ cursor->index->table->file_unreadable = true;
+ }
+
+ if (btr_page_get_next(cursor->left_block->frame)
+ != curr_page_no) {
+ /* release the left block */
+ btr_leaf_page_release(
+ cursor->left_block, mode, mtr);
+ goto unpin_failed;
+ }
} else {
cursor->left_block = NULL;
}
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc
index 32f5ae672e8..d9736ebf747 100644
--- a/storage/innobase/btr/btr0sea.cc
+++ b/storage/innobase/btr/btr0sea.cc
@@ -1149,26 +1149,6 @@ retry:
ut_ad(block->page.id.space() == index->table->space_id);
ut_a(index_id == index->id);
ut_ad(!dict_index_is_ibuf(index));
-#ifdef UNIV_DEBUG
- switch (dict_index_get_online_status(index)) {
- case ONLINE_INDEX_CREATION:
- /* The index is being created (bulk loaded). */
- case ONLINE_INDEX_COMPLETE:
- /* The index has been published. */
- case ONLINE_INDEX_ABORTED:
- /* Either the index creation was aborted due to an
- error observed by InnoDB (in which case there should
- not be any adaptive hash index entries), or it was
- completed and then flagged aborted in
- rollback_inplace_alter_table(). */
- break;
- case ONLINE_INDEX_ABORTED_DROPPED:
- /* The index should have been dropped from the tablespace
- already, and the adaptive hash index entries should have
- been dropped as well. */
- ut_error;
- }
-#endif /* UNIV_DEBUG */
n_fields = block->curr_n_fields;
n_bytes = block->curr_n_bytes;
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 0e112b8655e..076b9c33c00 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -5646,15 +5646,30 @@ buf_page_create(
&& !buf_pool_watch_is_sentinel(buf_pool, &block->page)) {
ut_d(block->page.file_page_was_freed = FALSE);
+#ifdef BTR_CUR_HASH_ADAPT
+ bool drop_hash_entry =
+ (block->page.state == BUF_BLOCK_FILE_PAGE
+ && block->index);
+
+ if (drop_hash_entry) {
+ mutex_enter(&block->mutex);
+ buf_page_set_sticky(&block->page);
+ mutex_exit(&block->mutex);
+ }
+#endif
/* Page can be found in buf_pool */
buf_pool_mutex_exit(buf_pool);
rw_lock_x_unlock(hash_lock);
buf_block_free(free_block);
#ifdef BTR_CUR_HASH_ADAPT
- if (block->page.state == BUF_BLOCK_FILE_PAGE
- && UNIV_LIKELY_NULL(block->index)) {
+ if (drop_hash_entry) {
btr_search_drop_page_hash_index(block);
+ buf_pool_mutex_enter(buf_pool);
+ mutex_enter(&block->mutex);
+ buf_page_unset_sticky(&block->page);
+ mutex_exit(&block->mutex);
+ buf_pool_mutex_exit(buf_pool);
}
#endif /* BTR_CUR_HASH_ADAPT */
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index 6f56a09eda2..e1acc7b9095 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -3116,7 +3116,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_coordinator)(void*)
/* The page_cleaner skips sleep if the server is
idle and there are no pending IOs in the buffer pool
and there is work to do. */
- if (srv_check_activity(last_activity)
+ if (srv_check_activity(&last_activity)
|| buf_get_n_pending_read_ios()
|| n_flushed == 0) {
@@ -3208,7 +3208,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_coordinator)(void*)
n_flushed = n_flushed_lru + n_flushed_list;
- } else if (srv_check_activity(last_activity)) {
+ } else if (srv_check_activity(&last_activity)) {
ulint n_to_flush;
lsn_t lsn_limit = 0;
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 93a86b29af0..80f4347979e 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -5705,6 +5705,7 @@ dict_set_corrupted_index_cache_only(
is corrupted */
if (dict_index_is_clust(index)) {
index->table->corrupted = TRUE;
+ index->table->file_unreadable = true;
}
index->type |= DICT_CORRUPT;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 055d311a119..d458d415c1c 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -447,14 +447,6 @@ TYPELIB innodb_flush_method_typelib = {
NULL
};
-/* The following counter is used to convey information to InnoDB
-about server activity: in case of normal DML ops it is not
-sensible to call srv_active_wake_master_thread after each
-operation, we only do it every INNOBASE_WAKE_INTERVAL'th step. */
-
-#define INNOBASE_WAKE_INTERVAL 32
-static ulong innobase_active_counter = 0;
-
/** Allowed values of innodb_change_buffering */
static const char* innodb_change_buffering_names[] = {
"none", /* IBUF_USE_NONE */
@@ -1852,23 +1844,6 @@ thd_to_trx_id(
#endif /* WITH_WSREP */
/********************************************************************//**
-Increments innobase_active_counter and every INNOBASE_WAKE_INTERVALth
-time calls srv_active_wake_master_thread. This function should be used
-when a single database operation may introduce a small need for
-server utility activity, like checkpointing. */
-inline
-void
-innobase_active_small(void)
-/*=======================*/
-{
- innobase_active_counter++;
-
- if ((innobase_active_counter % INNOBASE_WAKE_INTERVAL) == 0) {
- srv_active_wake_master_thread();
- }
-}
-
-/********************************************************************//**
Converts an InnoDB error code to a MySQL error code and also tells to MySQL
about a possible transaction rollback inside InnoDB caused by a lock wait
timeout or a deadlock.
@@ -6490,11 +6465,6 @@ ha_innobase::close()
MONITOR_INC(MONITOR_TABLE_CLOSE);
- /* Tell InnoDB server that there might be work for
- utility threads: */
-
- srv_active_wake_master_thread();
-
DBUG_RETURN(0);
}
@@ -8205,8 +8175,6 @@ report_error:
}
func_exit:
- innobase_active_small();
-
DBUG_RETURN(error_result);
}
@@ -8893,11 +8861,6 @@ func_exit:
error, m_prebuilt->table->flags, m_user_thd);
}
- /* Tell InnoDB server that there might be work for
- utility threads: */
-
- innobase_active_small();
-
#ifdef WITH_WSREP
if (error == DB_SUCCESS && trx->is_wsrep() &&
wsrep_thd_exec_mode(m_user_thd) == LOCAL_STATE &&
@@ -8956,11 +8919,6 @@ ha_innobase::delete_row(
innobase_srv_conc_exit_innodb(m_prebuilt);
- /* Tell the InnoDB server that there might be work for
- utility threads: */
-
- innobase_active_small();
-
#ifdef WITH_WSREP
if (error == DB_SUCCESS && trx->is_wsrep()
&& wsrep_thd_exec_mode(m_user_thd) == LOCAL_STATE
@@ -12748,7 +12706,6 @@ create_table_info_t::create_table_update_dict()
if (m_flags2 & DICT_TF2_FTS) {
if (!innobase_fts_load_stopword(innobase_table, NULL, m_thd)) {
dict_table_close(innobase_table, FALSE, FALSE);
- srv_active_wake_master_thread();
trx_free(m_trx);
DBUG_RETURN(-1);
}
@@ -12898,11 +12855,6 @@ ha_innobase::create(
error = info.create_table_update_dict();
- /* Tell the InnoDB server that there might be work for
- utility threads: */
-
- srv_active_wake_master_thread();
-
DBUG_RETURN(error);
}
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index ac36cff6173..c5693afe50b 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -9791,11 +9791,6 @@ foreign_fail:
log_append_on_checkpoint(NULL);
- /* Tell the InnoDB server that there might be work for
- utility threads: */
-
- srv_active_wake_master_thread();
-
if (fail) {
for (inplace_alter_handler_ctx** pctx = ctx_array;
*pctx; pctx++) {
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index 6c575733710..93755ad7520 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -788,19 +788,6 @@ srv_reset_io_thread_op_info();
/** Wake up the purge threads if there is work to do. */
void
srv_wake_purge_thread_if_not_active();
-/** Wake up the InnoDB master thread if it was suspended (not sleeping). */
-void
-srv_active_wake_master_thread_low();
-
-#define srv_active_wake_master_thread() \
- do { \
- if (!srv_read_only_mode) { \
- srv_active_wake_master_thread_low(); \
- } \
- } while (0)
-/** Wake up the master thread if it is suspended or being suspended. */
-void
-srv_wake_master_thread();
/******************************************************************//**
Outputs to a file the output of the InnoDB Monitor.
@@ -829,13 +816,13 @@ reading this value as it is only used in heuristics.
ulint
srv_get_activity_count(void);
/*========================*/
-/*******************************************************************//**
-Check if there has been any activity.
+
+/** Check if there has been any activity.
+@param[in,out] activity_count recent activity count to be returned
+if there is a change
@return FALSE if no change in activity counter. */
-ibool
-srv_check_activity(
-/*===============*/
- ulint old_activity_count); /*!< old activity count */
+bool srv_check_activity(ulint *activity_count);
+
/******************************************************************//**
Increment the server activity counter. */
void
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index cf70a35f380..e8f39e03b50 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -1719,6 +1719,9 @@ wait_suspend_loop:
"Waiting for page cleaner");
ib::info() << "Waiting for page_cleaner to "
"finish flushing of buffer pool";
+ /* This is a workaround to avoid the InnoDB hang
+ when OS datetime changed backwards */
+ os_event_set(buf_flush_event);
count = 0;
}
}
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 93adfdd7587..bb83c38704f 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -2876,8 +2876,9 @@ loop:
if (lsn == checkpoint_lsn) {
if (recv_sys->mlog_checkpoint_lsn) {
- ut_ad(recv_sys->mlog_checkpoint_lsn
- <= recv_sys->recovered_lsn);
+ /* There can be multiple
+ MLOG_CHECKPOINT lsn for the
+ same checkpoint. */
break;
}
recv_sys->mlog_checkpoint_lsn
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 15538ff9922..0c5f96e20a5 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -3817,7 +3817,7 @@ funct_exit_all_freed:
trx->op_info = "";
- srv_wake_master_thread();
+ srv_inc_activity_count();
DBUG_RETURN(err);
}
diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc
index 4bbe0c8d717..6f070f7c7d8 100644
--- a/storage/innobase/row/row0vers.cc
+++ b/storage/innobase/row/row0vers.cc
@@ -93,7 +93,7 @@ row_vers_impl_x_locked_low(
trx_id_t trx_id;
rec_t* prev_version = NULL;
rec_offs clust_offsets_[REC_OFFS_NORMAL_SIZE];
- rec_offs* clust_offsets = clust_offsets_;
+ rec_offs* clust_offsets;
mem_heap_t* heap;
dtuple_t* ientry = NULL;
mem_heap_t* v_heap = NULL;
@@ -115,7 +115,7 @@ row_vers_impl_x_locked_low(
heap = mem_heap_create(1024);
- clust_offsets = rec_get_offsets(clust_rec, clust_index, clust_offsets,
+ clust_offsets = rec_get_offsets(clust_rec, clust_index, clust_offsets_,
true, ULINT_UNDEFINED, &heap);
trx_id = row_get_rec_trx_id(clust_rec, clust_index, clust_offsets);
@@ -204,7 +204,7 @@ row_vers_impl_x_locked_low(
ut_ad(committed || prev_version
|| !rec_get_deleted_flag(version, comp));
- /* Free version. */
+ /* Free version and clust_offsets. */
mem_heap_free(old_heap);
if (committed) {
@@ -239,7 +239,7 @@ not_locked:
}
clust_offsets = rec_get_offsets(
- prev_version, clust_index, clust_offsets, true,
+ prev_version, clust_index, clust_offsets_, true,
ULINT_UNDEFINED, &heap);
vers_del = rec_get_deleted_flag(prev_version, comp);
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 5dd2baaf130..6af3b89f15c 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -1923,33 +1923,6 @@ srv_get_active_thread_type(void)
return(ret);
}
-/** Wake up the InnoDB master thread if it was suspended (not sleeping). */
-void
-srv_active_wake_master_thread_low()
-{
- ut_ad(!srv_read_only_mode);
- ut_ad(!srv_sys_mutex_own());
-
- srv_inc_activity_count();
-
- if (my_atomic_loadlint(&srv_sys.n_threads_active[SRV_MASTER]) == 0) {
- srv_slot_t* slot;
-
- srv_sys_mutex_enter();
-
- slot = &srv_sys.sys_threads[SRV_MASTER_SLOT];
-
- /* Only if the master thread has been started. */
-
- if (slot->in_use) {
- ut_a(srv_slot_get_type(slot) == SRV_MASTER);
- os_event_set(slot->event);
- }
-
- srv_sys_mutex_exit();
- }
-}
-
/** Wake up the purge threads if there is work to do. */
void
srv_wake_purge_thread_if_not_active()
@@ -1964,14 +1937,6 @@ srv_wake_purge_thread_if_not_active()
}
}
-/** Wake up the master thread if it is suspended or being suspended. */
-void
-srv_wake_master_thread()
-{
- srv_inc_activity_count();
- srv_release_threads(SRV_MASTER, 1);
-}
-
/*******************************************************************//**
Get current server activity count. We don't hold srv_sys::mutex while
reading this value as it is only used in heuristics.
@@ -1983,15 +1948,20 @@ srv_get_activity_count(void)
return(srv_sys.activity_count);
}
-/*******************************************************************//**
-Check if there has been any activity.
+/** Check if there has been any activity.
+@param[in,out] activity_count recent activity count to be returned
+if there is a change
@return FALSE if no change in activity counter. */
-ibool
-srv_check_activity(
-/*===============*/
- ulint old_activity_count) /*!< in: old activity count */
+bool srv_check_activity(ulint *activity_count)
{
- return(srv_sys.activity_count != old_activity_count);
+ ulint new_activity_count= srv_sys.activity_count;
+ if (new_activity_count != *activity_count)
+ {
+ *activity_count= new_activity_count;
+ return true;
+ }
+
+ return false;
}
/********************************************************************//**
@@ -2300,6 +2270,10 @@ srv_master_do_idle_tasks(void)
log_checkpoint(true);
MONITOR_INC_TIME_IN_MICRO_SECS(MONITOR_SRV_CHECKPOINT_MICROSECOND,
counter_time);
+
+ /* This is a workaround to avoid the InnoDB hang when OS datetime
+ changed backwards.*/
+ os_event_set(buf_flush_event);
}
/** Perform shutdown tasks.
@@ -2388,48 +2362,30 @@ DECLARE_THREAD(srv_master_thread)(
slot = srv_reserve_slot(SRV_MASTER);
ut_a(slot == srv_sys.sys_threads);
-loop:
while (srv_shutdown_state <= SRV_SHUTDOWN_INITIATED) {
srv_master_sleep();
MONITOR_INC(MONITOR_MASTER_THREAD_SLEEP);
- if (srv_check_activity(old_activity_count)) {
- old_activity_count = srv_get_activity_count();
+ if (srv_check_activity(&old_activity_count)) {
srv_master_do_active_tasks();
} else {
srv_master_do_idle_tasks();
}
}
- switch (srv_shutdown_state) {
- case SRV_SHUTDOWN_NONE:
- case SRV_SHUTDOWN_INITIATED:
- break;
- case SRV_SHUTDOWN_FLUSH_PHASE:
- case SRV_SHUTDOWN_LAST_PHASE:
- ut_ad(0);
- /* fall through */
- case SRV_SHUTDOWN_EXIT_THREADS:
- /* srv_init_abort() must have been invoked */
- case SRV_SHUTDOWN_CLEANUP:
- if (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP
- && srv_fast_shutdown < 2) {
- srv_shutdown(srv_fast_shutdown == 0);
- }
- srv_suspend_thread(slot);
- my_thread_end();
- os_thread_exit();
- }
+ ut_ad(srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS
+ || srv_shutdown_state == SRV_SHUTDOWN_CLEANUP);
- srv_main_thread_op_info = "suspending";
+ if (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP
+ && srv_fast_shutdown < 2) {
+ srv_shutdown(srv_fast_shutdown == 0);
+ }
srv_suspend_thread(slot);
-
- srv_main_thread_op_info = "waiting for server activity";
-
- srv_resume_thread(slot);
- goto loop;
+ my_thread_end();
+ os_thread_exit();
+ OS_THREAD_DUMMY_RETURN;
}
/** @return whether purge should exit due to shutdown */
@@ -2597,15 +2553,13 @@ static ulint srv_do_purge(ulint* n_total_purged
++n_use_threads;
}
- } else if (srv_check_activity(old_activity_count)
+ } else if (srv_check_activity(&old_activity_count)
&& n_use_threads > 1) {
/* History length same or smaller since last snapshot,
use fewer threads. */
--n_use_threads;
-
- old_activity_count = srv_get_activity_count();
}
/* Ensure that the purge threads are less than what
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index 318ab49cc9c..859e5a3eec2 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -1178,7 +1178,7 @@ srv_shutdown_all_bg_threads()
if (srv_start_state_is_set(SRV_START_STATE_MASTER)) {
/* c. We wake the master thread so that
it exits */
- srv_wake_master_thread();
+ srv_inc_activity_count();
}
if (srv_start_state_is_set(SRV_START_STATE_PURGE)) {
@@ -2526,7 +2526,7 @@ void srv_shutdown_bg_undo_sources()
fts_optimize_shutdown();
dict_stats_shutdown();
while (row_get_background_drop_list_len_low()) {
- srv_wake_master_thread();
+ srv_inc_activity_count();
os_thread_yield();
}
srv_undo_sources = false;
diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc
index f2b108edf39..c61a67ec05e 100644
--- a/storage/innobase/trx/trx0roll.cc
+++ b/storage/innobase/trx/trx0roll.cc
@@ -66,7 +66,7 @@ static bool trx_rollback_finish(trx_t* trx)
trx_commit(trx);
} else {
ut_a(trx->error_state == DB_INTERRUPTED);
- ut_ad(!srv_is_being_started);
+ ut_ad(srv_shutdown_state != SRV_SHUTDOWN_NONE);
ut_a(!srv_undo_sources);
ut_ad(srv_fast_shutdown);
ut_d(trx->in_rollback = false);
@@ -164,9 +164,6 @@ trx_rollback_to_savepoint_low(
mem_heap_free(heap);
- /* There might be work for utility threads.*/
- srv_active_wake_master_thread();
-
MONITOR_DEC(MONITOR_TRX_ACTIVE);
}
@@ -801,7 +798,8 @@ void trx_rollback_recovered(bool all)
ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE));
ut_d(trx_mutex_exit(trx));
- if (!srv_is_being_started && !srv_undo_sources && srv_fast_shutdown)
+ if (srv_shutdown_state != SRV_SHUTDOWN_NONE && !srv_undo_sources &&
+ srv_fast_shutdown)
goto discard;
if (all || trx_get_dict_operation(trx) != TRX_DICT_OP_NONE)
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 1d4202b3033..e1efc7c895f 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -1470,12 +1470,6 @@ trx_commit_in_memory(
}
trx->commit_lsn = lsn;
-
- /* Tell server some activity has happened, since the trx
- does changes something. Background utility threads like
- master thread, purge thread or page_cleaner thread might
- have some work to do. */
- srv_active_wake_master_thread();
}
ut_ad(!trx->rsegs.m_noredo.undo);
diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt
index 7382df8ecf7..048d945263c 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -112,9 +112,15 @@ SET(ROCKSDB_SE_SOURCES
# This is a strong requirement coming from RocksDB. No conditional checks here.
#ADD_DEFINITIONS(-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX
#)
+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
+ SET(ATOMIC_EXTRA_LIBS -latomic)
+else()
+ SET(ATOMIC_EXTRA_LIBS)
+endif()
MYSQL_ADD_PLUGIN(rocksdb ${ROCKSDB_SE_SOURCES} MODULE_ONLY STORAGE_ENGINE
MODULE_OUTPUT_NAME ha_rocksdb
+ LINK_LIBRARIES ${ATOMIC_EXTRA_LIBS}
COMPONENT rocksdb-engine)
IF(NOT TARGET rocksdb)
@@ -165,6 +171,7 @@ TARGET_LINK_LIBRARIES(rocksdb_aux_lib rocksdblib ${ZLIB_LIBRARY})
if (UNIX AND NOT APPLE)
TARGET_LINK_LIBRARIES(rocksdb_aux_lib -lrt)
endif()
+TARGET_LINK_LIBRARIES(rocksdb_aux_lib ${ATOMIC_EXTRA_LIBS})
# IF (WITH_JEMALLOC)
# FIND_LIBRARY(JEMALLOC_LIBRARY
diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake
index 78581182e7e..8a981b8ec89 100644
--- a/storage/rocksdb/build_rocksdb.cmake
+++ b/storage/rocksdb/build_rocksdb.cmake
@@ -18,17 +18,16 @@ if(WIN32)
# include(${ROCKSDB_SOURCE_DIR}/thirdparty.inc)
else()
option(WITH_ROCKSDB_JEMALLOC "build RocksDB with JeMalloc" OFF)
- if(WITH_ROCKSDB_JEMALLOC)
- find_package(JeMalloc REQUIRED)
- add_definitions(-DROCKSDB_JEMALLOC)
- ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
- include_directories(${JEMALLOC_INCLUDE_DIR})
- endif()
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
# FreeBSD has jemaloc as default malloc
add_definitions(-DROCKSDB_JEMALLOC)
ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
set(WITH_JEMALLOC ON)
+ elseif(WITH_ROCKSDB_JEMALLOC)
+ find_package(JeMalloc REQUIRED)
+ add_definitions(-DROCKSDB_JEMALLOC)
+ ADD_DEFINITIONS(-DROCKSDB_MALLOC_USABLE_SIZE)
+ include_directories(${JEMALLOC_INCLUDE_DIR})
endif()
endif()
@@ -127,6 +126,10 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
ADD_DEFINITIONS(-DHAVE_POWER8 -DHAS_ALTIVEC)
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
+ set(SYSTEM_LIBS ${SYSTEM_LIBS} -latomic)
+endif()
+
option(WITH_FALLOCATE "build with fallocate" ON)
if(WITH_FALLOCATE AND UNIX)
@@ -437,6 +440,17 @@ else()
util/crc32c_ppc.c
util/crc32c_ppc_asm.S)
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
+ # aarch
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64")
+ INCLUDE(CheckCXXCompilerFlag)
+ CHECK_CXX_COMPILER_FLAG("-march=armv8-a+crc+crypto" HAS_ARMV8_CRC)
+ if(HAS_ARMV8_CRC)
+ message(STATUS " HAS_ARMV8_CRC yes")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a+crc+crypto -Wno-unused-function")
+ list(APPEND ROCKSDB_SOURCES
+ util/crc32c_arm64.cc)
+ endif(HAS_ARMV8_CRC)
+ endif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64")
endif()
SET(SOURCES)
FOREACH(s ${ROCKSDB_SOURCES})
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test b/storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test
index 3ebdd67a1a6..aee653830e2 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test
+++ b/storage/rocksdb/mysql-test/rocksdb/t/concurrent_alter.test
@@ -30,7 +30,7 @@ $MYSQL_SLAP --silent --delimiter=";" --query="select * from a1 where b=1" --conc
wait
EOF
---exec bash $MYSQL_TMP_DIR/concurrent_alter.sh
+--exec sh $MYSQL_TMP_DIR/concurrent_alter.sh
let $server_charset=`select @@character_set_server`;
--replace_result $server_charset DEFAULT_CHARSET