shounakmk219 opened a new pull request, #14754:
URL: https://github.com/apache/pinot/pull/14754

   ## 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
   <img width="1064" alt="image" 
src="https://github.com/user-attachments/assets/b978e2c1-18c9-4037-80a3-35410af10b13";
 />
   
   When there is nothing to schedule
   <img width="1064" alt="image" 
src="https://github.com/user-attachments/assets/784bbd7f-fdf3-42d8-885a-c5f490592b4b";
 />
   
   When there are scheduling errors
   <img width="1723" alt="image" 
src="https://github.com/user-attachments/assets/079bbb1a-7fdc-46ad-86ca-f52b85c4f4fa";
 />
   
   ## 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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to