Skip to content
Permalink
Browse files
MDEV-17441 - InnoDB transition to C++11 atomics
fil_space_t::redo_skipped_count transition to Atomic_counter.
  • Loading branch information
Sergey Vojtovich committed Dec 27, 2018
1 parent b1c3e6c commit de32e66
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
@@ -621,7 +621,7 @@ fsp_space_modify_check(
case MTR_LOG_NO_REDO:
ut_ad(space->purpose == FIL_TYPE_TEMPORARY
|| space->purpose == FIL_TYPE_IMPORT
|| my_atomic_loadlint(&space->redo_skipped_count));
|| space->redo_skipped_count);
return;
case MTR_LOG_ALL:
/* We may only write redo log for a persistent tablespace. */
@@ -286,8 +286,7 @@ class BtrBulk
{
#ifdef UNIV_DEBUG
if (m_flush_observer)
my_atomic_addlint(&m_index->table->space->redo_skipped_count,
1);
m_index->table->space->redo_skipped_count++;
#endif /* UNIV_DEBUG */
}

@@ -296,8 +295,7 @@ class BtrBulk
{
#ifdef UNIV_DEBUG
if (m_flush_observer)
my_atomic_addlint(&m_index->table->space->redo_skipped_count,
ulint(-1));
m_index->table->space->redo_skipped_count--;
#endif /* UNIV_DEBUG */
}

@@ -97,11 +97,9 @@ struct fil_space_t {
/** whether undo tablespace truncation is in progress */
bool is_being_truncated;
#ifdef UNIV_DEBUG
ulint redo_skipped_count;
/*!< reference count for operations who want
to skip redo log in the file space in order
to make fsp_space_modify_check pass.
Uses my_atomic_loadlint() and friends. */
/** reference count for operations who want to skip redo log in the
file space in order to make fsp_space_modify_check pass. */
Atomic_counter<ulint> redo_skipped_count;
#endif
fil_type_t purpose;/*!< purpose */
UT_LIST_BASE_NODE_T(fil_node_t) chain;
@@ -677,7 +677,7 @@ mtr_t::x_lock_space(ulint space_id, const char* file, unsigned line)
ut_ad(get_log_mode() != MTR_LOG_NO_REDO
|| space->purpose == FIL_TYPE_TEMPORARY
|| space->purpose == FIL_TYPE_IMPORT
|| my_atomic_loadlint(&space->redo_skipped_count) > 0);
|| space->redo_skipped_count > 0);
}

ut_ad(space);

0 comments on commit de32e66

Please sign in to comment.