-
Notifications
You must be signed in to change notification settings - Fork 758
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
Add cluster ID to clock #2871
Add cluster ID to clock #2871
Conversation
@@ -59,6 +59,8 @@ type ( | |||
IsGlobalNamespaceEnabled() bool | |||
// IsMasterCluster whether current cluster is master cluster | |||
IsMasterCluster() bool | |||
// GetClusterID return the cluster ID, which is also the initial failover version | |||
GetClusterID() int64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think UUID is overkill. Initial failover should be good.
@@ -59,6 +59,8 @@ type ( | |||
IsGlobalNamespaceEnabled() bool | |||
// IsMasterCluster whether current cluster is master cluster | |||
IsMasterCluster() bool | |||
// GetClusterID return the cluster ID, which is also the initial failover version | |||
GetClusterID() int64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think UUID is overkill. Initial failover should be good.
service/history/vclock/vclock.go
Outdated
) (int, error) { | ||
if clock1.GetId() != clock2.GetId() { | ||
if clock1.GetClusterId() != clock2.GetClusterId() || clock1.GetShardId() != clock2.GetShardId() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to differentiate those two cases? ShardID not equal is unexpected, while clusterID not equal is expected in some cases (due to auto-forwarding).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, actually even without the cluster ID, clocks generated by different cluster cannot be compared
* Add cluster ID to clock
What changed?
Why?
Business logic can tell the difference (clock generated by cluster a vs cluster b)
How did you test it?
Existing tests
Potential risks
N/A
Is hotfix candidate?
N/A