Commit 8bd5cf01 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.6 into 10.8

parents 1d1e0ab2 2ddfb838
......@@ -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;
......@@ -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;
......
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment