[MDEV-10433] ALTER ONLINE TABLE reported as not supported for TokuDB table Created: 2016-07-25  Updated: 2022-09-12  Resolved: 2022-09-12

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.0
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: jocelyn fournier Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

Hi,

When I try to run an ALTER ONLINE TABLE my_table ADD KEY my_key (...) on a TokuDB table, it reports
ERROR 1845 (0A000): LOCK=NONE is not supported for this operation. Try LOCK=SHARED.

However, ONLINE is supported, and it's an online operation which is applied when the syntax
CREATE INDEX my_key ON my_table (...) is used if tokudb_create_index_online is ON, as described here : https://www.percona.com/doc/percona-server/5.7/tokudb/using_tokudb.html.

To repeat :

CREATE TABLE test (a INT) ENGINE=TokuDB;
ALTER ONLINE TABLE test ADD KEY my_index (a);
ERROR 1845 (0A000): LOCK=NONE is not supported for this operation. Try LOCK=SHARED.

It would be great to have a consistent behaviour in MariaDB.
(but I agree it should be fixed upstream instead)

Thanks and regards,
Jocelyn Fournier



 Comments   
Comment by Sergei Golubchik [ 2016-07-26 ]

It depends on how you define "online". As you can see from the error message, ONLINE means LOCK=NONE. Also, in the manual:

Alternatively you can use ALTER ONLINE TABLE to ensure that your ALTER TABLE does not block concurrent operations (takes no locks). It is equivalent to LOCK=NONE.

When TokuDB adds indexes, the table cannot be modified, it supports LOCK=SHARED, but not LOCK=NONE. So it's not always online. You can specify LOCK=SHARED as the error message suggests, then it'll work.

Comment by jocelyn fournier [ 2016-07-26 ]

Hi Sergei,

When I use CREATE INDEX on a TokuDB table, with tokudb_create_index_online=ON, the table can be modified while creating the index, it doesn't lock anything, and allows concurrent DML (verified when I had to add an index on a big table during more than 1h, and a lot of INSERT / UPDATE in parallel). So it seems to be ONLINE with LOCK=NONE.

Thanks,

Comment by Sergei Golubchik [ 2022-09-12 ]

10.0 was EOLed in March 2019

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