[MDEV-31781] ALTER TABLE ENGINE=s3 fails Created: 2023-07-26  Updated: 2023-08-16  Resolved: 2023-08-16

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Storage Engine - S3
Affects Version/s: N/A
Fix Version/s: 11.2.1

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Nikita Malyavin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-16329 Engine-independent online ALTER TABLE Closed
Relates
relates to MDEV-28808 Test MDEV-16329 (ALTER ONLINE TABLE) ... Stalled

 Description   

Notes:
The easiest way to run tests with S3 locally is to use MinIO. You can find the tips in the description of MDEV-31031, or follow steps of mtr-s3 tests from buildbot logs (which should be more or less the same). Alternatively, you can try to use the instruction from the KB, but it's possible that it's no longer applicable if the currently available MinIO version changed too much. The buildbot uses an old MinIO release.

Once you have started MinIO, you can put the testcase under suite/s3 and run it normally as ./mtr s3.testname.

--source include/have_s3.inc
--source include/have_debug_sync.inc
 
drop table if exists t;
create table t (a int) engine=Aria;
insert into t values (1),(2);
 
--send set debug_sync= 'now wait_for go_dml'
 
--connect (con1,localhost,root,,)
set debug_sync= 'alter_table_online_progress signal go_dml wait_for go_alter';
--send alter table t engine=S3
 
--connection default
--reap
update t set a = 11 where a = 1;
set debug_sync= 'now signal go_alter';
 
--connection con1
--reap
select * from t;
show create table t;
 
# Cleanup
--disconnect con1
--connection default
drop table t;
set debug_sync= reset;

bb-11.2-oalter 23ae9f1b2c69abc454484410a7ac3959cead0605

At line 20: query 'reap' failed: ER_OPEN_AS_READONLY (1036): Table 't' is read only

This error normally happens upon DML on a table which is already S3.
If we follow the logic that concurrent online alter should work as if ALTER was executed after DML, then we shouldn't have the error, since DML is executed on the table while it's still Aria, and then Aria table is converted into S3 – both are permitted operations.



 Comments   
Comment by Nikita Malyavin [ 2023-07-28 ]

Yes, s3 can't support Online

Comment by Sergei Golubchik [ 2023-08-04 ]

as discussed, please, use a table flag. No need to ask for a review for this change

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