Schema sync label count query exhausts memory on large graphs when statistics are disabled
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- databases
Research direction
Start with the affected templates in packages/graph-explorer/src/connector/gremlin/fetchSchema/ and the fetchEdgeLabels and fetchVerticesSchema paths in index.ts. Reproduce the failure with g.E().groupCount().by(label) against a large Neptune graph with statistics disabled, then inspect the equivalent schema queries for the other supported query languages. Done means schema synchronization completes on large graphs without unbounded aggregation failures; the issue states that this work is internal and not accepting external contributions.
Written by the indexing model from the issue text.
Description
Description
Gremlin schema sync fetches edge labels and their counts with a single unbounded aggregation:
g.E().groupCount().by(label)
On a large graph this exhausts Neptune's memory and the whole schema sync fails, so the connection never becomes usable. This is worse than a Schema View problem, because nothing downstream of schema sync can run.
Measured on one Neptune 1.3.5.0 db.t3.medium with DFE enabled and statistics disabled:
| Graph size | Result |
|---|---|
| 57,538 edges | succeeds in about 1.2s, fully native per its explain plan |
| 1,057,538 edges | MemoryLimitExceededException in under 10s |
This code path only runs when the summary API is unavailable, which on Neptune means statistics are disabled. When the summary API works, fetchSchema takes the summary path and never issues this query. That narrows the blast radius considerably, and I have not checked how common the disabled case is in practice.
Two things I did not measure but expect to share the defect:
vertexLabelsTemplateisg.V().groupCount().by(label), the same shape, so a graph with a comparable number of vertices should fail the same way.- openCypher (
MATCH ()-[e]-() RETURN type(e) AS label, count(*) AS count) and SPARQL have equivalent unbounded count queries.
Affected files:
packages/graph-explorer/src/connector/gremlin/fetchSchema/edgeLabelsTemplate.tspackages/graph-explorer/src/connector/gremlin/fetchSchema/vertexLabelsTemplate.tspackages/graph-explorer/src/connector/gremlin/fetchSchema/index.ts(fetchEdgeLabels,fetchVerticesSchema)
Environment
- OS: N/A (server-side query failure)
- Browser: N/A
- Graph Explorer Version: 3.2.2, and this predates it
- Graph Database & Version: Amazon Neptune 1.3.5.0,
db.t3.medium, DFE enabled, cluster statistics disabled
Steps to Reproduce
- Use a Neptune cluster with statistics disabled, so the summary API returns
BadRequestException. - Load roughly 1M edges.
- Connect with Gremlin and synchronize the connection.
- Schema sync fails. Running
g.E().groupCount().by(label)directly returnsMemoryLimitExceededException.
Expected Behavior
Schema sync completes on a large graph whether or not statistics are enabled. The label and count discovery needs to be bounded, most likely by chunking per label rather than aggregating the whole edge store in one request.
Related Issues
Related: #2141 (found while investigating it; the fix there does not touch this query), #1677
[!IMPORTANT]
Internal only — this issue is maintained by the core team and is not accepting external contributions.
- Dominant language
- TypeScript
- Stars
- 481
- Forks
- 110
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 9
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/graph-explorer
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
aws/graph-explorer#2199 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
aws/graph-explorer#2196 · 2 comments ·
-
help wanted needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
aws/graph-explorer#2060 ·
-
help wanted reliability usability
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
aws/graph-explorer#1977 · 2 comments ·
-
documentation usability
Difficulty 2/5 1-2 days Newbie friendliness 68/100
aws/graph-explorer#1719 ·
All issues in aws/graph-explorer
Similar issues
-
comp/dashboard P3 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
NousResearch/hermes-agent#117722 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·