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 — Async executor silently discards records at parallel level > 1: 9,742 submitted, 2,436 stored, no error reported · Issue #7615 · ArcadeData/arcadedb

Async executor silently discards records at parallel level > 1: 9,742 submitted, 2,436 stored, no error reported #7615

New issue
Copy link
New issue
Copy link
Closed
#7625
Closed
Async executor silently discards records at parallel level > 1: 9,742 submitted, 2,436 stored, no error reported#7615
#7625
Copy link
Assignees
lvca
Labels
bugconcurrencyThreading / concurrency / MVCCengineCore engine: document/schema API
Milestone
26.10.1

Description

@tae898
tae898
opened on Sep 15, 2026
Issue body actions

Inserting records through DatabaseAsyncExecutor at a parallel level above 1 silently loses most of them. No error reaches the per-command AsyncResultsetCallback, nothing is logged, and waitCompletion() returns normally, so a bulk load reports success and the database holds a fraction of the rows.

Measured against the 26.9.1 jars from arcadedata/arcadedb:26.9.1, Temurin 21, Linux, 9,742 single-record INSERT commands with setCommitEvery(5000):

parallel=1    submitted=9742   stored=9742   lost=0      errors reported=0
parallel=4    submitted=9742   stored=2436   lost=7306   errors reported=0
parallel=16   submitted=9742   stored=4262   lost=5480   errors reported=0

The loss is not monotonic in the parallel level, which fits whole batches being rolled back at commitEvery rather than a per-record race.

Registering the executor-wide onError handler instead of the per-command callback does surface errors, all ConcurrentModificationException, but only one per rolled-back batch: in a larger run, 15 errors accompanied 73,367 lost rows. So the information that rows were discarded exists inside the executor and never reaches the caller who asked for them to be written.

#4368 fixed the missing rollback before a retry after a ConcurrentModificationException. This is the neighbouring failure: after that rollback the work is not restored and the per-command callback is not told.

GraphBatch, which dispatches its edge flush through the same executor, does NOT show this: 20,000 vertices and 40,000 edges land exactly, with and without parallel flush. So the defect appears to be in the plain command path rather than in everything the executor drives.

Expected: either every submitted record is stored, or the per-command error callback fires for each one that is not.

Reproduction

Compile against the jars in the release image and run with a parallel level as the argument:

javac -cp "$(ls /home/arcadedb/lib/*.jar | tr '\n' ':')" -d /tmp/cls AsyncSilentLossRepro.java
java -cp "$(ls /home/arcadedb/lib/*.jar | tr '\n' ':'):/tmp/cls" com.arcadedb.AsyncSilentLossRepro 4
package com.arcadedb;

import com.arcadedb.database.Database;
import com.arcadedb.database.DatabaseFactory;
import com.arcadedb.database.async.AsyncResultsetCallback;
import com.arcadedb.query.sql.executor.ResultSet;

import java.util.concurrent.atomic.AtomicInteger;

public class AsyncSilentLossRepro {
  public static void main(String[] args) {
    final int total = 9742;
    final int parallel = Integer.parseInt(args.length > 0 ? args[0] : "4");
    final AtomicInteger errors = new AtomicInteger();

    try (Database db = new DatabaseFactory("/tmp/async_loss_repro").create()) {
      db.command("sql", "CREATE VERTEX TYPE Movie");
      db.command("sql", "CREATE PROPERTY Movie.movieId INTEGER");
      db.command("sql", "CREATE INDEX ON Movie (movieId) UNIQUE");

      db.async().setParallelLevel(parallel);
      db.async().setCommitEvery(5000);

      final AsyncResultsetCallback cb = new AsyncResultsetCallback() {
        @Override public void onComplete(final ResultSet rs) { }
        @Override public void onError(final Exception e) { errors.incrementAndGet(); }
      };

      for (int i = 0; i < total; i++)
        db.async().command("sql", "INSERT INTO Movie SET movieId = " + i, cb);

      db.async().waitCompletion();

      final long stored = db.countType("Movie", false);
      System.out.printf("parallel=%d submitted=%d stored=%d lost=%d errors=%d%n",
          parallel, total, stored, total - stored, errors.get());
    }
  }
}

