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

messaging: add new priority field #5967

Merged
merged 4 commits into from
Mar 27, 2020

Conversation

derekperkins
Copy link
Member

As discussed on Slack with @sougou, we decided to add a new required priority field. This PR adds the field to the tests and modifies the load query + index to order by priority and then time_next.

epoch remains as is, it just won't be used to prioritize. instead you can introduce a new priority column, and that will be used instead of epoch (both for the select query and in the cache)
https://vitess.slack.com/archives/C9EDPDJT1/p1584943246101100

@derekperkins
Copy link
Member Author

Things I considered while doing this:

  • Restricting the priority column to uint8: There's not a great reason to need more than 255 levels of priority. At the end of the day, individuals can do that themselves, and I just left it as an int64 in the Vitess code
  • Dealing with NULL values: I thought about using IFNULL(priority, 0) to deal with null values, but I didn't think that vstream would support that.

Copy link
Contributor

@sougou sougou left a comment

Choose a reason for hiding this comment

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

Nice work!

@sougou sougou merged commit 79210c6 into vitessio:master Mar 27, 2020
@derekperkins derekperkins deleted the messages-priority branch March 27, 2020 02:26
@derekperkins derekperkins mentioned this pull request Mar 27, 2020
12 tasks
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