2

When I try to run 'Create Table' sql on infiniDB, I get the following error:

"Error Code: 122 IDB-2010: Unable to perform DDL/DML because session 26 is currently updating another table."

The Create Table sql is nothing out of the ordinary, it's something like this:

CREATE TABLE table_name
(
 col_1 smallint,
 col_2 bigint,
 create_date datetime
) ENGINE = InfiniDB DEFAULT CHARSET=utf8;

Why is this error occuring?

Marina
  • 3,222
  • 5
  • 25
  • 35

1 Answers1

2

This happens because InfiniDB is using a table locking model (at least for import jobs), so only a single modification can run on a table at a time.

In your case, there may be a job currently running or one that has crashed. This can cappen if i.e. cpimport segfaults. anyway, check the lock status with the command:

root@big1:~# /usr/local/Calpont/bin/viewtablelock 
 There is 1 table lock

  Table                       LockID  Process   PID    Session   Txn  CreationTime              State    DBRoots    
  mydb.stats_test             4673    cpimport  20855  BulkLoad  n/a  Wed Feb 18 11:48:04 2015  LOADING  1,2,3,4,5 

if you are sure this process is not running anymore, you can kill and clean it up:

/usr/local/Calpont/bin/cleartablelock 4673
bhelm
  • 695
  • 1
  • 7
  • 14