L5 + Task 7: rel_id_server for arc IDs; wire dictionary gen_servers#22
Merged
Conversation
Separate allocator prevents arc PKs from consuming graph-visible nref integers. 4 CT cases cover counter basics and DETS persistence. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Must start before graphdb_mgr because bootstrap calls expand_relationship which calls rel_id_server:get_id/0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Test suites that call graphdb_bootstrap:load(), graphdb_mgr:start_link(), or other initialization that allocates relationship row IDs must start rel_id_server first. Updated init_per_testcase/end_per_testcase in: - graphdb_attr_SUITE - graphdb_bootstrap_SUITE - graphdb_class_SUITE - graphdb_instance_SUITE - graphdb_language_SUITE - graphdb_mgr_SUITE Also updated two test assertions in graphdb_bootstrap_SUITE that relied on the old architecture where relationship IDs came from nref_server and had to be >= 100000. With separate rel_id_server, IDs now start at 1. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…elete bug
Both gen_servers init/terminate via start_dictionary/stop_dictionary and
forward CRUD calls to dictionary_imp. Also fixed a pre-existing bug in
dictionary_imp:delete/2 (passed {BinKey} tuple instead of BinKey binary
to ets:delete, causing delete to silently no-op). 14 CT tests added.
L5 and Task 7 marked RESOLVED in TASKS.md.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
david-w-t
commented
May 20, 2026
Relationship arcs are always written in directed pairs. A single get_id_pair/0 call now allocates both IDs atomically, replacing two sequential get_id/0 calls at every arc-write site across bootstrap, attr, class, instance, and language modules. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Addressed: added |
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
L5 — Relationship row ID namespace pollution fixed:
rel_id_server, a new DETS-backed gen_server, now owns all#relationship{id}primary key allocation. Previously, arc row PKs were allocated from the globalnref_server, consuming integers that could otherwise identify graph nodes.rel_id_serveris wired as the first child ofgraphdb_sup(beforegraphdb_mgr) so bootstrap can callget_id/0during startup. All 23 call sites across 5 files migrated fromnref_server:get_nref/0torel_id_server:get_id/0. All 6 CT suites updated to start/stoprel_id_serverin their test lifecycle. Bootstrap test assertions updated: nref floor is now>= 100002(was100078— 76 arc IDs no longer consume nref slots); relationship IDs are now unique positive integers starting at 1.Task 7 — Dictionary gen_servers wired:
dictionary_serverandterm_serverwere gen_server stubs. Both now delegate todictionary_impviastart_dictionary/stop_dictionaryininit/terminateand forward all CRUD calls (create,read,update,delete,all,size). Also fixed a pre-existing bug indictionary_imp:delete/2— it passed{list_to_binary(Key)}(a 1-element tuple) instead oflist_to_binary(Key)(a binary) as the ETS delete key, causingdeleteto silently no-op.Test counts: 212 CT + 103 EUnit = 315, all green (was 297 in PR #21).
Test plan
./rebar3 ct --dir apps/graphdb/test— 198 CT pass./rebar3 ct --dir apps/dictionary/test— 14 CT pass (7 per server)./rebar3 eunit --app=graphdb— 103 EUnit pass./rebar3 compile— zero warnings🤖 Generated with Claude Code