Threads stuck waiting for mutex on THD::release_resources

Description

Waiting on change buffer mutexes while global variables are locked by SHOW ENGINE INNODB STATUS:

 

 

Environment

None

AFFECTED CS IDs

CS0015214

Smart Checklist

Activity

Show:

Marcelo Altmann March 3, 2021 at 6:32 PM
Edited

I realized that I've never updated this ticket with the final analyzes:

This is based on core.schemadock535-phx2 core file:

  • threads on THD::release_resources wait on LOCK_status - t228 has it

  • thread 228 wait on srv_innodb_monitor_mutex - t 477 has it

  • thread 477 waits on ibuf_mutex - t 460 has it

  • thread 447 waits on x-latch to (0,4) insert buffer. Thread 432 has it

  • Thread 432 waits on x-latch to (0, 153290). Thread 488 has it

  • Thread 488 waits on x-latch to (0,140185). 

This page is marked as BUF_IO_WRITE. This waiting on a write to be completed on it.

Thread 22 is flushing dirty pages from flush_list ( buf_do_flush_list_batch ).

Thread 22 is waiting on page 0,140185 flush to be complete as part of its batch.

This batch has a size of 2, but has already completed 4 writes, which is wrong.

As we can see on pv $40->m_buf_pages->m_pages we have 4 pages to be flushed on this batch, however, batch_size is marked as 2. This means that someone was allowed to run set_batch_size ( https://github.com/percona/percona-server/blob/Percona-Server-8.0.21-12/storage/innobase/buf/buf0dblwr.cc#L726 ) while there was an ongoing batch.

 

This is a variant/duplicate of

Details

Assignee

Reporter

Time tracking

2w 3d 6h 17m logged36m remaining

Affects versions

Priority

Smart Checklist

Created January 25, 2021 at 9:09 PM
Updated March 6, 2024 at 10:44 AM