-
Notifications
You must be signed in to change notification settings - Fork 1
Swartzn/add priority and wait queue #210
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
base: main
Are you sure you want to change the base?
Conversation
b7a0415
to
48ed876
Compare
return "", fmt.Errorf("unable to generate next PK sequence: %w", err) | ||
} | ||
return fmt.Sprintf("%0*s", s.config.pkSeqWidth, strconv.FormatInt(int64(seq), s.config.pkSeqBase)), nil | ||
return fmt.Sprintf("%0*s", s.config.pkSeqWidth, strconv.FormatUint(seq, s.config.pkSeqBase)), nil |
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.
@iamjoemccormick I wasn't able to find any reason seq
had to be an int64
. This way when a key wraps it'll go back to zero instead of negative.
nextExpectedSubmissionID := "" | ||
nextExpectedSubmissionID := startAtSubmissionID | ||
if lastSubmissionID != "" { | ||
lastSubmissionIDInt64, err := strconv.ParseInt(lastSubmissionID, 10, 64) |
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.
Parsing the submission id as base-10 resulted in nextExpectedSubmissionID
being set to the beginning each time.
@swartzn Squash commits before merging |
dbcd5f0
to
294dd70
Compare
…pose generateNextPK()
Add priority option to ctl push/pull commands with five priority levels. Add IsWorkRequestReady() method to the rst.Provider interface to validate work is ready. * Before work is processed, IsWorkRequestReady() is called to determine if it should be added to the wait queue. Fix invalid submission id parsing which resulted in each pullInNewWork() call to return "".
294dd70
to
3afcac2
Compare
What does this PR do / why do we need it?
Note: In order to accommodate the addition of priorities the following protobuf branch is needed: swartzn/add-priority-wait-queue
Where should the reviewer(s) start reviewing this?
There are two commits.
mapStore
functionality to support getting entries across ranges and exposesGenerateNextPK()
so consumers can utilize the counter.The changes to mapStore are independent in the first commit and should be reviewed first . Afterwards, understand the scheme in rst/sync/internal/workmgr/utils.go:L184 before proceeding to the workmgr changes rst/sync/internal/workmgr/manager.go
Checklist before merging:
When creating a PR these are items to keep in mind that cannot be checked by GitHub actions:
For more details refer to the Go coding standards and the pull request process.