Skip to content

ContextConfiguration runs a SCOPE.SERVER setting's callback but not a SCOPE.DATABASE one, so MAX_PAGE_RAM / DATE_IMPLEMENTATION written per database are stored and never applied #7163

Closed

Description

@lvca

Follow-up to #7121, raised in review of PR #7161. Pre-existing, not a regression from that PR.

Summary

PR #7161 gave ContextConfiguration a hook that runs a declared setting's callback on every write path it owns (fromJSON, both setValue overloads), because a SCOPE.SERVER setting is authoritative in the server's overlay and the overlay never writes through to the GlobalConfiguration enum. That fixed arcadedb.server.logFormat.

The hook is deliberately scoped to SCOPE.SERVER. The same shape exists for the SCOPE.DATABASE settings whose callback does real work:

  • MAX_PAGE_RAM - clamps the configured heap fraction and logs a warning when it is out of range
  • DATE_IMPLEMENTATION / DATE_TIME_IMPLEMENTATION - convert a String class name to a Class via Class.forName. coerce() has no Class.class case, so it does not perform that conversion either

A value written into a per-database ContextConfiguration for one of these stores the raw, un-normalised value and never runs the callback: the same "stored but never applied" defect #7121 catalogued, one scope over.

Why it is not biting today

AlterDatabaseStatement special-cases DATE_IMPLEMENTATION/DATE_TIME_IMPLEMENTATION itself - it calls Class.forName and getSerializer().setDateImplementation(...) directly, bypassing the callback - so that path happens to work. That is the same per-call-site special-casing PR #7161 removed for the server settings, kept alive here by hand.

MAX_PAGE_RAM has no such special case, so ALTER DATABASE \arcadedb.maxPageRAM` ...` stores a value the clamp never sees.

Suggested fix

Widen GlobalConfiguration.applyContextValue() from scope == SCOPE.SERVER to any scope, then audit the three callbacks above for the contract that entry point already documents: a callback reached through the overlay must be a pure side effect and return its argument unchanged, with any normalisation moved into coerce(). For DATE_IMPLEMENTATION that means teaching coerce() the Class case, which would also let AlterDatabaseStatement drop its own special case and go through the same path as everything else.

Worth doing as one change rather than piecemeal: the value of the hook is that the next setting needing a side effect gets every channel by declaring a callback, and a scope-dependent hook only half delivers that.

Activity

  1. added this to the 26.10.1 milestone on Sep 4, 2026
  2. self-assigned this
    on Sep 4, 2026
  3. added
    engine
    in progress
    on Sep 4, 2026
  4. added 8 commits that reference this issue on Sep 8, 2026
  5. lvca commented on Sep 8, 2026

    @lvca
    MemberAuthor

    Fixed in 26.10.1 (PR #7276).

    A few settings do something when you set them, rather than just holding a value. Set per database with ALTER DATABASE, those were stored but never applied: arcadedb.maxPageRAM kept a page-cache size larger than the heap can take instead of being clamped down, and arcadedb.dateImplementation kept a raw class name that was never resolved.

    They are applied now, whichever way you set them. ALTER DATABASE also reports the value that actually took effect, which for an out-of-range maxPageRAM is the clamped one rather than the number you sent.

    One behaviour change: ALTER DATABASE now refuses a setting that is not database-scoped, naming the scope in the error. Server settings go through SET SERVER SETTING instead. Previously such a value was accepted and stored in the database configuration where nothing would ever read it back - and, with the fix above, a server-wide setting could have been changed from a database-level permission.


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

  6. removed
    in progress
    on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugengine

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions