[
https://issues.apache.org/jira/browse/IGNITE-10643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16719072#comment-16719072
]
Vladimir Ozerov commented on IGNITE-10643:
------------------------------------------
Fixed incorrect logic in {{GridH2Table}}. Note that currently I disabled
optimization for {{_KEY=?}} when there is an explicit affinity key fields.
Reasoning:
# {{_KEY=?}} request is very unlikely in practice when there is an affinity
key. Instead, user may always do the following: {{nonAffKey=? AND affKey=?}}
# Previous implementation allowed both {{affKey -> part}} and {{_KEY -> affKey
-> part}} transition. This will not be applicable on JDBC/ODBC side, as we will
support only {{affKey -> part}} transitions based on predefined partition map.
That said it is OK to pessimize partition pruning for {{_KEY}} a bit to allow
for more clean invariants and simpler affinity awareness implementation on
driver side.
> GridCacheContextInfo should not use isCacheContextInited() method to
> calculate constant properties
> --------------------------------------------------------------------------------------------------
>
> Key: IGNITE-10643
> URL: https://issues.apache.org/jira/browse/IGNITE-10643
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Reporter: Vladimir Ozerov
> Assignee: Vladimir Ozerov
> Priority: Major
> Labels: iep-24
> Fix For: 2.8
>
>
> This appears to be a regression from IGNITE-6173. Current method
> {{isCacheContextInited}} is used to determine several properties (config,
> name, customAffinityMapper, groupId, cacheId, affinityNode). This is wrong,
> as all of these properties are "constant" and can be deduced form
> configuration.
> One specific case when it breaks Ignite is {{customAffinityMapper}}. It is
> used to determine affinity key field in {{GridH2Table}} which will be used
> later on for partition pruning. However, when table is created on a client
> node and context is not initialized yet, it will return "false", and
> incorrect affinity key will be calculated in
> {{QueryUtils.typeForQueryEntity}} and in {{GridH2Table}} later on. Finally,
> when query is executed, incorrect partition might be derived from it leading
> to incorrect query result.
> Solution: make all mentioned methods independent of cache state.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)