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

Concurrent shard loading #2888

Merged
merged 1 commit into from
Dec 6, 2019
Merged

Concurrent shard loading #2888

merged 1 commit into from
Dec 6, 2019

Conversation

vitarb
Copy link
Contributor

@vitarb vitarb commented Dec 5, 2019

This change introduces ability to acquire shards concurrently.
Although underlying shardController's operations like get/remove engine are synchronized there should still be noticeable speed up due to the increased parallelism.

Note that default value for the concurrent number of goroutines is 1 meaning that it would use one thread for loading (e.g. no change from the pervious behavior).
Users would need to change history.acquireShardConcurrency property in the dynamic config in order to use higher number of goroutines.

We may consider changing this default in future once the change is tested.

@coveralls
Copy link

coveralls commented Dec 5, 2019

Coverage Status

Coverage decreased (-0.05%) to 67.737% when pulling 77a3d9a on vitarb:concurrent-shard-loading into a76b957 on uber:master.

service/history/shardController.go Outdated Show resolved Hide resolved
service/history/shardController.go Outdated Show resolved Hide resolved
service/history/shardController.go Outdated Show resolved Hide resolved
service/history/shardController.go Outdated Show resolved Hide resolved
service/history/shardController.go Outdated Show resolved Hide resolved
Copy link
Contributor

@venkat1109 venkat1109 left a comment

Choose a reason for hiding this comment

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

LGTM. Just left one comment on channel size.

service/history/shardController.go Outdated Show resolved Hide resolved
service/history/shardController.go Outdated Show resolved Hide resolved
- added a test for concurrent shard loading
- refactored code to use worker pool instead of channel.
- added comments
- set size of wg and shardActionCh to concurrency instead of number of shards
- spawning workers early before writing data to the channel
@vitarb vitarb merged commit b972d8d into uber:master Dec 6, 2019
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