Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FieldDescription IDs are dependent on which fields are currently on the schema #2333

Closed
AndrewSisley opened this issue Feb 20, 2024 · 0 comments · Fixed by #2339
Closed

FieldDescription IDs are dependent on which fields are currently on the schema #2333

AndrewSisley opened this issue Feb 20, 2024 · 0 comments · Fixed by #2339
Assignees
Labels
area/schema Related to the schema system bug Something isn't working feature New feature or request
Milestone

Comments

@AndrewSisley
Copy link
Contributor

This creates problems for schema branching and field removal.

For example, if two different fields are added in different schema branches, they will have the same ID (as the number of other fields is the same). This means that data saved in documents on the two branches will share the same space/datastore-keys and do weird stuff.

WARNING: This cannot be solved simply by using a sequence for the IDs at the moment, as the ID field (local concept) is current held on the schema (global). The fact that other fields have been added on different schema branches (incrementing the sequence) must not impact the schema version ids (via the field id).

@AndrewSisley AndrewSisley added bug Something isn't working feature New feature or request area/schema Related to the schema system labels Feb 20, 2024
@AndrewSisley AndrewSisley self-assigned this Feb 22, 2024
@AndrewSisley AndrewSisley added this to the DefraDB v0.10 milestone Feb 22, 2024
AndrewSisley added a commit that referenced this issue Feb 28, 2024
## Relevant issue(s)

Resolves #2334

## Description

Moves field id off of schema and onto collection.

It is now a local property and does not need to be the same across
multiple nodes. The new `Fields` property on `CollectionDescription`
will be where other local field stuff is move too from the schema
(relation_name, descriptions, secondary relation fields).

This change is a prerequisite of allowing fields to be deleted and
schema branching (see
#2333 for more info on
that if currious)
AndrewSisley added a commit that referenced this issue Feb 28, 2024
## Relevant issue(s)

Resolves #2333

## Description

Generates field ids using a sequence instead of their index in the
array.

This is required for allowing field deletion and schema branching as
otherwise those two will alter the position and thus id of fields. For
example, previously if two schema branches were to add a new field each,
the new fields would share the same id and mess the datastore cache up
in interesting ways.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/schema Related to the schema system bug Something isn't working feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant