[MCOL-1094] mcsapi should have view/clear table lock features Created: 2017-12-11  Updated: 2023-10-26  Resolved: 2018-11-30

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.2

Type: New Feature Priority: Major
Reporter: Andrew Hutchings (Inactive) Assignee: Zdravelina Sokolovska (Inactive)
Resolution: Fixed Votes: 1
Labels: None

Attachments: Zip Archive javamcsapi_html.zip     PDF File javamcsapi_usage.pdf     Zip Archive libmcsapi_html.zip     PDF File libmcsapi_usage.pdf     Zip Archive pymcsapi_html.zip     PDF File pymcsapi_usage.pdf    
Issue Links:
Relates
relates to MCOL-1961 javamcsapi, pymcsapi known isTableLoc... Closed
relates to MCOL-1077 Two applications using Bulk Insert API Closed
Sprint: 2018-20

 Description   

You can't start a transaction when a table lock exists so there should be functionality to view and clear table locks, thereby rolling back transactions stuck due to crashes in applications using mcsapi.

Discussed in MCOL-1077



 Comments   
Comment by Jens Röwekamp (Inactive) [ 2018-11-16 ]

4 functions shall be implemented to view and clear table locks in ColumnStoreDriver

  • listTableLocks() , returns all current table locks in an array of [lockId, sessionId, database, table]
  • isTableLocked(std::string database, std::string table), returns true if the table is locked by another process and false if not
  • clearTableLock(uint16_t id), clears a table lock with the specific lock Id and rolls back the killed transaction
  • clearTableLock(std::string database, std::string table), clears a table lock for the specified database table combination and rolls back the killed transaction
Comment by Jens Röwekamp (Inactive) [ 2018-11-25 ]

Introducing 6 new functions to ColumnStoreDriver:

  • std::vector listTableLocks();
  • bool isTableLocked(const std::string & db, const std::string & table, TableLockInfo& rtn);
  • bool isTableLocked(const std::string & db, const std::string & table);
  • void clearTableLock(uint64_t lockId);
  • void clearTableLock(const std::string & db, const std::string & table);
  • void clearTableLock(TableLockInfo tbi);

Introducing a new datatype mcsapi::TableLockInfo to store table lock information.

mcsapi's introduced functions and data types ported to pymcsapi and javamcsapi

Introducing C++, Java, and Python tests for listTableLocks(), isTableLocked(), and clearTableLock()

Added new functions to documentation plus general documentation updates for javamcsapi and pymcsapi

Known limitations:

  • mcsapi's isTableLocked() function is affected by MCOL-1218 and only detects locks of tables that were existent when the ColumnStoreDriver was initialized
  • javamcsapi and pymcsapi don't yet have methods to access the dbroot array returned by TableLockInfo's getDbrootList()
  • javamcsapi and pymcsapi don't yet have methods to access the the creation time returned by TableLockInfo's getCreationTime()
  • pymcsapi's isTableLocked() function only returns bool but not also the additional TableLockInfo object mcsapi returns

Limitations addressed in MCOL-1961

For QA

  • run regression test suite on CentOS 7, Windows 10, and one Debian/Ubuntu
  • verify that the documentation is correct
Generated at Thu Feb 08 02:26:09 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.