[MCOL-2093] cleartablelock is allowed during mcsapi transaction but it breaks with what(): Error rolling back BRM and cannot be restarted Created: 2019-01-18  Updated: 2023-10-26  Resolved: 2023-03-06

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

Type: Bug Priority: Major
Reporter: Zdravelina Sokolovska (Inactive) Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Environment:

single server


Epic Link: Consolidate & Redevelop All Columnstore Tools (SDK, Adapters, Backup, Restore, mcsimport)
Epic/Theme: MCOL-4571

 Description   

cleartablelock is allowed during mcsapi transaction but it breaks with what(): Error rolling back BRM and cannot be restarted

note: the same is not observed with cpimport as cleartablelock is rejected during cpimport activities with error" Rollback error: Unable to grab lock; Lock not found or still in use.Table lock xxx for table xx.yy is not cleared."

/usr/local/mariadb/columnstore/tools/mcsimport/mcsimport mytest lineitem  tests/tests_2019-01-17--16-44-30_LOAD_DATA_IN_FILE/features/cpimportLineitem/lineitem.tbl  -c Columnstore.xml -d "|"

from CS Module

[root@pm1 ~]# /usr/local/mariadb/columnstore/bin/viewtablelock
 There is 1 table lock
 
  Table            LockID  Process  PID    Session  Txn   CreationTime              State    DBRoots
  mytest.lineitem  51      mcsapi   11786  73608    7599  Fri Jan 18 15:57:28 2019  LOADING  1
[root@pm1 ~]# /usr/local/mariadb/columnstore/bin/cleartablelock  51
Rolling back and clearing table lock for table mytest.lineitem; table lock 51
 
Sending rollback request to PM1...
Successful rollback response from PM1
Sending cleanup request to PM1...
Successful cleanup response from PM1
 
Table lock 51 for table mytest.lineitem is cleared.
[root@pm1 ~]#

/usr/local/mariadb/columnstore/tools/mcsimport/mcsimport mytest lineitem  tests/tests_2019-01-17--16-44-30_LOAD_DATA_IN_FILE/features/cpimportLineitem/lineitem.tbl  -c Columnstore.xml -d "|"
Error during mcsapi bulk operation:  Failed to read from a compressed data file.
terminate called after throwing an instance of 'mcsapi::ColumnStoreServerError'
  what():  Error rolling back BRM
Aborted




 Comments   
Comment by Jens Röwekamp (Inactive) [ 2019-01-28 ]

If I understand your process correctly, you
1) started mcsimport
2) then while mcsimport is still running use cleartablelock to clear the table lock of the running mcsimport process
3) encounter the error in mcsimport "what(): Error rolling back BRM"

This probably happens as the bulk insert fails in mcsimport, (due to the cleared lock), but during the deconstruction of mcsapi's ColumnStoreBulkInsert a second cleartablelock is executed, which couldn't succeed as the changes were already rolled back.

Comment by Andrew Hutchings (Inactive) [ 2019-01-28 ]

I would go as far as to say this is expected behaviour. Maybe the error is not too clear but that would require an architecture change to fix. You rolled back a transaction that is currently executing and the API gets confused when it suddenly realises it has gone away.

Comment by Todd Stoffel (Inactive) [ 2023-03-06 ]

This ticket was created prior to convergence with the server and may be obsolete. If you find this issue still exists in a modern version, please open a new ticket.

Generated at Thu Feb 08 02:33:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.