Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: Running highly concurrent dump/restore tools could lead to the server terminating. Root cause was that there was a race condition when releasing MDLs which could lead invalid memory access. Specifically, MDL_context::release_lock() executed code that might lead to deletion of corresponding MDL_lock object first and then called MDL_ticket_store::remove() method which might have accessed MDL_lock::m_key key in the deleted object. The former happens really rarely, when we release the last ticket for this lock, so MDL_lock object becomes unused, and there are too many unused MDL_lock objects in the system, and the random search we use to choose objects to release picks up the specific MDL_lock object. While the latter happens any time when ticket store contains enough tickets so hash-based ticket map is employed. Solution: Move the call to MDL_ticket_store::remove() earlier in MDL_context::relase_lock() so that no access needs to be made to MDL_lock::key after it can become invalid. Only manual testing done, as it is very challenging to create a reliable test case which triggers this rare situation. Approved by: [email protected] Change-Id: I87475ffafd4e3f758c5695dbcf9c4e6dff5469b1
- Loading branch information