-
Notifications
You must be signed in to change notification settings - Fork 50
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
WIP: job-list: store inactive job data in job database #4336
base: master
Are you sure you want to change the base?
Conversation
I'm sorry if this isn't related to this PR but I figured I would double check. Is the plan to also adjust the job-archive DB to match the schema you have proposed in the PR description? I only ask because I currently use this query to fetch data from the job-archive DB: SELECT userid,id,t_submit,t_run,t_inactive,ranks,R,jobspec FROM jobs If so, that's totally fine - I will just need to tweak the query slightly to get the data I need. |
The plan is that we would leave the current |
Sounds good! Thanks for clarifying. |
oh crap, i accidentally did |
f842481
to
b46a315
Compare
Codecov Report
@@ Coverage Diff @@
## master #4336 +/- ##
==========================================
+ Coverage 83.37% 83.53% +0.15%
==========================================
Files 401 392 -9
Lines 67517 65936 -1581
==========================================
- Hits 56291 55077 -1214
+ Misses 11226 10859 -367
|
19ca457
to
80ce9ba
Compare
just re-based and and re-pushed fixing up merge conflicts due to recent changes
|
80ce9ba
to
cb4a563
Compare
rebased - fixing conflicts from #4542 |
cb4a563
to
8c566a9
Compare
repushed, rebased on PR #4575 |
8c566a9
to
5a8a3a2
Compare
rebased & re-pushed given #4575 going in |
5a8a3a2
to
58e1401
Compare
250ae40
to
0eee2e4
Compare
Recently the topic of storing inactive and possibly purged jobs in a database and then being able to retrieve them later on via Admittedly needs to be re-looked at given possible new needs / requirements / changes in flux-core / etc. See additional conversation given #4914 |
712dd10
to
95ea6e8
Compare
making this WIP, just wanted to point out a few points mostly from #4914
|
359d64e
to
3dbe6a6
Compare
Problem: There was an errant double semicolon. Solution: Remove it!
Problem: Several helper functions take variable arguments, which are unnecessary. Remove the variable args to these helper functions.
Problem: In the new future the array_to_results_bitmask() will be needed in multiple files. Move it from match.c to match_util.c.
Problem: In the near future we will need access to the job's eventlog when a job goes inactive. Solution: Rebuild the job eventlog from the events journal and store it internally in struct job.
ca593ec
to
d5a5d7f
Compare
bd2def4
to
9f98830
Compare
Problem: We would like to store inactive jobs on disk for retrieval at a later time. Solution: Add an sqlite job db to the job-list module. If the job-list module is configured with a database path or if the flux broker is configured with a statedir, store all inactive job data to the db.
Problem: In the near future we would like to query jobs from the job db. In order to do so efficiently, we need to convert the job list constraint into equivalent SQL that can be used in a WHERE statement. Support a new helper library "constraint_sql" that supports converting a constraint into conditions that can be passed in via an SQL WHERE. Add unit tests as well.
Problem: Now that inactive jobs are stored to an sqlite database, it is possible to retrieve additional job information that is no longer stored in memory. Solution: When possible, read from sqlite to get additional job information about inactive jobs.
Problem: The job-list module now stores / recovers inactive job data from its internal database. Tests that assume job-list only stores jobs in memory do not account for this, leading to errors. Solution: Update tests to read the job-list module stats instead of using `flux jobs`. This gathers internal data to the job-list module, which allows purge tests to pass.
Problem: There are no tests to cover the new job-list DB. Add coverage in new t/t2263-job-list-db.t.
This job-list w/ a database has been re-worked:
|
Per discussion in #4273, some notes on what this does:
add an sqlite database that stores all inactive data to it.
db table is:
Where
jobdata
is a json blob containing all job data (theall
job-list
attribute from #4324, but added astates_mask
which is used internally)The main reason we have a
t_inactive
column is b/c this is backwards compatible to sqlite versions that don't have json support.job-list
toml config or ifstatedir
is configured. So in other words, if no db is configured, it behaves just like before.Ideas:
jobdata
have a version embedded? if things like job states bitmask or things like that change?