[MCOL-3280] fail cpimport leave autoincrement in wrong state Created: 2019-04-23  Updated: 2019-05-14  Resolved: 2019-04-24

Status: Closed
Project: MariaDB ColumnStore
Component/s: cpimport
Affects Version/s: 1.2.3
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: David Hill (Inactive) Assignee: David Hill (Inactive)
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

Reported by a customer

doing a cpimport that fails, do not rollback the autoincrement columns

Details in following Protected comments



 Comments   
Comment by David Hill (Inactive) [ 2019-04-24 ]

FROM CUSTOMER

For the first problem, I think the stored autoincrement is not going back to 0, but staying to whatever was reserved until the rollback get triggered by the error rows.

Ignore the second problem, it was a mixed of bad sorted input data and each PM reserving autoincrement blocks making them not contiguous. I came to the conclusion that importing that table to only PM1 should give me ordered autoincrement value and it did.

Patrice.

Comment by Andrew Hutchings (Inactive) [ 2019-04-24 ]

This is to be expected and this can happen with InnoDB too:

"With InnoDB, values can be reserved by a transaction; but if the transaction fails (for example, because of a ROLLBACK) the reserved value will be lost."

https://mariadb.com/kb/en/library/auto_increment/#missing-values

Other relational databases also observe this behaviour.

Comment by David Hill (Inactive) [ 2019-04-24 ]

FROM CUSTOMER

I am not sure I understand this correctly.

I am saying that no data has been imported because the cpimport failed, however the autoincrement value is not going back to its original value. You are saying it should be lost, so it should not stay at the reserved value, which is what i am reporting.

Comment by David Hill (Inactive) [ 2019-04-24 ]

FROM CUSTOMER

Ok i understand the wording now. lost as in 'not usable again'.

So in light of this, can I request a feature to support this syntax in columnstore :

create table t1(a int default (next value for s1),b int) engine=Columnstore;

as show in the sequence documentation :

Using Sequences in DEFAULT
MariaDB starting with 10.3.3

Starting from 10.3.3 you can use Sequences in DEFAULT

Comment by Andrew Hutchings (Inactive) [ 2019-04-24 ]

A separate feature request for this could be created but we would require several other things to be implemented first which will allow using MariaDB Server for all CSV imports instead of cpimport (which in-turn means accelerating and improving LOAD DATA INFILE). I would not expect us to be able to implement this prior to 10.5.

Generated at Thu Feb 08 02:41:33 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.