-
Notifications
You must be signed in to change notification settings - Fork 566
[MLDM-89] Add Caching Behavior to PJSDB Functions #10351
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
Conversation
size-limit report 📦
|
4edd5f0
to
7eff41e
Compare
// GetJob returns a job by its JobID. GetJob should not be used to claim a job. | ||
func GetJob(ctx context.Context, tx *pachsql.Tx, id JobID) (Job, error) { | ||
ctx = pctx.Child(ctx, "getJob") | ||
record := jobRecord{} | ||
err := sqlx.GetContext(ctx, tx, &record, selectJobRecordPrefix+` | ||
WHERE j.id = $1 GROUP BY j.id, jc.job_hash, jc.cache_write, jc.cache_read;`, id) |
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.
In my understanding, the ordering of group doesn't matter?
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.
It doesn't, I just reordered it because read is generally before write (its read & write)
} | ||
return Job{}, errors.Wrap(err, "get context") | ||
} | ||
log.Debug(ctx, "found job in the pjs job cache", zap.Uint64("job", uint64(record.ID))) |
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.
We should remove Debug?
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.
Nope, I added this intentionally so we can change the log mode to debug and confirm that the cache is being used.
7eff41e
to
cf0360c
Compare
cf0360c
to
167e608
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10351 +/- ##
==========================================
- Coverage 62.38% 62.33% -0.05%
==========================================
Files 1217 1218 +1
Lines 87497 87608 +111
Branches 1820 1820
==========================================
+ Hits 54581 54608 +27
- Misses 32247 32334 +87
+ Partials 669 666 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
167e608
to
6cb6773
Compare
6cb6773
to
908ff97
Compare
No description provided.