[MDEV-11329] MariaRocks: rocksdb.add_index_inplace fails Created: 2016-11-21  Updated: 2016-12-04  Resolved: 2016-12-04

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - RocksDB
Affects Version/s: 10.2
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
PartOf
is part of MDEV-9658 Make MyRocks in MariaDB stable Closed

 Description   

rocksdb.add_index_inplace                [ fail ]
        Test ended at 2016-11-21 17:30:48
 
CURRENT_TEST: rocksdb.add_index_inplace
mysqltest: At line 163: query 'ALTER TABLE t1 ADD INDEX kij(i,j), ALGORITHM=INPLACE' failed: 1845: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY



 Comments   
Comment by Sergei Petrunia [ 2016-11-21 ]

The table being altered is partitioned:

CREATE TABLE t1 (i INT, j INT, k INT, PRIMARY KEY (i), KEY(j)) ENGINE = ROCKSDB PARTITION BY KEY(i) PARTITIONS 4;
...
ALTER TABLE t1 ADD INDEX kij(i,j), ALGORITHM=INPLACE;

Comment by Sergei Petrunia [ 2016-11-21 ]

The difference starts in ha_rocksdb::check_if_supported_inplace_alter(). ha_alter_info->handler_flags value is different.

fb/mysql-5.6 has value 1 which is

  // Add non-unique, non-primary index
  static const HA_ALTER_FLAGS ADD_INDEX                  = 1L << 0;

MariaDB has $108 = 0x80000001 which is

  // Add non-unique, non-primary index
  static const HA_ALTER_FLAGS ADD_INDEX                  = 1L << 0;
 ...
  /**
    ALTER TABLE for a partitioned table. The engine needs to commit
    online alter of all partitions atomically (using group_commit_ctx)
  */
  static const HA_ALTER_FLAGS ALTER_PARTITIONED          = 1L << 31;

fb/mysql-5.6 doesn't have ALTER_PARTITIONED defined (neither do mysql-5.6, nor mysql-5.7)

Comment by Sergei Petrunia [ 2016-11-21 ]

Relevant commits:

https://github.com/MariaDB/server/commit/97728e107a5262266a2f6ed61bae9639a1717831
https://github.com/MariaDB/server/commit/99027efd14f9f3a66dcc32d6313a4c4ed71bffe8
https://github.com/MariaDB/server/commit/9927b36e87652c6dc4ff2425e86570d678bac224

Comment by Sergei Petrunia [ 2016-12-04 ]

Fixed in work tree

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