-
Notifications
You must be signed in to change notification settings - Fork 20
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
implement Replica::pending_tasks #454
implement Replica::pending_tasks #454
Conversation
Nice work! I think it would be unusual to want to get all completed or deleted tasks (and those cases would be covered by And, the set of all pending tasks and the working set can be slightly different in ways that might be significant. I think the best approach here would be joining with the working set to get the working-set tasks. |
ee6da77
to
38e108e
Compare
38e108e
to
c180ebc
Compare
Thanks for the feedback. I've updated the PR so it hopefully reflect your suggestions. I moved some code from I have also fixed the CI failures, so I think this is ready for review. Let me know if you'd like any other changes to the code |
This implementation looks solid and well-tested! However, this still requires two separate queries to get the pending tasks: first to get the list of UUIDs in the pending set, and second to fetch each of those tasks. This involves sending that list of UUIDs from the DB to Rust and back. Could a single |
67e658b
to
7212d14
Compare
7212d14
to
92b5130
Compare
That's really good feedback. I hadn't realised that the working set already exists in the database, thanks 😄 I'm guessing that there's somewhere else in the code that ensures only tasks with the "pending" status are added to the working_set? I've added a new commit that changes the implementation to using a join to do it in a single query. Let me know if you would like any other changes. I'm personally not entirely happy with the If you're happy with how the implementation is looking I'm going to squash the changes into a single commit before merging and give the code another pass to see if I can improve the readability+improve the doc strings |
Yes, modifications to the
I'll have a look shortly! |
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.
Really close! Just a few comments below.
Thank you so much for the review and for taking the time to thoroughly explain the bug that my choice of I've added a commit for each comment you had to make it easier to read through. I hope it's okay to run the changes by you one final time before I squash (actually |
7a4dfe8
to
b51ace5
Compare
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 great, thanks! And no problem at all making another round of review.
I can squash this when merging, so if you want to just make one more commit to fix the comment, that's all that should be necessary.
Hey @djmitche If everything looks good to you, feel free to squash and merge the PR 😄 |
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.
Sorry for the delay!
No problem. I wasn't sure if I had communicated clearly that I thought I had solved all remaining issues 😅 Thanks so much for all your constructive feedback on my changes. This was an incredibly pleasant experience and I hope I'll get the chance to contribute to the project again |
This is a first attempt at #452.
I've implemented two different approaches in the storage layer and I'm looking for feedback on whether either of these, or a third approach, would be most optimal.
Currently the
taskdb
layer use the more "naive" approach, which follows the original c++ code more closely.The alternative approach would use the
get_tasks_by_status
to query forpending
tasks. I am however not sure whether there could potentially be an inconsistency between theworking_set
and the sqlite database, which would make that solution unfeasible.