GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Index creation hinders async record creation · Issue #310 · ArcadeData/arcadedb

Index creation hinders async record creation #310

New issue
Copy link
New issue
Copy link
Closed
Closed
Index creation hinders async record creation#310
Copy link
Assignees
lvca
Milestone
23.6.1

Description

@Jurgen-Aquilina
Jurgen-Aquilina
opened on Feb 2, 2022
Issue body actions

ArcadeDB Version: 22.1.3

JDK Version: Corretto 11

OS: Windows 10

Expected behavior

ArcadeDb should internally balance the creation of indexes with the record creation so that the create record calls are not lost. Alternatively, an exception should be thrown to alert the user that such operations are not supported.

Actual behavior

The index and vertex creation are executed without errors, but the edge creation fails since a subset of "Software" vertices are not created.

Steps to reproduce

To create the scenario and trigger an exception using edge creation:

for (i in 0..250000) {
        val vertex = database.newVertex("Tester")
        vertex.set("id", i.toString())

        database.async().createRecord(vertex) {}
    }

    database.schema.createTypeIndex(Schema.INDEX_TYPE.LSM_TREE, true, "Tester", "id")

    for (i in 0..250000) {
        val vertex = database.newVertex("Software")
        vertex.set("id", i.toString())

        database.async().createRecord(vertex) {}
    }

    database.schema.createTypeIndex(Schema.INDEX_TYPE.LSM_TREE, true, "Software", "id")

    database.async().waitCompletion()

    for (i in 0..250000) {
        database.async().newEdgeByKeys(
            "Tester",
            arrayOf("id"),
            arrayOf(i),
            "Software",
            arrayOf("id"),
            arrayOf(i),
            false,
            "testerOf",
            false,
            true,
            null
        )
    }

After running the above, running a SELECT query will show that the required "Software" vertex is indeed not present.

Temporary workaround: add database.async().waitCompletion() before index creation.

Activity

