Skip to content

Conversation

@samarabbas
Copy link
Contributor

What changed?
EmptyVersion has the value 0 and this means Version is not set.

Make sure all math around Version computation does not treat 0 as
valid value.

Why?
As part of converting everything to protobuf we are treating default value for integer fields to
represent value is not set. Which means Version value of 0 means it is unspecified and should
not represent a valid value in the system.

How did you test it?
unit and integration test

Potential risks

EmptyVersion has the value 0 and this means Version is not set.

Make sure all math around Version computation does not treat 0 as
valid value.
@samarabbas samarabbas requested a review from alexshtin July 30, 2020 23:41
EmptyEventID int64 = -23
// EmptyVersion is used as the default value for failover version when no value is provided
EmptyVersion int64 = -24
EmptyVersion int64 = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@samarabbas samarabbas merged commit 59629e2 into temporalio:master Jul 31, 2020
@samarabbas samarabbas deleted the empty-version-to-zero branch July 31, 2020 06:20
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