Bug #58653 | Sporadic crash due to assertion failure 0 == space->n_pending_flushes | ||
---|---|---|---|
Submitted: | 2 Dec 2010 11:02 | Modified: | 12 Jan 2011 22:46 |
Reporter: | Alexander Nozdrin | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S1 (Critical) |
Version: | 5.1-plugin, 5.5.8 | OS: | Any |
Assigned to: | Sunny Bains | CPU Architecture: | Any |
Tags: | pb2, sporadic, test failure |
[2 Dec 2010 11:02]
Alexander Nozdrin
[2 Dec 2010 11:07]
Alexander Nozdrin
It's not clear if this is a regression or not: the crash hasn't been seen before, but it's sporadic and happened only once on one particular platform.
[2 Dec 2010 11:30]
Vasil Dimov
backtrace of all threads
Attachment: bt.txt (text/plain), 12.90 KiB.
[7 Dec 2010 3:19]
Sunny Bains
One thing I can confirm is that it was not introduced by the fix for bug# 54538. This looks like a bug that has always existed, at least as far back as 5.0 and probably all versions prior to that. InnoDB just didn't free the space memory in fil_close_all_files() in versions prior to the plugin. In the plugin we introduced code that frees all the memory during shutdown and there is an assertion in that code that has highlighted the race condition. It is surprising that we haven't hit this before. We release the fil_system->mutex in fil_flush() and then call os_file_flush(). It is possible for another thread to call fil_close_all_files() during that flush. fil_close_all_files() will then free all the spaces. This particular path is only possible during the shutdown phase.
[7 Dec 2010 9:04]
Sunny Bains
Scratch the previous analysis. This is related to bug# 54617. While trying to reproduce this bug I was able to reproduce bug# 54617. The underlying issue is the same. I stalled the master thread by calling os_thread_wait() in GDB just before it reserved the mutex to increment srv_n_threads_active[]. If we stall the master thread before it reserves a slot and if in the meantime a shutdown is triggered then the shutdown code can't detect that the master thread is active because srv_n_threads_active has not been incremented at that stage by the master thread. It shouldn't really affect production systems because there we don't have such quick start/shutdown scenario.
[8 Jan 2011 15:08]
Bugs System
Pushed into mysql-trunk 5.6.2 (revid:vasil.dimov@oracle.com-20110108150732-8qygun7nuaqf9d3u) (version source revid:vasil.dimov@oracle.com-20110108150646-44c9j7ck64ocey31) (merge vers: 5.6.2) (pib:24)
[8 Jan 2011 15:09]
Bugs System
Pushed into mysql-5.5 5.5.9 (revid:vasil.dimov@oracle.com-20110108150508-gpanhz48z8069qot) (version source revid:vasil.dimov@oracle.com-20110108150048-b1y9m8xe72hay0ch) (merge vers: 5.5.9) (pib:24)