You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "kfaraz (via GitHub)" <gi...@apache.org> on 2024/07/17 10:54:36 UTC
[PR] Fix bug in TaskStorageQueryAdapter (druid)
kfaraz opened a new pull request, #16750:
URL: https://github.com/apache/druid/pull/16750
### Description
#15377 introduced a change to fetch task payloads from memory.
But it keeps a reference to the `TaskQueue` when `TaskStorageQueryAdapter` is being constructed.
The `TaskQueue` object is recreated upon every leader election.
So, effectively, if a node becomes a leader again, it would use the older instance of the `TaskQueue`
from when it had first become the leader.
But that old instance of `TaskQueue` would not have information of new tasks and would eventually fall back
to fetching stuff from metadata storage, rendering the caching layer useless.
Also, memory leaks.
### Changes
- Do not hold a reference to `TaskQueue` in `TaskStorageQueryAdapter`
- Use `TaskStorage` instead of `TaskStorageQueryAdapter` in `IndexerMetadataStorageAdapter`
- Rename `TaskStorageQueryAdapter` to `TaskQueryTool`
<hr>
This PR has:
- [ ] 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.
- [ ] 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-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Fix bug in TaskStorageQueryAdapter (druid)
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #16750:
URL: https://github.com/apache/druid/pull/16750#discussion_r1680883730
##########
indexing-service/src/test/java/org/apache/druid/indexing/overlord/http/OverlordResourceTest.java:
##########
@@ -1840,22 +1840,22 @@
authConfig,
taskRunner,
taskMaster,
- taskStorageQueryAdapter,
+ this.taskQueryTool,
indexerMetadataStorageAdapter,
req,
workerTaskRunnerQueryAdapter
);
- TaskStorageQueryAdapter taskStorageQueryAdapter = EasyMock.createMock(TaskStorageQueryAdapter.class);
- EasyMock.expect(taskStorageQueryAdapter.getStatus("task"))
+ TaskQueryTool taskQueryTool = EasyMock.createMock(TaskQueryTool.class);
Review Comment:
## Possible confusion of local and field
Potentially confusing name: method [testGetMultipleTaskStatuses_absentTaskQueue](1) also refers to field [taskQueryTool](2) (as this.taskQueryTool).
[Show more details](https://github.com/apache/druid/security/code-scanning/7568)
--
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-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Fix bug in TaskStorageQueryAdapter (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz merged PR #16750:
URL: https://github.com/apache/druid/pull/16750
--
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-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Fix bug in TaskStorageQueryAdapter (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on PR #16750:
URL: https://github.com/apache/druid/pull/16750#issuecomment-2233200215
> This seems misleading as the bug in TaskStorageQueryAdapter doesn't break master. Could you please edit the PR description accordingly?
@AmatyaAvadhanula , I have included another fix in this PR without which master is broken.
The fix is to remove the method `isAudited()` from the new task actions, `RetrieveUpgradedFromSegmentIds` and `RetrieveUpgradedToSegmentIds`.
This method was removed from the original interface `TaskAction` in the PR #16309 .
--
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-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Fix bug in TaskStorageQueryAdapter (druid)
Posted by "AmatyaAvadhanula (via GitHub)" <gi...@apache.org>.
AmatyaAvadhanula commented on PR #16750:
URL: https://github.com/apache/druid/pull/16750#issuecomment-2233166279
> Marked as dev blocker since master branch is broken after merging https://github.com/apache/druid/pull/16309
This seems misleading as the bug in TaskStorageQueryAdapter doesn't break master. Could you please edit the PR description accordingly?
--
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-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Fix bug in TaskStorageQueryAdapter (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on PR #16750:
URL: https://github.com/apache/druid/pull/16750#issuecomment-2233870164
Thanks for the quick review, @AmatyaAvadhanula !
--
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-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Fix bug in TaskStorageQueryAdapter (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on PR #16750:
URL: https://github.com/apache/druid/pull/16750#issuecomment-2233154633
Marked as dev blocker since master branch is broken after merging #16309
--
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-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org