IGNITE-22141 C++ 3.0: Implement Partition Awareness for C++ client#7966
IGNITE-22141 C++ 3.0: Implement Partition Awareness for C++ client#7966isapego merged 30 commits intoapache:mainfrom
Conversation
This reverts commit fe51d70.
There was a problem hiding this comment.
Pull request overview
Implements initial partition-awareness plumbing for the Ignite 3 C++ client by introducing a partition-assignment protocol message, tracking assignment timestamps, and routing certain key-based requests to a preferred node. Adds C++ integration tests that validate routing behavior via an ASIO proxy that can intercept client/server messages.
Changes:
- Add protocol + client-side state for partition assignment (new op
PARTITION_ASSIGNMENT_GET, parsing/writing helpers, assignment timestamp propagation). - Route C++
TUPLE_GETthrough a preferred-node selection based on collocated columns hash. - Add C++ partition-awareness integration test infrastructure (proxy message listener + test job on Java side to expose partition distribution).
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/runner/src/testFixtures/java/org/apache/ignite/internal/runner/app/Jobs.java | Adds a compute job to return Java-calculated partition distribution for C++ tests. |
| modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java | Import changes (currently unused). |
| modules/platforms/cpp/tests/test-common/proxy/message_listener.h | New proxy listener that decodes length-prefixed messages into structured client/server messages. |
| modules/platforms/cpp/tests/test-common/proxy/asio_proxy.h | Proxy adjustments for raw message type + improved logging and capture. |
| modules/platforms/cpp/tests/test-common/CMakeLists.txt | Links test-common with asio and msgpack-c. |
| modules/platforms/cpp/tests/fake_server/proxy/message_listener.h | Removes old minimal message listener (replaced by test-common version). |
| modules/platforms/cpp/tests/fake_server/connection_test.cpp | Switches to including proxy header from include path. |
| modules/platforms/cpp/tests/fake_server/CMakeLists.txt | Removes direct asio link from fake_server test target (now via ignite-test-common). |
| modules/platforms/cpp/tests/client-test/partition_awareness_test.cpp | New integration test validating partition-aware routing for get via proxy interception. |
| modules/platforms/cpp/tests/client-test/ignite_runner_suite.h | Adds job constant and __partition_id pseudocolumn constant for tests. |
| modules/platforms/cpp/tests/client-test/CMakeLists.txt | Adds the new partition awareness test to the client-test target. |
| modules/platforms/cpp/ignite/protocol/partition_assignment.h | New partition assignment data structure. |
| modules/platforms/cpp/ignite/protocol/messages.h | Exposes partition-assignment read/write APIs and adds node id/name to handshake response. |
| modules/platforms/cpp/ignite/protocol/messages.cpp | Parses node id/name from handshake and implements partition-assignment request/response helpers. |
| modules/platforms/cpp/ignite/protocol/client_operation.h | Adds PARTITION_ASSIGNMENT_GET op code. |
| modules/platforms/cpp/ignite/common/uuid.h | Adds uuid::from_string for tests/utilities. |
| modules/platforms/cpp/ignite/common/uuid_test.cpp | Adds unit test coverage for uuid::from_string. |
| modules/platforms/cpp/ignite/client/detail/table/table_impl.h | Adds partition-assignment state/mutex and APIs to load/compute preferred node. |
| modules/platforms/cpp/ignite/client/detail/table/table_impl.cpp | Loads assignment and routes TUPLE_GET using preferred node name derived from key hash. |
| modules/platforms/cpp/ignite/client/detail/table/schema.h | Adds collocated_columns to schema for partition-hash calculation. |
| modules/platforms/cpp/ignite/client/detail/node_connection.h | Adds node id/name fields; introduces send-failure logging behavior (currently via stdout). |
| modules/platforms/cpp/ignite/client/detail/node_connection.cpp | Propagates PARTITION_ASSIGNMENT_CHANGED flag to cluster connection and stores handshake node id/name. |
| modules/platforms/cpp/ignite/client/detail/connection_event_handler.h | Adds partition-assignment-changed callback. |
| modules/platforms/cpp/ignite/client/detail/cluster_connection.h | Adds assignment timestamp + preferred-node routing hooks. |
| modules/platforms/cpp/ignite/client/detail/cluster_connection.cpp | Updates assignment timestamp on notifications and selects preferred channel by node name. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
modules/platforms/cpp/tests/client-test/partition_awareness_test.cpp
Outdated
Show resolved
Hide resolved
modules/platforms/cpp/ignite/client/detail/cluster_connection.cpp
Outdated
Show resolved
Hide resolved
modules/platforms/cpp/ignite/client/detail/table/table_impl.cpp
Outdated
Show resolved
Hide resolved
...r/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java
Show resolved
Hide resolved
some refactoring added PA for other methods added check in test that PA was assigned before running the tests
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
modules/platforms/cpp/tests/test-common/proxy/message_listener.h
Outdated
Show resolved
Hide resolved
modules/platforms/cpp/ignite/client/detail/table/table_impl.cpp
Outdated
Show resolved
Hide resolved
...r/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java
Outdated
Show resolved
Hide resolved
modules/platforms/cpp/tests/client-test/partition_awareness_test.cpp
Outdated
Show resolved
Hide resolved
modules/platforms/cpp/ignite/client/detail/cluster_connection.h
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
https://issues.apache.org/jira/browse/IGNITE-22141
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