[MCOL-1108] After rollback() an active transaction is reported by mcsadmin shutdownSystem Created: 2017-12-13  Updated: 2023-10-26  Resolved: 2017-12-23

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

Type: Bug Priority: Minor
Reporter: Sasha V Assignee: David Thompson (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

Remote data streaming to MariaDB ColumnStore server


Issue Links:
Relates
relates to MCOL-1195 mcsapi BadUsage.AssertTableLock test ... Closed
relates to MCOL-1077 Two applications using Bulk Insert API Closed
Sprint: 2017-25

 Description   

On a node A, I build the basic_bulk_insert from mariadb-columnstore-api-columnstore-1.1.2 example. Node A has a file /usr/local/mariadb/columnstore/etc/Columnstore.xml from node B that runs MariaDB ColumnStore 1.1.2. The example successfully writes to the test.t1 table
(and the ColumnStore system reports no active transactions upon a shutdown).

I modifed the basic_bulk_insert.cpp by replacing the line
bulk->commit();
with
bulk->rollback();

After executing modified basic_bulk_insert, the MariaDB ColumnStore reports an active transaction upon a shutdown attempt:

mcsadmin shutdown y
shutdownsystem   Wed Dec 13 13:15:52 2017
 
This command stops the processing of applications on all Modules within the MariaDB ColumnStore System
 
   Checking for active transactions
 
   There are active transactions being processed
Your options are:
    Cancel    -- Cancel the shutdown request
    Wait      -- Wait for write operations to end and then shutdown
    Force     -- Force a shutdown
What would you like to do: [Cancel]:

There is no errors in /var/log/mariadb/columnstore/err.log. The output of the command

/usr/local/mariadb/columnstore/bin/dbrmctl status
OK.



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2017-12-13 ]

Excellent, easily reproduced, thanks for the report.

Comment by Andrew Hutchings (Inactive) [ 2017-12-15 ]

We weren't sending the DBRM ROLLEDBACK command to clear the transaction from DBRM upon rollback, this left an orphaned transaction when the lock was cleared. This patch adds the missing command and sends it at the appropriate time.

For QA: as description. Can't put a test in the API test suite for this because the only way to test for this state is using SessionManager::checkActiveTransaction which is used during shutdown/restart for ColumnStore.

Comment by David Thompson (Inactive) [ 2017-12-23 ]

Verified manually using python wrapper:

import pymcsapi
driver = pymcsapi.ColumnStoreDriver()
bulk = driver.createBulkInsert('test', 't2', 0,0)
bulk.setColumn(0, 99)
bulk.setColumn(1, 'TYZ')
bulk.rollback()

verified that both stopsystem and shutdownsystem report no open transactions after the rollback.

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