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

Make event cache size based #3294

Merged
merged 32 commits into from
Jun 1, 2020
Merged

Conversation

mkolodezny
Copy link
Contributor

@mkolodezny mkolodezny commented May 29, 2020

What changed?
Make event cache size based

Why?
events part of #2350

How did you test it?
performance tests

Potential risks
history events related API latency

@coveralls
Copy link

coveralls commented May 29, 2020

Coverage Status

Coverage decreased (-0.07%) to 68.007% when pulling 3373a0e on mkolodezny:cache_size into f8c0e93 on uber:master.

Copy link
Contributor

@meiliang86 meiliang86 left a comment

Choose a reason for hiding this comment

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

LGTM overall. Some minor comments.

common/cache/lru.go Outdated Show resolved Hide resolved
@@ -131,14 +136,28 @@ func New(maxSize int, opts *Options) Cache {
opts = &Options{}
}

return &lru{
cache := &lru{
Copy link
Contributor

Choose a reason for hiding this comment

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

To me, size and count is either/or, meaning that if it's size based, we don't care about the count, as long as it stays within size limit.

Copy link
Contributor Author

@mkolodezny mkolodezny Jun 1, 2020

Choose a reason for hiding this comment

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

Agree, if maxSize is provided then it is size based only and count based otherwise. And if size based, lets still check for an upper limit for count to prevent the infinite growing, for safety sake.

common/cache/lru.go Outdated Show resolved Hide resolved
common/service/dynamicconfig/constants.go Outdated Show resolved Hide resolved
common/service/dynamicconfig/constants.go Outdated Show resolved Hide resolved
service/history/config/config.go Outdated Show resolved Hide resolved
service/history/events/cache.go Outdated Show resolved Hide resolved
common/util.go Outdated Show resolved Hide resolved
common/util.go Outdated Show resolved Hide resolved
service/history/events/cache.go Outdated Show resolved Hide resolved
common/cache/cache.go Outdated Show resolved Hide resolved
common/util.go Outdated Show resolved Hide resolved
common/util.go Outdated Show resolved Hide resolved
service/history/resource/resource.go Outdated Show resolved Hide resolved
service/history/config/config.go Outdated Show resolved Hide resolved
@mkolodezny mkolodezny marked this pull request as ready for review June 1, 2020 22:55
@mkolodezny mkolodezny merged commit 526a96d into cadence-workflow:master Jun 1, 2020
@mkolodezny mkolodezny deleted the cache_size branch July 27, 2020 19:05
emrahs pushed a commit that referenced this pull request Aug 18, 2020
* Make event cache size based
yux0 pushed 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
7 participants