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

Prioritize task loading persistence requests #3217

Merged
merged 9 commits into from
Sep 9, 2022

Conversation

yycptt
Copy link
Member

@yycptt yycptt commented Aug 11, 2022

What changed?

  • Check inline comment

Why?

  • Check inline comment

How did you test it?

Potential risks

Is hotfix candidate?

  • Maybe

@yycptt yycptt requested a review from yiminc August 11, 2022 23:37
@yycptt yycptt marked this pull request as ready for review September 7, 2022 00:43
@yycptt yycptt requested a review from a team as a code owner September 7, 2022 00:43
@yycptt yycptt force-pushed the prioritize-task-loading branch from 51ba63a to b8ce0a6 Compare September 8, 2022 01:28
)

func NewPriorityRateLimiter(
namespaceMaxQPS PersistenceNamespaceMaxQps,
hostMaxQPS PersistenceMaxQps,
requestPriorityFn quotas.RequestPriorityFn,
Copy link
Member Author

Choose a reason for hiding this comment

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

Taking it as an input so the logic can be substitute if needed.

// dynamic config.
p.ConstructHistoryTaskAPI("GetHistoryTasks", tasks.CategoryTransfer): 2,
p.ConstructHistoryTaskAPI("GetHistoryTasks", tasks.CategoryTimer): 2,
p.ConstructHistoryTaskAPI("GetHistoryTasks", tasks.CategoryVisibility): 2,
Copy link
Member Author

@yycptt yycptt Sep 8, 2022

Choose a reason for hiding this comment

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

Excluded replication get history tasks from being prioritized.

// persistence metrics client. For now, it's only used by rate
// limit client, and we don't really care about the actual value
// returned, as long as they are different from each task category.
func ConstructHistoryTaskAPI(
Copy link
Member Author

Choose a reason for hiding this comment

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

persistence retry/metrics/ratelimit client should be moved to persistence/client package. Then this function doesn't have to be exported.

@@ -42,6 +42,10 @@ import (
"go.uber.org/fx"
)

const (
timerQueuePersistenceMaxRPSRatio = 0.3
Copy link
Member Author

Choose a reason for hiding this comment

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

the actual usage is much low than this, so it should be quite safe.

@yycptt yycptt requested a review from yiminc September 8, 2022 20:45
@yycptt yycptt merged commit 30bf250 into temporalio:master Sep 9, 2022
@yycptt yycptt deleted the prioritize-task-loading branch September 9, 2022 19:57
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