Skip to content

Edge indexes become invalid in certain scenario #2 #3097

Description

@ruslan-butyk-fntext

ArcadeDB version: 25.12.1
Steps to reproduce: execute next chunks of SQL commands in separate transactions:

  • transaction №1
CREATE VERTEX TYPE duct;
CREATE VERTEX TYPE trs;
CREATE PROPERTY duct.id STRING;
CREATE INDEX ON duct (id) UNIQUE;
CREATE PROPERTY trs.id STRING;
CREATE INDEX ON trs (id) UNIQUE;
CREATE EDGE TYPE trs_duct;
CREATE PROPERTY trs_duct.from_id STRING;
CREATE INDEX ON trs_duct (from_id) NOTUNIQUE;
CREATE PROPERTY trs_duct.to_id STRING;
CREATE INDEX ON trs_duct (to_id) NOTUNIQUE;
CREATE PROPERTY trs_duct.swap STRING;
CREATE PROPERTY trs_duct.order_number INTEGER;
CREATE INDEX ON trs_duct (from_id,to_id,swap,order_number) UNIQUE;
  • transaction №2
INSERT INTO duct (id) VALUES ('duct_1');
INSERT INTO trs (id) VALUES ('trs_1');
CREATE EDGE trs_duct from #4:0 to #1:0 SET from_id='trs_1', to_id='duct_1', swap='N', order_number=1;
  • transaction №3
DELETE FROM trs_duct WHERE (from_id='trs_1') AND (to_id='duct_1') AND (swap='N') AND (order_number=1);
CREATE EDGE trs_duct from #4:0 to #1:0 SET from_id='trs_1', to_id='duct_1', swap='N', order_number=1;

After that execute the previous transaction again

  • transaction №4
DELETE FROM trs_duct WHERE (from_id='trs_1') AND (to_id='duct_1') AND (swap='N') AND (order_number=1);
CREATE EDGE trs_duct from #4:0 to #1:0 SET from_id='trs_1', to_id='duct_1', swap='N', order_number=1;

you will get DuplicatedKeyException.

Expected behavior:
After executing transaction №4 there should be no DuplicatedKeyException error.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions