mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 21:42:35 +01:00
buf_flush_list() should return failure if one of the buffer pool
was skipped because another flush batch was active. This is to ensure that the when we return success then it is guaranteed that all pages up to the lsn_limit have been flushed to the disk.
This commit is contained in:
parent
e54c2e009d
commit
e77de87a11
1 changed files with 15 additions and 5 deletions
|
@ -1748,6 +1748,7 @@ buf_flush_list(
|
|||
{
|
||||
ulint i;
|
||||
ulint total_page_count = 0;
|
||||
ibool skipped = FALSE;
|
||||
|
||||
if (min_n != ULINT_MAX) {
|
||||
/* Ensure that flushing is spread evenly amongst the
|
||||
|
@ -1758,10 +1759,6 @@ buf_flush_list(
|
|||
/ srv_buf_pool_instances;
|
||||
}
|
||||
|
||||
/* We use buffer pool instance 0 to control start and end of
|
||||
flushing of the flush list since we always flush all instances
|
||||
at once in this case. */
|
||||
|
||||
/* Flush to lsn_limit in all buffer pool instances */
|
||||
for (i = 0; i < srv_buf_pool_instances; i++) {
|
||||
buf_pool_t* buf_pool;
|
||||
|
@ -1770,6 +1767,18 @@ buf_flush_list(
|
|||
buf_pool = buf_pool_from_array(i);
|
||||
|
||||
if (!buf_flush_start(buf_pool, BUF_FLUSH_LIST)) {
|
||||
/* We have two choices here. If lsn_limit was
|
||||
specified then skipping an instance of buffer
|
||||
pool means we cannot guarantee that all pages
|
||||
up to lsn_limit has been flushed. We can
|
||||
return right now with failure or we can try
|
||||
to flush remaining buffer pools up to the
|
||||
lsn_limit. We attempt to flush other buffer
|
||||
pools based on the assumption that it will
|
||||
help in the retry which will follow the
|
||||
failure. */
|
||||
skipped = TRUE;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1783,7 +1792,8 @@ buf_flush_list(
|
|||
total_page_count += page_count;
|
||||
}
|
||||
|
||||
return(total_page_count);
|
||||
return(lsn_limit != IB_ULONGLONG_MAX && skipped
|
||||
? ULINT_UNDEFINED : total_page_count);
|
||||
}
|
||||
|
||||
/******************************************************************//**
|
||||
|
|
Loading…
Reference in a new issue