Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

feat(Upsert): Upsert from within Raft loop #42

Merged
merged 16 commits into from
Apr 15, 2022
Merged

feat(Upsert): Upsert from within Raft loop #42

merged 16 commits into from
Apr 15, 2022

Conversation

manishrjain
Copy link
Contributor

@manishrjain manishrjain commented Apr 15, 2022

This PR adds the ability to query for and determine the UID for a node, based on its XIDs (external IDs) within the Raft loop. It does so by figuring out which predicates constitute the XID, and adding those in a new NewObjects struct within Mutations.

This would ensure that concurrent upserts do not end up creating duplicate nodes. Raft loop serializes all the writes. Whichever upsert comes first would create the node. The second upsert would then be able to query the created node and reuse it, without failing. This is a better mechanism than doing optimistic transactions which would have resulted in aborts.

This PR also consolidates a bunch of things into one:

  • Removes Posting.ValType.
  • Removes DirectedEdge.
  • Converts NQuad to Edge.
  • Removes message Value previously used by NQuad.

Essentially, it consolidates the type conversion and mutation structs, introduced in 2016, into simplified structures. Hence eliminating a lot of roundabout complexity gained over time.


This change is Reviewable

@manishrjain manishrjain merged commit 87b7384 into main Apr 15, 2022
@manishrjain manishrjain deleted the mrjn/upserts branch April 15, 2022 18:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant