Skip to content

Commit c857259

Browse files
committed
Merge 10.6 into 10.10
2 parents a49ebf7 + bf7c6fc commit c857259

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();
@@ -1388,10 +1394,17 @@ dberr_t srv_start(bool create_new_db)
13881394
end of create_log_file(). */
13891395
ut_d(recv_no_log_write = true);
13901396
ut_ad(!os_aio_pending_reads());
1391-
ut_ad(!os_aio_pending_writes());
13921397
ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex));
13931398
ut_ad(!buf_pool.get_oldest_modification(0));
13941399
ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex));
1400+
/* os_aio_pending_writes() may hold here if
1401+
some write_io_callback() did not release the
1402+
slot yet. However, the page write itself must
1403+
have completed, because the buf_pool.flush_list
1404+
is empty. In debug builds, we wait for this to
1405+
happen, hoping to get a hung process if this
1406+
assumption does not hold. */
1407+
ut_d(os_aio_wait_until_no_pending_writes(false));
13951408

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

0 commit comments

Comments
 (0)