Next
  1. lvca commented on Feb 2, 2022

    @lvca
    lvca
    on Feb 2, 2022
    Member
    More actions

    This is interesting. Before reproducing it, it seems that the creation of the index (synchronous operation) doesn't index the concurrent insertion of records in the queue for asynchronous operations. I guess the problem is that the event trigger for indexing documents, vertices, and edges is installed when the index completes the creation, but it's not taking care of concurrent operations.

    Working on this asap.

  2. lvca
    added this to the 22.2.1 milestone on Feb 2, 2022
  3. lvca
    added
    bug
    on Feb 2, 2022
  4. lvca
    self-assigned this
    on Feb 2, 2022
  5. lvca commented on Feb 3, 2022

    @lvca
    lvca
    on Feb 3, 2022
    Member
    More actions

    I was able to reproduce it. The issue is trickier than I thought. The index is created in its own transaction, so new vertices created in parallel and in the different transaction(s) don't see the index until the transaction is completed.

  6. lvca
    modified the milestones: 22.2.1, 22.3.1 on Feb 23, 2022
  7. lvca
    modified the milestones: 22.6.1, 22.7.1 on Jun 8, 2022
  8. lvca
    modified the milestones: 22.8.1, 22.9.1 on Aug 2, 2022
  9. lvca
    modified the milestones: 22.9.1, 22.10.1 on Oct 3, 2022
  10. lvca
    modified the milestones: 22.10.1, 22.11.1 on Oct 24, 2022
  11. 4 remaining items

  12. lvca
    modified the milestones: 23.1.1, 23.1.2 on Jan 16, 2023
  13. lvca
    modified the milestones: 23.1.2, 23.2.1 on Feb 1, 2023
  14. lvca
    removed this from the 23.2.1 milestone on Mar 1, 2023
  15. lvca
    added this to the 23.6.1 milestone on Jun 13, 2023
  16. lvca
    added a commit that references this issue on Jun 13, 2023

    fix: index creation now requires no async tasks are running

    ddc8a2c
  17. lvca commented on Jun 13, 2023

    @lvca
    lvca
    on Jun 13, 2023
    Member
    More actions

    Fixing this issue with an exception in case there are running asynchronous tasks.

  18. lvca
    closed this as completedon Jun 13, 2023
  19. lvca
    added
    bug fixed
    on Jun 13, 2023
  20. sblommers commented on May 28, 2024

    @sblommers
    sblommers
    on May 28, 2024
    More actions

    I have this now when importing a OrientDB database with version 24.5.1 when it finishes and wants to create the indexes.

    ERROR:
    com.arcadedb.exception.CommandExecutionException: Error on importing database
    at com.arcadedb.query.sql.parser.ImportDatabaseStatement.executeSimple(ImportDatabaseStatement.java:73)
    at com.arcadedb.query.sql.executor.SingleOpExecutionPlan.executeInternal(SingleOpExecutionPlan.java:91)
    at com.arcadedb.query.sql.parser.SimpleExecStatement.execute(SimpleExecStatement.java:52)
    at com.arcadedb.query.sql.parser.Statement.execute(Statement.java:65)
    at com.arcadedb.query.sql.SQLQueryEngine.command(SQLQueryEngine.java:116)
    at com.arcadedb.database.LocalDatabase.command(LocalDatabase.java:1327)
    at com.arcadedb.console.Console.executeSQL(Console.java:602)
    at com.arcadedb.console.Console.execute(Console.java:273)
    at com.arcadedb.console.Console.parse(Console.java:742)
    at com.arcadedb.console.Console.interactiveMode(Console.java:131)
    at com.arcadedb.console.Console.execute(Console.java:185)
    at com.arcadedb.console.Console.main(Console.java:148)
    Caused by: com.arcadedb.integration.importer.ImportException: Error on parsing source 'file:///tmp/orientdb3.2.30export.gz (compressed=true size=2454688091)'
    at com.arcadedb.integration.importer.Importer.load(Importer.java:69)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at com.arcadedb.query.sql.parser.ImportDatabaseStatement.executeSimple(ImportDatabaseStatement.java:62)
    ... 11 more
    Caused by: com.arcadedb.integration.importer.ImportException: Error on importing OrientDB database
    at com.arcadedb.integration.importer.format.OrientDBImporterFormat.load(OrientDBImporterFormat.java:51)
    at com.arcadedb.integration.importer.Importer.loadFromSource(Importer.java:107)
    at com.arcadedb.integration.importer.Importer.load(Importer.java:54)
    ... 14 more
    Caused by: com.arcadedb.exception.NeedRetryException: Cannot create a new index while asynchronous tasks are running
    at com.arcadedb.schema.TypeIndexBuilder.create(TypeIndexBuilder.java:57)
    at com.arcadedb.schema.TypeIndexBuilder.create(TypeIndexBuilder.java:42)
    at com.arcadedb.schema.LocalSchema.getOrCreateTypeIndex(LocalSchema.java:567)
    at com.arcadedb.integration.importer.OrientDBImporter.createIndexes(OrientDBImporter.java:1037)
    at com.arcadedb.integration.importer.OrientDBImporter.run(OrientDBImporter.java:231)
    at com.arcadedb.integration.importer.format.OrientDBImporterFormat.load(OrientDBImporterFormat.java:48)
    ... 16 more

  21. mergify
    added a commit that references this issue on Mar 13, 2026

    chore(deps): bump https://github.com/macisamuele/language-formatters-…

    8c0899b
  22. tae898
    added 2 commits that reference this issue on Jun 28, 2026

    fix: index creation now requires no async tasks are running

    03bd3c5

    chore(deps): bump https://github.com/macisamuele/language-formatters-…

    2e3ca1e
  23. mergify
    added a commit that references this issue on Jul 5, 2026

    chore(deps): bump the github-actions group across 1 directory with 8 …

    8e60b05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lvca
    lvca

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    • 23.6.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.