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

Include the task scheduling errors in schedule response #14754

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

shounakmk219
Copy link
Collaborator

@shounakmk219 shounakmk219 commented Jan 3, 2025

Description

The task schedule endpoint on controller does not give the user any visibility into how the scheduling went when there is a taskType : null response

  • did it failed to schedule the tasks
  • was there no work to be scheduled

To relay more info back to the user, this PR enhances the return types of PinotTaskManager schedule methods to a wrapper object that contains the generation and scheduling errors along with the names of scheduled tasks

In order to not break the schedule endpoints the error info is returned as separate entry in the response map as below

Earlier response

Successful schedule

{
  "RealtimeToOfflineSegmentsTask": "Task_RealtimeToOfflineSegmentsTask_xxxxx"
}

Successful schedule with no tasks to schedule or failed schedule

{
  "RealtimeToOfflineSegmentsTask": null
}

Improved response

Successful schedule without any errors

{
  "RealtimeToOfflineSegmentsTask": "Task_RealtimeToOfflineSegmentsTask_xxxxx",
  "generationErrors": "",
  "schedulingErrors": ""
}

Successful schedule with no tasks to schedule

{
  "RealtimeToOfflineSegmentsTask": "",
  "generationErrors": "",
  "schedulingErrors": ""
}

Failed schedule with errors during task generation

{
  "RealtimeToOfflineSegmentsTask": null,
  "generationErrors": "Failed to generate tasks for task type RealtimeToOfflineSegmentsTask for table abc. Reason : xyz",
  "schedulingErrors": ""
}

UI Changes

This PR also makes the UI change for Schedule Now cta

When task is scheduled
image

When there is nothing to schedule
image

When there are scheduling errors
image

Backward incompatible changes

The PinotTaskManager schedule methods have changed return types from either List<String> to TaskSchedulingInfo or Map<String, List<String>> to Map<String, TaskSchedulingInfo>

Schedule methods used to return null as scheduled task names list incase of both scheduling failures as well as no task to schedule. Now that behaviour is changed to null in case of scheduling failures and empty list when there is no task to be scheduled.

@shounakmk219 shounakmk219 added backward-incompat Referenced by PRs that introduce or fix backward compat issues user-experience Related to user experience ui UI related issue rest-api labels Jan 3, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 20.00000% with 36 lines in your changes missing coverage. Please review.

Project coverage is 63.84%. Comparing base (59551e4) to head (b120a47).
Report is 1557 commits behind head on master.

Files with missing lines Patch % Lines
...roller/api/resources/PinotTaskRestletResource.java 0.00% 19 Missing ⚠️
...controller/helix/core/minion/PinotTaskManager.java 34.61% 17 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14754      +/-   ##
============================================
+ Coverage     61.75%   63.84%   +2.09%     
- Complexity      207     1609    +1402     
============================================
  Files          2436     2704     +268     
  Lines        133233   151008   +17775     
  Branches      20636    23318    +2682     
============================================
+ Hits          82274    96412   +14138     
- Misses        44911    47380    +2469     
- Partials       6048     7216    +1168     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 0.00% <ø> (ø)
java-11 63.82% <20.00%> (+2.11%) ⬆️
java-21 63.73% <20.00%> (+2.11%) ⬆️
skip-bytebuffers-false 63.83% <20.00%> (+2.08%) ⬆️
skip-bytebuffers-true 63.72% <20.00%> (+35.99%) ⬆️
temurin 63.84% <20.00%> (+2.09%) ⬆️
unittests 63.84% <20.00%> (+2.09%) ⬆️
unittests1 56.29% <ø> (+9.40%) ⬆️
unittests2 34.13% <20.00%> (+6.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jayeshchoudhary jayeshchoudhary left a comment

Choose a reason for hiding this comment

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

ui changes looks good.

Comment on lines +51 to +54
assertNotNull(info.getGenerationErrors());
assertTrue(info.getGenerationErrors().isEmpty());
assertNotNull(info.getSchedulingErrors());
assertTrue(info.getSchedulingErrors().isEmpty());
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure iiuc, but errors can be non-empty too if no task is scheduled due to scheduling / generation errors right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The tests are using this util methods right now to assert that tasks are not being scheduled due to no work or tasks already in progress. In that flow we need to make sure that there are no errors as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm would suggest to move the last 4 assertions to a separate method maybe -- assertNoError kind of. But can be done in a follow-up PR as well.

Co-authored-by: Pratik Tibrewal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backward-incompat Referenced by PRs that introduce or fix backward compat issues rest-api ui UI related issue user-experience Related to user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants