[ 
https://issues.apache.org/jira/browse/IGNITE-17394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17577814#comment-17577814
 ] 

Mirza Aliev edited comment on IGNITE-17394 at 8/10/22 9:27 AM:
---------------------------------------------------------------

Hello [~isapego]! We have discussed this requirements and come with the 
following: 
 * We can add a method {{List<String> assignments(UUID tableId)}}, which can 
return you a list where on the i-th place resides a node id that considered as 
a leader for the i-th partition on the moment of invocation for the provided 
tableId.
 *  As for the second request with discovering distribution changes, we propose 
a bit different solution: it will be possible that any api method will throw 
Transactional Exception after new transaction mechanism will be introduced 
before beta release. In case of changing primary replica (this is new 
abstraction, that encapsulates the conception of leaders), any api method will 
throw Replica Miss Exception (or it will be a cause of a Transaction 
Exception). When you handle such kind of exception, you can just re-call 
previously introduced api method {{List<String> assignments(UUID tableId)}} and 
refresh your partition mapping with actual primary replicas. This is a ticket 
when concept of Replica Miss Exception will be introduced 
https://issues.apache.org/jira/browse/IGNITE-17378


was (Author: maliev):
Hello [~isapego]! We have discussed this requirements and come with the 
following: 
 * We can add a method {{List<String> assignments(UUID tableId)}}, which can 
return you a list where on the i-th place resides a node id that considered as 
a leader for the i-th partition on the moment of invocation for the provided 
tableId.
 *  As for the second request with discovering distribution changes, we propose 
a bit different solution: any api method will throw Transactional Exception 
after new transaction mechanism will be introduced before beta release. In case 
of changing primary replica (this is new abstraction, that encapsulates the 
conception of leaders), any api method will throw Replica Miss Exception (or it 
will be a cause of a Transaction Exception). When you handle such kind of 
exception, you can just re-call previously introduced api method {{List<String> 
assignments(UUID tableId)}} and refresh your partition mapping with actual 
primary replicas. This is a ticket when concept of Replica Miss Exception will 
be introduced https://issues.apache.org/jira/browse/IGNITE-17378

> Implement API for getting partition mapping
> -------------------------------------------
>
>                 Key: IGNITE-17394
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17394
>             Project: Ignite
>          Issue Type: New Feature
>    Affects Versions: 3.0.0-alpha5
>            Reporter: Igor Sapego
>            Assignee: Mirza Aliev
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.0.0-alpha6
>
>
> To implement Partition Awareness feature for clients, we need an internal or 
> public API that will provide us with the following mapping: [partition => 
> node id] (or [node id => partitions]).
> We also need a lightweight mechanism that will allow us to discover that this 
> distribution has changed. In 2.x we used a topology version for this purpose, 
> assuming that if topology version has changed, partition distribution should 
> be refreshed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to