Repository navigation
Raise snapshot field cap to 64 and refuse over-cap at mutate - #217
Merged
Merged
Conversation
Default MEMNET_MAX_FIELDS is 64. Mutate and snapshot save share one effective-field count so a CREATE/SET/MERGE that could not save is refused with limit_exceeded|fields n/max and writes nothing. snapshot_unsaveable stays the fail-closed save backstop (MN-REQ-05.4). Co-authored-by: chouswei <chouswei@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Default
MEMNET_MAX_FIELDSis 64. Mutate and snapshot save share one effective-field count (declared SCHEMA fields + undeclared extras on any row of that tag + theidcolumn save appends). A CREATE / SET / MERGE that would exceed the cap refuses@ERR: limit_exceeded|fields n/maxand writes nothing. Anything mutate accepts at exactly 64 saves and reloads.snapshot_unsaveablestays the fail-closed save backstop. Snapshot load of a SCHEMA over 64 refuses the samefields n/maxcode.SysML first: MN-REQ-05.4 / MN-VER-05-S02, plus MN-REQ-01.9 text so save is never stricter than a mutate that succeeded.
Why
A live 0.19.23 session became
snapshot_unsaveablebecause GQL mutate stored undeclared extras with no field cap, then save counted the widened SCHEMA (declared + extras +id) againstmax_fields=32. A PRT tag at 38 fields could be written and not saved.Tests
tests/test_field_cap.py: 38-field PRT saves and reloads; mutate CREATE/SET/MERGE over 64 refuses and writes nothing; save helper identical at exactly 64; load of SCHEMA 65/64 refuseslimit_exceeded.pytest -o addopts='' -q -W ignore→ 591 passed, 1 skipped (agensgraph_live).Package identity is not bumped (Unreleased honesty
con 0.19.24).Investigation (no code)
On released 0.19.23,
export_pin_map/pin_mapis not a lossless copy of a session (bounded cue neighbourhood, defaultM=50/ depth 2, emptyqis outline). Node extras in that neighbourhood are emitted; leftoverread listdrops extras (SCHEMA columns only).import_sliceis same-serve and also bounded. After this cut, mutate andsession_loadkeep extras up to 64; over 64 mutate refuses and load of a SCHEMA over 64 refuses loudly.import_slicestill upserts outside MutateGate, so a slice over 64 can still hit the save backstop.