-
Notifications
You must be signed in to change notification settings - Fork 825
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
TaskQueue Schema Collapse #500
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Rename NumShards to TaskShardPartitions
alexshtin
reviewed
Jul 7, 2020
samarabbas
reviewed
Jul 9, 2020
samarabbas
reviewed
Jul 9, 2020
samarabbas
reviewed
Jul 9, 2020
samarabbas
reviewed
Jul 9, 2020
samarabbas
reviewed
Jul 9, 2020
samarabbas
reviewed
Jul 9, 2020
samarabbas
reviewed
Jul 16, 2020
- Move away from singular select
samarabbas
reviewed
Jul 17, 2020
samarabbas
reviewed
Jul 17, 2020
samarabbas
approved these changes
Jul 17, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks much better now. Great work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TaskQueue previously had a schema that was keyed as
(shard_id, namespace_id, name, task_type)
. This structure has changed to(range_hash, task_queue_id)
NumShards
was previously hardcoded at the config level and could never be changed as the raw hash that was computed would be modulus'd by this value before storing it in the DB as shard_id.shard_id
becomesrange_hash
and it is no longer modulus'd by the NumShards value, but rather the raw hash (range from 0 to MaxUint32) is stored.NumShards
toTaskScanPartitions
This option only affects reads now; controls the minimum number of pages in a ListTaskQueue query to ensure sequentially reading from shards in sharded SQL databases where a large number of TaskQueue pages exist. If this value is set to 4, then there are 4 select queries done using sequential contiguous blocks of ShardIds.
namespace_id, name, task_type
is combined into a single database columntask_queue_id
to provide a simpler (and correct) paging experience.This was tested with local unit testing and manual test cases as well as using this Buildkite PR step to validate.
Note: This fixes previously broken ListTaskList/ListTaskQueue functionality in SQL based databases when results exceed the specified page size.
Future Todos: