...
- PA "write" requests still should be sent to primary nodes (nothing changed), but PA "read" requests (if readFromBackup flag is set and write synchrinization mode is not PRIMARY_SYNC) can be sent to backup node, if node is located in the same DC as client (if there is no partitions in the same DC, request should be sent to primary node).
- Non-PA requests should sent to random node in the same DC as client.
It's proposed to change "cache partitions" messages (add information about partition in current DC) and introduce new "data center nodes" messages to achive these improvements. Alternatevely, instead of introducing new message we can reuse CLUSTER_GROUP_GET_NODE_IDS message, but in this case client should know about server attribute name to store DC ID (which is server internal information), and everythink everything can be broken if server will change DC ID storage place.
Protocol changes
Operation codes
The new operation for "data center nodes" request is required:
| Name | Code |
|---|
OP_CLUSTER_GET_DC_NODES
| 5103 |
OP_CLUSTER_GET_DC_NODES message format
| Request |
|---|
| String | Data center ID |
| Response |
|---|
| int | Nodes count |
| (UUID) * count | Nodes IDs |
OP_CACHE_PARTITIONS message format changes
| Request |
|---|
| bool | Custom mapping |
| String | Data center ID - new field |
| int | Caches count |
| (int) * count | Cache IDs |
| Response |
|---|
| long | Major topology version |
| int | Minor topology version |
| int | Partition mappings count |
| (Caches configuration and partition mapping) * count | Caches configuration and partition mappings |
| Caches configuration and partition mapping |
|---|
| bool | Applicable. Flag that shows, whether standard affinity is used for caches. |
| int | Count of caches |
| (Cache ID + key configuration) * count | Cache IDS and cache key configurations |
| Partition mapping | Primary partition mapping (if Applicable is true) |
| Partition mapping | Current DC partition mapping (if Applicable is true) - new field |
| Partition mapping |
|---|
| int | Nodes count |
| (Node ipartitions) * count | Node partitions information |
| Node partitions |
|---|
| UUID | Node ID |
| int | Partitions count |
| (int) * count | Partitions |
Risks and Assumptions
Current approach to this IEP introduces components' mostly internal logic modifications, no public API changes or breaking binary compatibility are needed. Protocols stay the same as well with some internal tweaks and possibly some refactoring.
...