[ 
https://issues.apache.org/jira/browse/IGNITE-19912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17748453#comment-17748453
 ] 

Evgeny Stanilovsky edited comment on IGNITE-19912 at 7/28/23 7:54 AM:
----------------------------------------------------------------------

few comments:
1. GridH2Table.checkIndexPresence implementation has a problem - if index with 
equal name is meet 'Index already exist' will not occur in some circumstances 
(if check for already existing columns subset is triggered) it just return for 
now, without no further check:

{noformat}
            if (registredIdx != null)
                return registredIdx;
{noformat}

2. Attached test can`t reproduce such a problem, cause additional check is 
present in SchemaManager#createIndex  but GridH2Table.checkIndexPresence is 
still incorrect and i hope - need to be fixed. Probably only code change 
(without test) would be appropriate in such a case ? 

[~ivandasch] probably u can check it ? thanks !


was (Author: zstan):
few comments:
1. GridH2Table.checkIndexPresence implementation has a problem - if index with 
with equal name is meet 'Index already exist' will not occur in some 
circumstances (if check for already existing columns subset is triggered) it 
just return for now, without no further check:

{noformat}
            if (registredIdx != null)
                return registredIdx;
{noformat}

2. Attached test can`t reproduce such a problem, cause additional check is 
present in SchemaManager#createIndex  but GridH2Table.checkIndexPresence is 
still incorrect and i hope - need to be fixed. Probably only code change 
(without test) would be appropriate in such a case ? 

[~ivandasch] probably u can check it ? thanks !

> Duplicated index creation using SQL leads to node start-up failure
> ------------------------------------------------------------------
>
>                 Key: IGNITE-19912
>                 URL: https://issues.apache.org/jira/browse/IGNITE-19912
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.15
>            Reporter: Evgeny Stanilovsky
>            Priority: Major
>         Attachments: DuplicateIndexCreationTest.java
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> In case an index for the field is specified using QuerySqlFields(index=true) 
> annotation, it's possible to create multiple additional indices for the same 
> field using CREATE INDEX IF NOT EXISTS statement without explicit index name 
> specification. As a result, all indices that were created via SQL have the 
> same name, which leads to node failure on the next restart due to Index with 
> name 'person_name_asc_idx' already exists. exception.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to