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

Get task info by runId #813

Merged
merged 7 commits into from Dec 29, 2015
Merged

Get task info by runId #813

merged 7 commits into from Dec 29, 2015

Conversation

ssalinas
Copy link
Member

Get the SingularityTaskIdHistory object for a task by it's run id

/cc @jhaber this should get you back taskId, last state, and the SingularityTaskId object

@@ -29,6 +29,9 @@
@SqlQuery("SELECT bytes FROM taskHistory WHERE taskId = :taskId")
byte[] getTaskHistoryForTask(@Bind("taskId") String taskId);

@SqlQuery("SELECT bytes FROM taskHistory WHERE runId = :runId")
byte[] getTaskHistoryForTaskByRunId(@Bind("runId") String runId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this also filter by requestId?

@@ -29,6 +29,9 @@
@SqlQuery("SELECT bytes FROM taskHistory WHERE taskId = :taskId")
byte[] getTaskHistoryForTask(@Bind("taskId") String taskId);

@SqlQuery("SELECT bytes FROM taskHistory WHERE requestId = :requestId AND runId = :runId")
byte[] getTaskHistoryForTaskByRunId(@Bind("requestId") String requestId, @Bind("runId") String runId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we index on runId?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not currently, we would probably need to for this case

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, we should add an index. let me know if you need a hand with this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an index in b63cf47 , can someone with more mysql chops double check that please?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syncing up w/ monty about this

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which query/queries will benefit from the added index in b63cf47?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one on the line for this comment thread:
SELECT bytes FROM taskHistory WHERE requestId = :requestId AND runId = :runId

@ssalinas
Copy link
Member Author

Updated a couple things, had forgotten about the description, thanks for that

@tpetr
Copy link
Contributor

tpetr commented Dec 21, 2015

This PR reads like there was an assumption that runId would be unique, but I don't see any constraint for that in #669. Did I miss something, or was this an oversight?

@tpetr tpetr added this to the 0.4.8 milestone Dec 28, 2015
tpetr pushed a commit that referenced this pull request Dec 29, 2015
@tpetr tpetr merged commit 9634c33 into master Dec 29, 2015
@tpetr tpetr removed hs_qa labels Dec 29, 2015
@ssalinas ssalinas deleted the run_id_query branch February 9, 2016 20:06
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

Successfully merging this pull request may close these issues.

None yet

5 participants