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

fix: Allow newly added fields to sync via p2p #1226

Merged
merged 2 commits into from
Mar 27, 2023

Conversation

AndrewSisley
Copy link
Contributor

Relevant issue(s)

Resolves #1185

Description

Allows newly added fields to sync via P2P. Was a much much easier fix than I expected - problem was that field CRDT Type was not set, and no where in our codebase besides a single line in the P2P system actually cared or used it - the rest are just hardcoded to LWW_Register (#1225).

I dont want users to have to explicitly specify this, so it defaults to LWW_Register if not set.

This is not a breaking change in that the cids have only changed for new fields being added. It does mean that any databases who have added new fields in the few weeks since adding that feature have a broken database, but I dont think we need to worry about that (given current Defra usage).

@AndrewSisley AndrewSisley added bug Something isn't working area/schema Related to the schema system action/no-benchmark Skips the action that runs the benchmark. labels Mar 24, 2023
@AndrewSisley AndrewSisley added this to the DefraDB v0.5 milestone Mar 24, 2023
@AndrewSisley AndrewSisley requested a review from a team March 24, 2023 17:34
@AndrewSisley AndrewSisley self-assigned this Mar 24, 2023
@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Merging #1226 (17ae8c6) into develop (3c74bca) will decrease coverage by 0.15%.
The diff coverage is 100.00%.

❗ Current head 17ae8c6 differs from pull request most recent head 687b0e8. Consider uploading reports for the commit 687b0e8 to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1226      +/-   ##
===========================================
- Coverage    70.74%   70.60%   -0.15%     
===========================================
  Files          182      182              
  Lines        17133    17138       +5     
===========================================
- Hits         12121    12100      -21     
- Misses        4091     4109      +18     
- Partials       921      929       +8     
Impacted Files Coverage Δ
client/descriptions.go 89.18% <ø> (ø)
db/collection.go 68.70% <100.00%> (+0.20%) ⬆️

... and 7 files with indirect coverage changes

Copy link
Collaborator

@fredcarle fredcarle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for fixing this.

Copy link
Member

@jsimnz jsimnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AndrewSisley AndrewSisley force-pushed the sisley/fix/I1185-new-fields-p2p branch 3 times, most recently from 4497e3a to 17ae8c6 Compare March 27, 2023 18:16
@AndrewSisley AndrewSisley changed the title fix: Allow newly added fields to sync via P2P fix: Allow newly added fields to sync via p2p Mar 27, 2023
@AndrewSisley AndrewSisley changed the title fix: Allow newly added fields to sync via p2p fix: Allow newly added fields to sync via P2P Mar 27, 2023
@AndrewSisley AndrewSisley force-pushed the sisley/fix/I1185-new-fields-p2p branch 2 times, most recently from c0ab822 to 66bd567 Compare March 27, 2023 18:33
@AndrewSisley AndrewSisley changed the title fix: Allow newly added fields to sync via P2P fix: Allow newly added fields to sync via p2p Mar 27, 2023
Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ezpz

Oddly, everywhere in our codebase apart from a single line in the P2P code hardcodes field CRDT Type to LWW_Register, even if FieldDescription.Typ is readily available.
@AndrewSisley AndrewSisley force-pushed the sisley/fix/I1185-new-fields-p2p branch from 66bd567 to 687b0e8 Compare March 27, 2023 18:39
@AndrewSisley AndrewSisley merged commit 4966008 into develop Mar 27, 2023
@AndrewSisley AndrewSisley deleted the sisley/fix/I1185-new-fields-p2p branch March 27, 2023 18:50
shahzadlone pushed a commit that referenced this pull request Apr 13, 2023
* Document FieldDescription.Typ

* Default Field CRDT Type to LWW_Register

Oddly, everywhere in our codebase apart from a single line in the P2P code hardcodes field CRDT Type to LWW_Register, even if FieldDescription.Typ is readily available.
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
* Document FieldDescription.Typ

* Default Field CRDT Type to LWW_Register

Oddly, everywhere in our codebase apart from a single line in the P2P code hardcodes field CRDT Type to LWW_Register, even if FieldDescription.Typ is readily available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/schema Related to the schema system bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Values in newly created fields do not sync via P2P
4 participants