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 — Follow-up to #7119: LocalDocumentType.aliases is the sixth copy-on-write member, non-volatile and published by reference from the caller's set (plus name, and the sweep that keeps not happening) · Issue #7299 · ArcadeData/arcadedb

Follow-up to #7119: LocalDocumentType.aliases is the sixth copy-on-write member, non-volatile and published by reference from the caller's set (plus name, and the sweep that keeps not happening) #7299

New issue
Copy link
New issue
Copy link
Closed
#7355
Closed
Follow-up to #7119: LocalDocumentType.aliases is the sixth copy-on-write member, non-volatile and published by reference from the caller's set (plus name, and the sweep that keeps not happening)#7299
#7355
Copy link
Assignees
lvca
Labels
auditFindings from the 2026-07 engine deep auditbugconcurrencyThreading / concurrency / MVCCengineCore engine: document/schema API
Milestone
26.10.1

Description

@ruispereira
ruispereira
opened on Sep 9, 2026
Issue body actions

Summary

LocalDocumentType has now had three issues about the same pattern - #6678 made two fields volatile,
#7033 added buckets/bucketIds, #7119 added bucketSelectionStrategy - and each fix has addressed
only the member the issue named. The sweep #7119 asked for was not run, so a fourth pass finds a
fourth subset.

aliases is the sixth member, and it has a second problem at the same line: setAliases publishes
the caller's set by reference rather than the copy it already built.

Where (HEAD 9cc8bc6)

1. aliases - non-volatile, and published by reference.

engine/src/main/java/com/arcadedb/schema/LocalDocumentType.java:63:

private Set<String> aliases = Collections.emptySet();

Copy-on-write reassigned at :438 in setAliases, under the schema mutation path. Read lock-free at
:347 by instanceOf(String), which openCypher's Labels calls during query planning
(engine/.../query/opencypher/Labels.java:344, :355, :372, :390) holding no database lock. That
is the identical argument #6678 and #7033 were accepted on. Also reassigned by a runtime caller,
integration/.../JsonlImporterFormat.java:364.

The second problem: setAliases builds newAliases and then assigns this.aliases = aliases - the
parameter - rather than this.aliases = newAliases. So the caller retains a live reference to schema
state that a lock-free instanceOf is reading, and can mutate it after the call.

2. name - same shape.

LocalDocumentType.java:59:

protected String name;

Non-volatile, reassigned on rename at :247 with a rollback at :264, read lock-free by getName()
and by instanceOf at :344.

3. PartitionedBucketSelectionStrategy.type - a nit, but it is the field the #7119 reasoning rests on.

engine/.../bucketselectionstrategy/PartitionedBucketSelectionStrategy.java:77:

private LocalDocumentType type;

Non-volatile, dereferenced on the lock-free read path (getBucketIdByRecord :182,
getBucketIdByKeys :202). setType (:113-116) does the volatile write first
(super.setType(type)) and the plain write second, so the volatile write gives this.type no
happens-before edge on the rebind route the total fix was written for.

Practical impact here is low - the rebind stores the same non-null object, and first publication is
carried by the volatile bucketSelectionStrategy write. Included because #7119's closing reasoning
depends on this field ("whose type reference was still null"), so it is worth being right about.

Repro

Item 1 is the live one. An openCypher query planning against a type whose aliases were just set by a
concurrent ALTER TYPE or by a JSONL import can read a stale or torn aliases reference, so
instanceOf answers on the previous alias set. Same visibility argument as the three accepted issues
before it.

The publish-by-reference half needs no concurrency at all: a caller that keeps its set and mutates it
later is changing live schema state directly.

Suggested fix

Make aliases and name volatile, and change setAliases to publish newAliases rather than the
parameter.

The more useful fix, and the reason this is a fourth report: add the shared helper #7119 suggested,
so publishing a copy-on-write member of this class is one call that does the copy and the volatile
write together. Six fields have now been found one at a time; a seventh will be found the same way
otherwise. A test that reflects over the class's fields and asserts every non-final reference member
is volatile would close the series properly.

Scope / confidence

Confidence high on items 1 and 2, including the lock-free reader paths, which were traced to the
openCypher call sites. Item 3 is filed explicitly as a nit rather than a defect, with the reason it is
worth mentioning stated.

Activity

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

    Merge pull request #7355 from ArcadeData/issue-7299-7297-7290

    84bb30f
  6. lvca
    closed this as completedin #7355on Sep 9, 2026
  7. lvca commented on Sep 9, 2026

    @lvca
    lvca
    on Sep 9, 2026
    Member
    More actions

    Fixed in #7355, milestone 26.10.1.

    Both members are now published safely, and the series is closed rather than trimmed again:

    • name and aliases are volatile, so a query planning concurrently with an ALTER TYPE or a JSONL import sees the new value rather than an indefinitely stale one.
    • PartitionedBucketSelectionStrategy.type is volatile too. The nit was right: the volatile write in super.setType happens before the plain one, so it could not carry it.
    • A test now reflects over LocalDocumentType's fields and fails on any non-final, non-volatile member. A seventh field added without the keyword is caught in CI instead of in a fifth issue.

    One correction to the suggested fix. setAliases should not assign newAliases: that variable holds only the aliases not already on the type, computed for the duplicate-name check, so storing it would drop every alias the type already answered to. The real defect is publishing the caller's set by reference, and the fix for that is a defensive copy - Set.copyOf(aliases). It closes the same hole and, as a bonus, getAliases() no longer hands out a writable view of live schema state either.

    Thanks for pushing for the sweep rather than another single-field patch - that is what made this the last one.


    ❤️ 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.

  8. lvca
    removed
    in progressThe team is actively working on this issue
    on Sep 9, 2026
  9. oc007us
    added a commit that references this issue on Sep 10, 2026

    fix(ArcadeData#7290,ArcadeData#7297,ArcadeData#7299): pattern-order n…

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

Metadata

Metadata

Assignees

  • @lvca
    lvca

Labels

auditFindings from the 2026-07 engine deep auditbugconcurrencyThreading / 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 01402792 — 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.