[MDEV-18406] ALTER TABLE stage 2 reaches 131%, and never finishes from client side perspective Created: 2019-01-28  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Storage Engine - Aria
Affects Version/s: 10.3.12
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Thomas Graungaard Assignee: Michael Widenius
Resolution: Unresolved Votes: 0
Labels: Aria
Environment:

Windows 10 Pro x64


Attachments: File my.ini    

 Description   

Running

ALTER TABLE table_1 ENGINE=Aria;

on a table created with ENGINE=Aria to rebuild index, will sometimes (I estimate 1 in 4 times) quickly run past 100% on second stage when seeing it from the client perspective. Server side the query will finish just fine, but client-side it appears to be stuck.

Stage: 2 of 2 'þ' 131% of stage done

To better illustrate what happens a timeline:
00m00s Client "ALTER TABLE table_1 ENGINE=Aria;" - Stage 1 commences
00m30s "Stage: 2 of 2 'Repair with 2 threads' 34.9% of stage done"
01m00s "Stage: 2 of 2 'z' 131% of stage done" - client never moves on from here
03m00s Table/Index has been rebuild and server is idling.
03m10s Ctrl-c to kill current connection thread, and re-connect to server, to continue to next query.

Never experienced the issue on 10.3.11

Edit:
CREATE TABLE `table_1` (
`col1` binary(16) NOT NULL,
`col2` varchar(255) NOT NULL,
PRIMARY KEY (`col1`),
KEY `col2` (`col2`(8))
) ENGINE=Aria DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1 ROW_FORMAT=DYNAMIC TRANSACTIONAL=0

table_1 0 PRIMARY 1 col1 A 33762694 NULL NULL   BTREE    
table_1 1 col2 1 col2 A 16881347 8 NULL   BTREE    

CREATE TABLE `table_2` (
`col1` binary(8) NOT NULL,
`col2` varbinary(127) NOT NULL,
`col3` binary(8) NOT NULL,
UNIQUE KEY `col3` (`col3`),
KEY `col1` (`col1`)
) ENGINE=Aria DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1 ROW_FORMAT=DYNAMIC TRANSACTIONAL=0;

table_2 0 col3 1 col3 A 63221551 NULL NULL   BTREE    
table_2 1 col1 1 col1 A 63221551 NULL NULL   BTREE    

Happens on both of these tables



 Comments   
Comment by Elena Stepanova [ 2019-01-28 ]

Could you please paste the output of

SHOW CREATE TABLE table_1;
SHOW INDEX IN table_1;

and attach your cnf file(s)?
Thanks.

Comment by Thomas Graungaard [ 2019-01-29 ]

Updated description and attached my.ini

Comment by Thomas Graungaard [ 2019-02-08 ]

Work-around for this issue is to change number of repair threads in my.ini to the standard 1

aria_repair_threads=1

Generated at Thu Feb 08 08:43:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.