Skip to content

Preconditions#2

Merged
jzelinskie merged 2 commits intomainfrom
preconditions
Sep 17, 2021
Merged

Preconditions#2
jzelinskie merged 2 commits intomainfrom
preconditions

Conversation

@jakedt
Copy link
Copy Markdown
Member

@jakedt jakedt commented Sep 17, 2021

No description provided.

Signed-off-by: Jake Moshenko <[email protected]>
Signed-off-by: Jake Moshenko <[email protected]>
Comment on lines +133 to +139
enum Operation {
OPERATION_UNSPECIFIED = 0;
OPERATION_MUST_NOT_MATCH = 1;
OPERATION_MUST_MATCH = 2;
}

Operation operation = 1;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not convinced that the operation is necessary.
When would "must not match" be used? The precondition is basically supposed to be used to enable writes to function with compare-and-swap semantics, which only ever requires "must match" logic.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Joey's example of when you'd want "must not match": the first migration being ran for a system -- you'd want to assert that no relationships with any values for a migration would exist.

@jzelinskie jzelinskie merged commit 9a58995 into main Sep 17, 2021
@jzelinskie jzelinskie deleted the preconditions branch September 17, 2021 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants