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

gRPC for cross DC traffic #4390

Conversation

vytautas-karpavicius
Copy link
Contributor

@vytautas-karpavicius vytautas-karpavicius commented Aug 19, 2021

What changed?

  • Updated DispatcherProvider interface to support creating dispatchers for gRPC. Updated dnsDispatcherProvider implementation to accordingly.
  • Client factory will instantiate either Thrift or GRPC client based on the given dispatcher. These clients are used for:
    • admin client: for cross dc replication
    • frontend client: for request forwarding
  • Updated config section within ClusterGroupMetadata to allow configuring cross DC transport. If not specified, it defaults to tchannel, as currently used.

Why?
To support gRPC for cross DC traffic.

How did you test it?
Integration tests for cross DC replication.

Potential risks
TChannel is still used by default, and gRPC is currently opt in to minimize risk.

Release notes
Updated CHANGELOG.md

Documentation Changes

@coveralls
Copy link

coveralls commented Aug 19, 2021

Pull Request Test Coverage Report for Build d8ad67ea-341e-456a-b9ad-fbfc39198112

  • 30 of 56 (53.57%) changed or added relevant lines in 5 files are covered.
  • 143 unchanged lines in 17 files lost coverage.
  • Overall coverage decreased (-0.07%) to 56.459%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/server/cadence/server.go 0 1 0.0%
client/clientBean.go 20 24 83.33%
client/clientfactory.go 0 21 0.0%
Files with Coverage Reduction New Missed Lines %
common/persistence/executionManager.go 2 75.75%
service/history/execution/mutable_state_builder.go 2 69.86%
service/history/queue/transfer_queue_processor.go 2 57.18%
service/matching/taskListManager.go 2 74.09%
common/persistence/nosql/nosqlplugin/cassandra/workflow.go 3 50.23%
common/persistence/serialization/parser.go 4 65.41%
common/persistence/serialization/thrift_decoder.go 4 59.6%
common/persistence/sql/sqlExecutionStore.go 5 61.55%
common/persistence/statsComputer.go 5 95.36%
common/task/fifoTaskScheduler.go 5 84.54%
Totals Coverage Status
Change from base Build 8a9b9734-71a9-45a9-9ae8-ea08eab4a4f7: -0.07%
Covered Lines: 78938
Relevant Lines: 139814

💛 - Coveralls

@vytautas-karpavicius vytautas-karpavicius changed the title Replication grpc gRPC for cross DC traffic Aug 23, 2021
@vytautas-karpavicius vytautas-karpavicius marked this pull request as ready for review August 23, 2021 14:38
@vytautas-karpavicius vytautas-karpavicius requested a review from a team August 23, 2021 14:39
@@ -65,9 +66,10 @@ type (
SetRemoteFrontendClient(cluster string, client frontend.Client)
}

// DispatcherProvider provides a diapatcher to a given address
// DispatcherProvider provides a dispatcher to a given address
DispatcherProvider interface {
Get(name string, address string) (*yarpc.Dispatcher, error)
Copy link
Member

Choose a reason for hiding this comment

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

Can you rename it to GetTchannel to make it explicit?

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, updated.

@@ -358,3 +374,8 @@ func (cf *rpcClientFactory) newFrontendGRPCClient(hostAddress string) (frontend.
apiv1.NewVisibilityAPIYARPCClient(config),
), nil
}

func isGRPCOutbound(config transport.ClientConfig) bool {
namer, ok := config.GetUnaryOutbound().(transport.Namer)
Copy link
Member

Choose a reason for hiding this comment

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

should we panic/log.fatal here if ok==false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unless old version of yarpc is used, this will not happen. But I guess explicit early panic is better. Updated.

@vytautas-karpavicius vytautas-karpavicius merged commit 59c8f0e into cadence-workflow:master Aug 25, 2021
@vytautas-karpavicius vytautas-karpavicius deleted the replication-grpc branch August 25, 2021 08:37
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.

3 participants