Activity

  1. github-actions
    added
    bug
    concurrencyThreading / concurrency / MVCC
    engineCore engine: document/schema API
    on Sep 15, 2026
  2. lvca
    added
    in progressThe team is actively working on this issue
    on Sep 15, 2026
  3. lvca
    self-assigned this
    on Sep 15, 2026
  4. lvca
    added this to the 26.10.1 milestone on Sep 15, 2026
  5. tae898
    added a commit that references this issue on Sep 15, 2026

    bulk writes: take every path off the async executor's SQL command sub…

    e2fd561
  6. tae898 commented on Sep 15, 2026

    @tae898
    tae898
    on Sep 15, 2026
    ContributorAuthor
    More actions

    Two refinements from scoping this on my side, both measured rather than inferred.

    The defect appears to be confined to the async SQL command path. Records submitted through createRecord land exactly at parallel level 4, in both the single and the parallel forms, as do columnar time-series appends, and GraphBatch is exact too: 20,000 vertices and 40,000 edges with and without parallel flush, although it dispatches its edge flush through the same executor. So whatever discards the work seems specific to command execution rather than to the executor as a whole.

    The amount lost varies between runs on identical input. Three runs of the same 9,742 inserts at parallel level 4 stored 2,436, 5,742, and 7,742. Level 1 is exact every time. That is consistent with whole batches being rolled back at commitEvery rather than with a fixed race window, and it means a caller cannot detect the problem by expecting a stable shortfall.

    Observed on arcadedb-engine 26.9.1 and 26.6.1.

  7. lvca
    added 6 commits that reference this issue on Sep 15, 2026

    fix(async): notify unreplayable tasks too when an unreplayable batch …

    19c0371

    fix(async): cover the two remaining sites that commit the shared batc…

    a5c9146

    fix(async): notify buffered commands when a sibling task throws uncau…

    60bc232

    fix(async): notify buffered siblings on an ordinary local command fai…

    5b9ba89

    polish(async): tighten test assertions and javadoc wording per review

    d9f1709

    fix(async): make the local-failure sibling notification unconditional

    947f745
  8. lvca
    closed this as completedin #7625on Sep 15, 2026
  9. lvca
    added a commit that references this issue on Sep 15, 2026

    Merge pull request #7625 from ArcadeData/fix/issue-7615-async-silent-…

    dc8289f
  10. lvca
    removed
    in progressThe team is actively working on this issue
    on Sep 15, 2026
  11. lvca commented on Sep 15, 2026

    @lvca
    lvca
    on Sep 15, 2026
    Member
    More actions

    Fixed in #7625.

    Root cause: when using db.async() with parallelLevel > 1, each worker thread batches commands and commits every commitEvery operations (ASYNC_TX_BATCH_SIZE). If that periodic commit hit a conflict with another worker writing the same pages, it failed silently: the commands in that batch had already reported success to their callback, but the commit never happened, so the data was gone with no error anywhere.

    Fix: a periodic commit conflict is now retried automatically (replaying the buffered commands, up to TX_RETRIES attempts) instead of being dropped. If a batch genuinely can't be committed after retrying, every command in it now gets its error callback invoked, so the failure is reported instead of silent.

    No API changes; existing code using db.async() behaves the same on success, and now correctly reports failure instead of losing data under concurrent load.


    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  12. tae898
    added 3 commits that reference this issue on Sep 15, 2026

    fix(async): retry a periodic batch-commit conflict instead of silentl…

    ff81e58

    Merge branch 'upstream-main'

    8c050aa

    bindings: ArcadeData#7615 is fixed upstream in ArcadeData#7625; the l…

    99b81dd
  13. tae898 commented on Sep 15, 2026

    @tae898
    tae898
    on Sep 15, 2026
    ContributorAuthor
    More actions

    Verified on 17c792e982, the 26.10.1-SNAPSHOT image published at 18:17Z on 2026-09-15 (it carries the #7625 merge dc8289ff22 plus #7626), on JDK 21.0.12 (eclipse-temurin 21-alpine), with the reproduction class from the issue: 9,742 INSERT commands through db.async().command(...) with commitEvery 5000 and an onError counter. Before is arcadedata/arcadedb:26.9.1, same class, same JDK, same data. Each parallel level ran three times on each engine, because the loss varied between runs.

    parallel level 26.9.1 stored (3 runs) 26.9.1 error callbacks 17c792e stored (3 runs) 17c792e error callbacks
    1 9742, 9742, 9742 0, 0, 0 9742, 9742, 9742 0, 0, 0
    4 2436, 2435, 2436 0, 0, 0 9742, 9742, 9742 0, 0, 0
    16 3044, 4871, 6089 0, 0, 0 9742, 9742, 9742 0, 0, 0

    Every record is stored at every level now, and nothing was reported through the error callback because nothing needed to be. The pass condition I used was exact storage or an error for every missing record; a silent shortfall of any size would have failed it, and there was none in nine runs.

    The reproductions from #7609 (the decimal literal one and the openCypher comparator one) and #7611 (the indexed lower bound one) still answer every row correctly on this build, so those fixes are intact after the async change.

    On the bindings side, the level-4 exactness test in my suite (test_async_executor_bulk_command_is_exact_at_parallel_four, the same 9,742 rows at parallel level 4 with an on_error collector, asserting the exact count and no error) was skipped with this issue number since it was filed. It is live now and passed three times in a row on this engine. The bindings suite is green on the same engine, 453 passed, 2 skipped, on the 26.10.1-SNAPSHOT jars carrying 17c792e982, and the CI matrix on the same wheel build is green.

    Thank you for the fast fix, and for turning a silent rollback into a retry with a reported failure behind it.

  14. lvca
    added a commit that references this issue on Sep 18, 2026

    Fix async durability signal, schema lock, batch replay and remote mes…

    31c0d49
  15. tae898
    added 3 commits that reference this issue on Sep 29, 2026

    docs sweep, bindings: every page checked against the source, stale ma…

    43cf37c

    test: the async exactness test says whether the lost batch was report…

    fe22abf

    tests: the parallel-four async test holds 'nothing lost without a rep…

    b1956b2
  16. lvca
    added a commit that references this issue on Oct 10, 2026

    fix(#9694): an insert turned away from a reserved page no longer open…

    48c9e28
  17. oc007us
    added a commit that references this issue on Oct 11, 2026

    fix(ArcadeData#9694): stop concurrent inserts into one bucket from co…

    843711b
  18. robfrank
    added 2 commits that reference this issue on Oct 21, 2026

    fix(#9694): stop concurrent inserts into one bucket from conflicting …

    fa8869a

    fix(#9694): an insert turned away from a reserved page no longer open…

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

Metadata

Metadata

Assignees

  • @lvca
    lvca

Labels

bugconcurrencyThreading / concurrency / MVCCengineCore engine: document/schema API

Type

No type

Projects

No projects

    Milestone

    • 26.10.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.