Skip to content
Permalink
Browse files
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.
  • Loading branch information
dr-m committed Apr 29, 2019
1 parent e10b3fa commit 1b577e4
Showing 1 changed file with 13 additions and 6 deletions.
@@ -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;
}

0 comments on commit 1b577e4

Please sign in to comment.