Skip to content

-1 record version prevents index updates #7518

@andrii0lomakin

Description

@andrii0lomakin

OrientDB Version: 2.2

Steps to reproduce

  1. Create class "C" with field "f" and create a unique index for that field.
  2. Create a record of class "C" with a field "f" value equals to "v1" and store it.
  3. Load record created at step 1, set record version to -1 and update value of field "f" to "v2" and store it.
  4. Create a record of class "C" with a field "f" value equals to "v2" and store it.

Expected behavior

The exception that indicates that uniqueness constraints are violated should be thrown.

Actual behavior

The record is inserted in the database, and uniqueness constraint is violated.

Despite feeling that this case is super rare, some of the third-party drivers for remote storage incorrectly send -1 as record version. As a result, we have duplicates in the database. In general uniqueness constraints should be bullet proof and should not be violated in such simple way.

Metadata

Metadata

Labels

buglegacy not used anymore

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions