apache / apache/age

Cannot retrieve sequence name and sequence id for a label

Open
#338 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
4.8k
Forks
523
Avg merge
1d 2h
Merged PRs (30d)
9

Description

Every time a new label is created (by executing `Oid create_label(args)` in "label_commands.c"), a sequence name (referred to as `seq_name`) is generated, but it is not later stored in the table ag_catalog.ag_label (by calling `Oid insert_label(args)`) making it inaccessible. To retrieve the sequence counter, the sequence name or sequence id is necessary. Since the value returned by the sequence counter is utilized to generate unique object ids, we are unable to internally create new vertices or edges without access to the sequence counter.

Though we can add new edges and vertices without a sequence counter, doing so would be incorrect. For instance, let's internally create a new vertex with entry_id=1 (entry id is used to generate unique ids; `graphid make_graphid(const int32 label_id, const int64 entry_id);`). As the sequence counter is also initially set to 1, it will produce the same object id as before ('entry_id = nextval(seq_name)') if a user wishes to build a new vertex with the create cypher command. Therefore, having two vertices with identical ids would lead to a significant bug.

I propose storing the sequence name and id in the ag catalog.ag_label and ag_cache. It would be useful for agload and graph generation tasks where we must internally build vertices and edges.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.