Commit 1b577e4d authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-19356 Assertion 'space->free_limit == 0 || space->free_limit == free_limit'

fil_node_t::read_page0(): Do not replace up-to-date metadata with a
possibly old version of page 0 that is being reread from the file.
A more up-to-date page 0 could still exists in the buffer pool,
waiting to be written back to the file.
parent e10b3fa9
......@@ -579,13 +579,9 @@ bool fil_node_t::read_page0(bool first)
return false;
}
ut_ad(space->free_limit == 0 || space->free_limit == free_limit);
ut_ad(space->free_len == 0 || space->free_len == free_len);
space->size_in_header = size;
space->free_limit = free_limit;
space->free_len = free_len;
if (first) {
ut_ad(space->id != TRX_SYS_SPACE);
/* Truncate the size to a multiple of extent size. */
ulint mask = psize * FSP_EXTENT_SIZE - 1;
......@@ -598,8 +594,19 @@ bool fil_node_t::read_page0(bool first)
this->size = ulint(size_bytes / psize);
space->size += this->size;
} else if (space->id != TRX_SYS_SPACE || space->size_in_header) {
/* If this is not the first-time open, do nothing.
For the system tablespace, we always get invoked as
first=false, so we detect the true first-time-open based
on size_in_header and proceed to initiailze the data. */
return true;
}
ut_ad(space->free_limit == 0 || space->free_limit == free_limit);
ut_ad(space->free_len == 0 || space->free_len == free_len);
space->size_in_header = size;
space->free_limit = free_limit;
space->free_len = free_len;
return true;
}
......
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