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 #7615DescriptionInserting 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());
}
}
}Activitytae898 commented 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. lvca commented on Sep 15, 2026 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. tae898 commented 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. added a commit that references this issue on Oct 10, 2026fix(#9694): an insert turned away from a reserved page no longer open… added 2 commits that reference this issue on Oct 21, 2026fix(#9694): stop concurrent inserts into one bucket from conflicting … fix(#9694): an insert turned away from a reserved page no longer open…
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|