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

Add a domain cluster filter during replication #4069

Merged
merged 1 commit into from
Mar 26, 2021
Merged

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Mar 23, 2021

What changed?
Add a domain cluster filter during replication

Why?
Save one DB call to fetch workflow history in replication

How did you test it?
Unit tests

Potential risks
N/A

@coveralls
Copy link

coveralls commented Mar 23, 2021

Pull Request Test Coverage Report for Build aa4a66e4-8655-4a62-be0b-fd31c3e1a40c

  • 10 of 13 (76.92%) changed or added relevant lines in 1 file are covered.
  • 101 unchanged lines in 16 files lost coverage.
  • Overall coverage decreased (-0.07%) to 66.814%

Changes Missing Coverage Covered Lines Changed/Added Lines %
service/history/replication/task_ack_manager.go 10 13 76.92%
Files with Coverage Reduction New Missed Lines %
common/persistence/sql/sqlExecutionManager.go 1 57.07%
client/history/client.go 2 44.78%
client/history/metricClient.go 2 49.43%
common/persistence/executionStore.go 2 74.15%
common/task/weightedRoundRobinTaskScheduler.go 2 89.12%
service/history/handler.go 2 46.59%
common/task/fifoTaskScheduler.go 4 85.57%
common/types/mapper/thrift/history.go 4 60.87%
service/frontend/workflowHandler.go 4 55.55%
service/history/queue/timer_queue_processor_base.go 4 78.83%
Totals Coverage Status
Change from base Build 443a8179-bbff-4403-a249-c44ccc0cd7cf: -0.07%
Covered Lines: 83555
Relevant Lines: 125057

💛 - Coveralls

@@ -155,14 +156,23 @@ func (t *taskAckManagerImpl) GetTasks(
readLevel := lastReadTaskID
TaskInfoLoop:
for _, taskInfo := range taskInfoList {
// filter task info by domain clusters.
domainEntity, err := t.shard.GetDomainCache().GetDomainByID(taskInfo.GetDomainID())
Copy link
Contributor

Choose a reason for hiding this comment

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

do we assume here the domain from the db is always in the cache?

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. Domains are always in cache

@@ -614,6 +624,15 @@ func (t *taskAckManagerImpl) generateHistoryReplicationTask(
)
}

func skipTask(pollingCluster string, domainEntity *cache.DomainCacheEntry) bool {
for _, cluster := range domainEntity.GetReplicationConfig().Clusters {
Copy link
Contributor

Choose a reason for hiding this comment

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

idem

@github-actions github-actions bot force-pushed the replication_filter branch 2 times, most recently from 09148e9 to 4afae88 Compare March 24, 2021 21:38
@yux0 yux0 merged commit ec3d1b5 into master Mar 26, 2021
@yux0 yux0 deleted the replication_filter branch March 26, 2021 19:07
yux0 added a commit to yux0/cadence that referenced this pull request May 4, 2021
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