-
Notifications
You must be signed in to change notification settings - Fork 91
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
IGNITE-21390 Inconsistent behavior of Compute APIs when target node does not exist #3191
Conversation
d975745
to
273043c
Compare
for (ClusterNode node : nodes) { | ||
if (topologyService.getByConsistentId(node.name()) == null) { | ||
return new FailedExecution<>(new NodeNotFoundException(node.name())); | ||
} | ||
} |
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.
I think we should not fail if at least one specified node is present. Otherwise the user has to wrap all compute API calls into a retry loop because node failure is always possible.
* Thrown when compute component can't find the node to run the job on in the cluster. | ||
*/ | ||
public class NodeNotFoundException extends ComputeException { | ||
|
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.
Redundant blank line.
@@ -493,6 +498,49 @@ void testExecuteColocatedOnUnknownUnitWithLatestVersionThrows() { | |||
assertEquals(INTERNAL_ERR, cause.code()); | |||
} | |||
|
|||
@Test | |||
void executeAsyncThrowsErrorWhenNodeIsNotFound() { |
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.
It would be great to have a single test that runs against embedded and thin client APIs to ensure consistent behavior, like we do with ItAbstractDataStreamerTest
or ItSqlApiBaseTest
.
7be7e8d
to
8475edb
Compare
8475edb
to
d239599
Compare
I changed the behavior to throw only when there are no candidate nodes. For some reason C++ test for synchronous broadcast doesn't work. |
...main/java/org/apache/ignite/client/handler/requests/compute/ClientComputeExecuteRequest.java
Outdated
Show resolved
Hide resolved
...ute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeErrorsBaseTest.java
Show resolved
Hide resolved
modules/compute/src/main/java/org/apache/ignite/internal/compute/ComputeJobFailover.java
Outdated
Show resolved
Hide resolved
...mpute/src/main/java/org/apache/ignite/internal/compute/exceptions/NodeNotFoundException.java
Outdated
Show resolved
Hide resolved
modules/platforms/dotnet/Apache.Ignite.Tests/Compute/ComputeTests.cs
Outdated
Show resolved
Hide resolved
EXPECT_THROW( | ||
{ | ||
try { | ||
m_client.get_compute().broadcast({unknown_node}, {}, ECHO_JOB, {"unused"}); |
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.
@isapego It seems that the broadcast_async
doesn't propagate exceptions thrown from the execute_on_nodes
, could you please take a look and see if it's possible to have this test here?
https://issues.apache.org/jira/browse/IGNITE-21390
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
The Review Checklist
- There is a single JIRA ticket related to the pull request.
- The web-link to the pull request is attached to the JIRA ticket.
- The JIRA ticket has the Patch Available state.
- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
Notes