Skip to content

Commit f833ef5

Browse files
committed
Merge 10.10 into 10.11
2 parents 2ecc044 + c857259 commit f833ef5

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

extra/mariabackup/xtrabackup.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2396,10 +2396,15 @@ static bool innodb_init()
23962396
buf_flush_sync();
23972397
recv_sys.debug_free();
23982398
ut_ad(!os_aio_pending_reads());
2399-
ut_ad(!os_aio_pending_writes());
24002399
ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex));
24012400
ut_ad(!buf_pool.get_oldest_modification(0));
24022401
ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex));
2402+
/* os_aio_pending_writes() may hold here if some write_io_callback()
2403+
did not release the slot yet. However, the page write itself must
2404+
have completed, because the buf_pool.flush_list is empty. In debug
2405+
builds, we wait for this to happen, hoping to get a hung process if
2406+
this assumption does not hold. */
2407+
ut_d(os_aio_wait_until_no_pending_writes(false));
24032408
log_sys.close_file();
24042409

24052410
if (xtrabackup_incremental)

storage/innobase/fil/fil0fil.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2804,6 +2804,7 @@ void IORequest::write_complete(int io_error) const
28042804
ut_ad(fil_validate_skip());
28052805
ut_ad(node);
28062806
ut_ad(is_write());
2807+
node->complete_write();
28072808

28082809
if (!bpage)
28092810
{
@@ -2816,7 +2817,6 @@ void IORequest::write_complete(int io_error) const
28162817
else
28172818
buf_page_write_complete(*this, io_error);
28182819

2819-
node->complete_write();
28202820
node->space->release();
28212821
}
28222822

storage/innobase/srv/srv0start.cc

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,16 @@ static dberr_t create_log_file(bool create_new_db, lsn_t lsn)
183183
delete_log_files();
184184

185185
ut_ad(!os_aio_pending_reads());
186-
ut_ad(!os_aio_pending_writes());
187186
ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex));
188187
ut_ad(!buf_pool.get_oldest_modification(0));
189188
ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex));
189+
/* os_aio_pending_writes() may hold here if some
190+
write_io_callback() did not release the slot yet. However,
191+
the page write itself must have completed, because the
192+
buf_pool.flush_list is empty. In debug builds, we wait for
193+
this to happen, hoping to get a hung process if this
194+
assumption does not hold. */
195+
ut_d(os_aio_wait_until_no_pending_writes(false));
190196

191197
log_sys.latch.wr_lock(SRW_LOCK_CALL);
192198
log_sys.set_capacity();
@@ -1629,10 +1635,17 @@ dberr_t srv_start(bool create_new_db)
16291635
end of create_log_file(). */
16301636
ut_d(recv_no_log_write = true);
16311637
ut_ad(!os_aio_pending_reads());
1632-
ut_ad(!os_aio_pending_writes());
16331638
ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex));
16341639
ut_ad(!buf_pool.get_oldest_modification(0));
16351640
ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex));
1641+
/* os_aio_pending_writes() may hold here if
1642+
some write_io_callback() did not release the
1643+
slot yet. However, the page write itself must
1644+
have completed, because the buf_pool.flush_list
1645+
is empty. In debug builds, we wait for this to
1646+
happen, hoping to get a hung process if this
1647+
assumption does not hold. */
1648+
ut_d(os_aio_wait_until_no_pending_writes(false));
16361649

16371650
/* Close the redo log file, so that we can replace it */
16381651
log_sys.close_file();

0 commit comments

Comments
 (0)