[
https://issues.apache.org/jira/browse/IGNITE-2310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15310174#comment-15310174
]
ASF GitHub Bot commented on IGNITE-2310:
----------------------------------------
GitHub user tledkov-gridgain opened a pull request:
https://github.com/apache/ignite/pull/769
IGNITE-2310 Lock cache partition for affinityRun/affinityCall execution
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gridgain/apache-ignite ignite-2310
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/ignite/pull/769.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #769
----
commit 4b65ae906f43a70f914fb33fcf7a65108f39c2cb
Author: tledkov-gridgain <[email protected]>
Date: 2016-05-27T12:16:27Z
add test
commit 5c46507045da69d7613b57a528a82011fc383c65
Author: tledkov-gridgain <[email protected]>
Date: 2016-05-27T15:07:03Z
test to validate issue
commit a7f9edd6d05cef68b949993d920943fa8fdd5ee2
Author: tledkov-gridgain <[email protected]>
Date: 2016-05-30T13:25:10Z
Merge remote-tracking branch 'remotes/origin/master' into ignite-2310
commit 33524cf9089b1b743923faeb47f3b8421185c7fc
Author: tledkov-gridgain <[email protected]>
Date: 2016-06-01T11:45:08Z
IGNITE-2310 Lock cache partition for affinityRun/affinityCall execution:
add method affinityRun(cacheName, affKey, job,
Map<String, int[]>
partsToLock) ;
----
> Lock cache partition for affinityRun/affinityCall execution
> -----------------------------------------------------------
>
> Key: IGNITE-2310
> URL: https://issues.apache.org/jira/browse/IGNITE-2310
> Project: Ignite
> Issue Type: New Feature
> Components: cache
> Reporter: Valentin Kulichenko
> Assignee: Taras Ledkov
> Priority: Critical
> Labels: community
> Fix For: 1.7
>
>
> Partition of a key passed to {{affinityRun}} must be located on the affinity
> node when a compute job is being sent to the node. The partition has to be
> locked on the cache until the compute job is being executed. This will let to
> execute queries safely (Scan or local SQL) over the data that is located
> locally in the locked partition.
> In addition Ignite Compute API has to be extended by adding {{affinityCall}}
> and {{affinityRun}} methods that accept list of caches which partitions have
> to be locked at the time a compute task is being executed.
> Test cases to validate the functionality:
> 1) local SQL query over data located in a concrete partition in multple
> caches.
> - create cache Organisation cache and create Persons cache.
> - collocate Persons by 'organisationID';
> - send {{affinityRun}} using 'organisationID' as an affinity key and passing
> Organisation and Persons caches' names to the method to be sure that the
> partition will be locked on caches;
> - execute local SQL query "SELECT * FROM Persons as p, Organisation as o
> WHERE p.orgId=o.id' on a changing topology. The result set must be complete,
> the partition over which the query will be executed mustn't be moved to the
> other node. Due to affinity collocation the partition number will be the same
> for all Persons that belong to particular 'organisationID'
> 2) Scan Query over particular partition that is locked when {{affinityCall}}
> is executed.
> UPD (YZ May, 31)
> # If closure arrives to node but partition is not there it should be silently
> failed over to current owner.
> # I don't think user should provide list of caches. How about reserving only
> one partition, but evict partitions after all partitions in all caches (with
> same affinity function) on this node are locked for eviction. [~sboikov], can
> you please comment? It seems this should work faster for closures and will
> hardly affect rebalancing stuff.
> # I would add method {{affinityCall(int partId, String cacheName,
> IgniteCallable)}} and same for Runnable. This will allow me not to mess with
> affinity key in case I know partition before.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)