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

job-list: default 'since' to something != 0 #5284

Open
chu11 opened this issue Jun 20, 2023 · 5 comments
Open

job-list: default 'since' to something != 0 #5284

chu11 opened this issue Jun 20, 2023 · 5 comments

Comments

@chu11
Copy link
Member

chu11 commented Jun 20, 2023

Something I was just thinking off randomly.

We default since to 0 to say "consider all jobs that are inactive historically" when filtering jobs. This isn't a huge deal when all inactive jobs are stored in memory like they are right now.

We'll move to a database of purged jobs someday in the future (#4336). Which could include like bazillions of jobs. We perhaps do not want to filter / constraint match on all of them.

As a somewhat pre-emptive / "prepare users" move to remove this worst case, perhaps we should default since to != 0 ... not sure what a good default would be. like 48 hours or 1 week ago? A warning could be output if we stopped searching b/c we hit the limit.

@grondo
Copy link
Contributor

grondo commented Jun 20, 2023

Another alternative would be to limit the number of matches (which I think we already do? max_entries=1000 or something...)

@chu11
Copy link
Member Author

chu11 commented Jun 20, 2023

Another alternative would be to limit the number of matches (which I think we already do? max_entries=1000 or something...)

Yeah, we already do that. The issue is if you have some obscure search and don't match anything (or very little). So you'd be scanning the entire database for potential matches, but not actually matching anything.

@grondo
Copy link
Contributor

grondo commented Jun 20, 2023

Ah, so your worry is users inadvertently creating searches that tax the database too heavily? I can see the sense in that, but it does seem like modern databases should be able to handle this kind of query better than we think.

My worry would be incorrect answers by default. For example, a user queries "give me all my jobs that ran on fluke123" and none have run in the past week on that host, so the answer is an empty list.

@chu11
Copy link
Member Author

chu11 commented Jun 20, 2023

My worry would be incorrect answers by default. For example, a user queries "give me all my jobs that ran on fluke123" and none have run in the past week on that host, so the answer is an empty list.

Ahhh I didn't think of it that way. That is a good point.

Ah, so your worry is users inadvertently creating searches that tax the database too heavily? I can see the sense in that, but it does seem like modern databases should be able to handle this kind of query better than we think.

Yeah, we'll have to see how the job constraints stuff ends up working out. Now that we're splitting out the job-archive into flux-acounting (flux-framework/flux-accounting#357) we have less "dependency" and can tweak the database per our own needs. Given the initial job constraints implementation (#5126) and the initial job db in #4336, I think we'd just iterate through every inactive job in the database ... which is bad of course. (side note, #4336 has to be re-worked given job constraints.)

@chu11
Copy link
Member Author

chu11 commented Nov 22, 2023

By cahnce, I noticed that in sacct there are "time windows" with their searches. Only jobs that started in the specified time range (-S, -E) will be returned. That's a alternate way to deal with the general "don't scan the whole database".

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

No branches or pull requests

2 participants