8000 Document insertion with persistent index over array fails · Issue #14546 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Document insertion with persistent index over array fails #14546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
miguel-porto opened this issue Jul 25, 2021 · 4 comments
Closed

Document insertion with persistent index over array fails #14546

miguel-porto opened this issue Jul 25, 2021 · 4 comments
Milestone

Comments

@miguel-porto
Copy link

My Environment

  • ArangoDB Version: 3.7.13
  • Storage Engine: RocksDB
  • Deployment Mode: Single Server
  • Deployment Strategy: Manual Start
  • Configuration:
  • Infrastructure: own
  • Operating System: Ubuntu 20.04
  • Total RAM in your machine: 12Gb
  • Disks in use: SSD
  • Used Package: Ubuntu .deb

Component, Query & Data

Affected feature:
Insert document with persistent index in array

AQL query (if applicable):
Sequence of 3 queries:

INSERT {"occurrences":[{"uuid":"abcd"}]} INTO inventory

// remove value from 'occurrences' array:
FOR i IN inventory
    LET newo = (FOR o IN i.occurrences
        FILTER o.uuid != 'abcd'
        RETURN o)
    UPDATE i WITH {occurrences: newo} IN inventory

// insert document with same uuid
INSERT {"occurrences":[{"uuid":"abcd"}]} INTO inventory
// Fails!

Dataset:
I can send the debug package if needed, but it's irrelevant, it is easy to reproduce with a new database (see below)

Size of your Dataset on disk:
?

Steps to reproduce

  1. Create a database with one collection "inventory"
  2. Create a persistent index over "occurrences[*].uuid", unique and sparse
  3. Execute the three queries in sequence

Problem:
The re-insertion of the document with the same uuid that was used before, fails with error, although it has been removed
com.arangodb.ArangoDBException: Response: 404, Error: 1202 - NotFound: - in index uuid of type hash over 'occurrences[*].uuid'

Expected result:
The document should be inserted because the uuid value is no longer in use. It looks like the uuid value is not removed from the index, despite that it has been removed from the document.

@Simran-B
Copy link
Contributor

I was able to reproduce the problem and created an internal ticket BTS-548. Thank you @miguel-porto for reporting this!

@Simran-B Simran-B added this to the 3.7.15 milestone Sep 15, 2021
@Simran-B Simran-B added the 2 Fixed Resolution label Sep 15, 2021
@Simran-B
Copy link
Contributor

The problem is caused by an incorrect optimization that prevents the removal of the index entry. Will be fixed in:

@miguel-porto
Copy link
Author

Thank you @Simran-B for covering this issue! The description of the problem in the PR is unequivocal, that's it.

@miguel-porto
Copy link
Author

I confirm this is fixed in 3.7.15! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0