-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BugFix]support table function on compute nodes #34577
[BugFix]support table function on compute nodes #34577
Conversation
Signed-off-by: abc982627271 <liuxuefen@starrocks.com>
|
||
Collections.shuffle(nodeIds); | ||
ComputeNode node = GlobalStateMgr.getCurrentSystemInfo().getBackendOrComputeNode(nodeIds.get(0)); | ||
address = new TNetworkAddress(node.getHost(), node.getBrpcPort()); | ||
|
||
PGetFileSchemaResult result; | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code reviews can vary in depth and focus depending on the context of the code change and what the reviewers are looking for. Here’s a summary of potential suggestions for this particular diff snippet review:
-
Consistent Naming:
- The renaming from
Backend
toComputeNode
might be implying thatBackend
has been either replaced or extended byComputeNode
. It's crucial to verify everywhere in the codebase that this change is consistently applied and documented if it is part of a larger refactoring.
- The renaming from
-
Exception Message Clarity:
- The new exception message "Failed to send proxy request. No alive backends" could potentially be made more clear, as you're not just looking for "backends" anymore due to the shared-nothing addition but also "compute nodes." Adjusting the messages to reflect the current state of the system could reduce debugging time in the future.
-
Feature Toggles or Runtime Configuration:
- Adding conditional logic based on
RunMode.getCurrentRunMode()
seems like it might be introducing runtime configuration control flow, which can be both powerful and risky. Ensure there is enough test coverage for both branches (shared-nothing and otherwise) and that these runtime changes are well-documented.
- Adding conditional logic based on
-
Error Handling and Retry Logic:
- The adjustment adds new exception paths which could benefit from more sophisticated error handling. Depending on how critical this getFileSchema function is within the system, adding retry logic or better fallbacks might be worthwhile.
-
Thread Safety and Concurrency:
Collections.shuffle(nodeIds);
implies a mutation of thenodeIds
list. If nodeIds is shared across threads, this operation could introduce race conditions. Ensure that eithernodeIds
is confined to a single thread or is otherwise safely published between threads.
-
Code Duplication:
- There appears to be some code duplication between the cases for handling when
nodeIds
is empty and when looking for backends or compute nodes. If similar logic is used in multiple places, consider abstracting it into a method to promote reuse and simplify future updates.
- There appears to be some code duplication between the cases for handling when
-
Unit Testing:
- With logic being changed/added (especially around conditions like
RunMode.getCurrentRunMode()
), unit tests need to be updated or added to cover the new scenarios to ensure that the behavior is as expected.
- With logic being changed/added (especially around conditions like
-
Performance Implications:
- By adding additional backend and compute node checks (as well as potentially making requests to each), there can be performance implications. Verify that this does not significantly impact the performance, especially in large deployments.
-
Documentation and Comments:
- There aren't any comments in the provided diff. Contextual comments explaining why decisions were made (such as the introduction of different node types and run modes) can be incredibly valuable, particularly when unusual or non-obvious logic is introduced.
-
Dependency on Global State:
- The overall logic relies heavily on the global state (
GlobalStateMgr
). Be aware that such reliance makes unit testing more difficult and may increase coupling, which can lead to issues with maintainability.
- The overall logic relies heavily on the global state (
Without the broader context or understanding of prior and future pieces of work, these are top-level suggestions. Changes connected with databases, distributed systems, or resilient service design typically involve deeper considerations, which would be reviewed as part of a more thorough code base analysis.
fe/fe-core/src/main/java/com/starrocks/catalog/TableFunctionTable.java
Outdated
Show resolved
Hide resolved
Signed-off-by: abc982627271 <liuxuefen@starrocks.com>
Signed-off-by: abc982627271 <liuxuefen@starrocks.com>
Signed-off-by: abc982627271 <liuxuefen@starrocks.com>
Signed-off-by: abc982627271 <liuxuefen@starrocks.com>
Kudos, SonarCloud Quality Gate passed!
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 10 / 10 (100.00%) file detail
|
@Mergifyio backport branch-3.2 |
@Mergifyio backport branch-3.1 |
✅ Backports have been created
|
✅ Backports have been created
|
Signed-off-by: abc982627271 <liuxuefen@starrocks.com> (cherry picked from commit 24a6d0e)
Signed-off-by: abc982627271 <liuxuefen@starrocks.com> (cherry picked from commit 24a6d0e) # Conflicts: # fe/fe-core/src/test/java/com/starrocks/catalog/TableFunctionTableTest.java
Signed-off-by: abc982627271 <liuxuefen@starrocks.com>
Signed-off-by: abc982627271 <liuxuefen@starrocks.com> (cherry picked from commit 24a6d0e)
Signed-off-by: abc982627271 <liuxuefen@starrocks.com>
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: