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

Read cluster shard count from DB #3788

Merged
merged 2 commits into from
Jan 12, 2023
Merged

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Jan 9, 2023

What changed?
Read cluster shard count from DB

Why?
Read cluster shard count from DB and use in cluster cache.

How did you test it?
Unit tests

Potential risks

Is hotfix candidate?

@yux0 yux0 requested review from meiliang86 and wxing1292 January 9, 2023 17:59
@yux0 yux0 requested a review from a team as a code owner January 9, 2023 17:59
@@ -733,10 +733,16 @@ func loadClusterInformationFromStore(ctx context.Context, config *config.Config,
return err
}
metadata := item.(*persistence.GetClusterMetadataResponse)
shardCount := metadata.HistoryShardCount
if shardCount == 0 {
// This is to add backward compatibility to the config based cluster connection.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I understand correct this only applies to ancient versions of Temporal Server?

Copy link
Contributor

Choose a reason for hiding this comment

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

Recent versions should always have this stored in DB?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. If the clusters are using tctl to connect, then it should have the shard count. If the clusters connection is the legacy config-base, the shard count could be 0. We don't want to support the config base connection so I just assume the clusters shard count must be equal if they are using config base connection.

@yux0 yux0 merged commit bd06826 into temporalio:master Jan 12, 2023
@yux0 yux0 deleted the cluster-shard-count branch January 12, 2023 04:43
yux0 added a commit that referenced this pull request Jan 12, 2023
yux0 added a commit that referenced this pull request Jan 13, 2023
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.

4 participants