summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-12-12 09:58:31 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-12-12 09:58:54 +0530
commit18c335a39e0ca15a6490e4b00a041072bcd1c70e (patch)
tree86ec19704a77cbe4e42307df0a98e7b208da3cbb
parentbe5990d0c8563d1b2e70cb7d453ecef0a842bb5d (diff)
downloadmariadb-git-18c335a39e0ca15a6490e4b00a041072bcd1c70e.tar.gz
MDEV-27111 atomic.rename_table test case fails
InnoDB fails to identify the deferred tablespace after recovery. Problem is that InnoDB fails to rename the tablespace present in recovered tablespace. Fix is that InnoDB should try to rename the recovered tablespace when tablespace is being deferred
-rw-r--r--storage/innobase/log/log0recv.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 5066cec437f..b23b48022d7 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -659,7 +659,14 @@ static struct
return;
}
else if (d->second.lsn < lsn)
+ {
+ /* Reset the old tablespace name in recovered spaces list */
+ recv_spaces_t::iterator it{recv_spaces.find(d->first)};
+ if (it != recv_spaces.end() &&
+ it->second.name == d->second.file_name)
+ it->second.name = "";
defers.erase(d++);
+ }
else
{
ut_ad(d->second.lsn != lsn);
@@ -673,6 +680,10 @@ static struct
p.first->second.lsn= lsn;
p.first->second.file_name= defer.file_name;
}
+ /* Add the newly added defered space and change the file name */
+ recv_spaces_t::iterator it{recv_spaces.find(space)};
+ if (it != recv_spaces.end())
+ it->second.name = defer.file_name;
}
void remove(uint32_t space)
@@ -911,6 +922,7 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
}
node->deferred= false;
space->release();
+ it->second.space= space;
return false;
}