[MDEV-10569] Add RELEASE_ALL_LOCKS function Created: 2016-08-17  Updated: 2020-03-13  Resolved: 2020-02-27

Status: Closed
Project: MariaDB Server
Component/s: Locking
Fix Version/s: 10.5.2

Type: Task Priority: Major
Reporter: Yuriy Yevtukhov Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Relates
relates to MDEV-21828 Document RELEASE_ALL_LOCKS Closed

 Description   

After adding support for obtaining multiple named locks through GET_LOCK() in 10.0.2 it is logical to implement RELEASE_ALL_LOCKS(). In MySQL it was done in one release (5.7.5).

Common task in backend web applications after getting fatal runtime error (SQL or not) is to cancel current transaction and/or unlock tables (if locks are ever used) to be able to process next request and then return some error to customer.

If somebody uses named locks (e.g. to implement row locking on non-transactional table), then all such locks must be released in case of fatal error too. Earlier, when only single named lock was allowed, one could just make arbitrary GET_LOCK() - RELEASE_LOCK() calls. With multiple locks allowed such task requires programmer to remember all currently obtained locks and release them explicitely.

So, named locks subsystem is incomplete without RELEASE_ALL_LOCKS function.



 Comments   
Comment by Dan Solodko [ 2019-12-27 ]

I think I'll commit this function very soon

Comment by Eimantas [ 2020-01-21 ]

Looking into possibility migrate from MySQL to MariaDB, and one of issues is this ONE.

Until there is no solution for RELEASE_ALL_LOCKS
is it possible to make GET_LOCK() work old style (single lock per connection)?

Generated at Thu Feb 08 07:43:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.