Skip to content
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

Merged
merged 9 commits into from
Feb 20, 2024

Conversation

valepakh
Copy link
Contributor

@valepakh valepakh commented Feb 8, 2024

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

  • Formal criteria: TC status, codestyle, mandatory documentation. Also make sure to complete the following:
    - 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.
  • Design: new code conforms with the design principles of the components it is added to.
  • Patch quality: patch cannot be split into smaller pieces, its size must be reasonable.
  • Code quality: code is clean and readable, necessary developer documentation is added if needed.
  • Tests code quality: test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.

Notes

Comment on lines 111 to 115
for (ClusterNode node : nodes) {
if (topologyService.getByConsistentId(node.name()) == null) {
return new FailedExecution<>(new NodeNotFoundException(node.name()));
}
}
Copy link
Contributor

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 {

Copy link
Contributor

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() {
Copy link
Contributor

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.

@valepakh valepakh force-pushed the IGNITE-21390 branch 2 times, most recently from 7be7e8d to 8475edb Compare February 9, 2024 11:51
@valepakh
Copy link
Contributor Author

valepakh commented Feb 9, 2024

I changed the behavior to throw only when there are no candidate nodes. For some reason C++ test for synchronous broadcast doesn't work.

EXPECT_THROW(
{
try {
m_client.get_compute().broadcast({unknown_node}, {}, ECHO_JOB, {"unused"});
Copy link
Contributor Author

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?

@PakhomovAlexander PakhomovAlexander merged commit bba18a5 into apache:main Feb 20, 2024
1 check passed
@valepakh valepakh deleted the IGNITE-21390 branch February 20, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants