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

Update ShardID to start with 1 instead of 0 #633

Merged
merged 10 commits into from
Jul 31, 2020

Conversation

samarabbas
Copy link
Contributor

What changed?
This change forces ShardID to start with 1 instead of 0 for
implementation to validate if ShardID is not passed in where
it is a required field.

Why?
ShardID is passed in as a field for multiple protobuf messages. We
have created a guideline to not use 0 as a valid value for protobuf
field in a message.
Previously we used 0 as a valid ShardID which makes it impossible to
differentiate between ShardID field as not set versus caller
specifically passing in 0.

How did you test it?
Unit and Integration tests

Potential risks
This could potential cause issues with shard unavailability

ShardID is passed in as a field for multiple protobuf messages.  We
have created a guideline to not use 0 as a valid value for protobuf
field in a message.
Previously we used 0 as a valid ShardID which makes it impossible to
differentiate between ShardID field as not set versus caller
specifically passing in 0.
This change forces ShardID to start with 1 instead of 0 for
implementation to validate if ShardID is not passed in where
it is a required field.
@samarabbas samarabbas merged commit ced7304 into temporalio:master Jul 31, 2020
@samarabbas samarabbas deleted the shard-id-to-start-from-1 branch July 31, 2020 01:22
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