AmatyaAvadhanula opened a new pull request, #16227:
URL: https://github.com/apache/druid/pull/16227

   ### Bug:
   
   https://github.com/apache/druid/pull/15724 - introduced a bug where a 
rolling upgrade would cause all task locations returned by the Overlord on an 
older version to be unknown.
   
   Prior to #15724,
   1) OverlordResource#`getTaskStatus` for individual tasks fetched a 
TaskStatusResponse containing the location.
   2) OverlordResource#`getMultipleTaskStatuses` fetched task statuses in a 
batch from the metadata store. The metadata store doesn't contain the current 
location of an active task. Complete tasks do contain them
   
   After the changes,
   1) OverlordResource#`getTaskStatus` remains unchanged.
   2) OverlordResource#`getMultipleTaskStatuses` fetches task statuses for 
in-memory tasks from the TaskQueue and enhances them with the location from the 
task runner. The method fetches task statuses for completed tasks from the db.
   
   The Overlord client was also changed to rely on the 2nd API to fetch the 
task status and location from memory.
   
   During a rolling upgrade, the task is on a version with the PR's changes and 
queries the 2nd API. The overlord is still on the older version and fails to 
return the correct location for active tasks. This can lead to task failures 
during rolling upgrades.
   
   
   ### Fix
   
   The overlord client now falls back to the orignal API that always returns 
the task location if the 2nd API fails to return it during the rolling upgrade. 
After the rolling upgrade, the active tasks' statuses will be fetched from 
memory as expected.
   
   
   ### Testing
   
   The new overlord client was used on an upgraded Indexer / MM while the 
Overlord was on a version prior to #15724. The tasks succeeded as expected. 
(They would fail with a newer Indexer without this patch).
   
   This PR has:
   - [x] been self-reviewed.
      - [ ] using the [concurrency 
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
 (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] a release note entry in the PR description.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in 
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [ ] added integration tests.
   - [x] been tested in a test Druid cluster.
   


-- 
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: commits-unsubscr...@druid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to