Skip to content

Commit

Permalink
Merge 10.6 into 10.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Apr 13, 2023
2 parents 1d1e0ab + 2ddfb83 commit 8bd5cf0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 11 additions & 2 deletions storage/innobase/fil/fil0fil.cc
Expand Up @@ -97,7 +97,13 @@ bool fil_space_t::try_to_close(bool print_info)
if (!node->is_open())
continue;

if (const auto n= space.set_closing())
/* Other thread is trying to do fil_delete_tablespace()
concurrently for the same tablespace. So ignore this
tablespace and try to close the other one */
const auto n= space.set_closing();
if (n & STOPPING)
continue;
if (n & (PENDING | NEEDS_FSYNC))
{
if (!print_info)
continue;
Expand Down Expand Up @@ -1370,7 +1376,10 @@ void fil_space_t::close_all()

for (ulint count= 10000; count--;)
{
if (!space.set_closing())
const auto n= space.set_closing();
if (n & STOPPING)
goto next;
if (!(n & (PENDING | NEEDS_FSYNC)))
{
node->close();
goto next;
Expand Down
3 changes: 1 addition & 2 deletions storage/innobase/include/fil0fil.h
Expand Up @@ -626,8 +626,7 @@ struct fil_space_t final
@return number of pending operations, possibly with NEEDS_FSYNC flag */
uint32_t set_closing()
{
return n_pending.fetch_or(CLOSING, std::memory_order_acquire) &
(PENDING | NEEDS_FSYNC);
return n_pending.fetch_or(CLOSING, std::memory_order_acquire);
}

public:
Expand Down

0 comments on commit 8bd5cf0

Please sign in to comment.