[jira] [Commented] (IGNITE-12921) System views design leads to bad user expirience.

2020-09-18 Thread Ignite TC Bot (Jira)


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

Ignite TC Bot commented on IGNITE-12921:


{panel:title=Branch: [pull/8135/head] Base: [master] : No blockers 
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
{panel:title=Branch: [pull/8135/head] Base: [master] : No new tests 
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1}{panel}
[TeamCity *-- Run :: All* 
Results|https://ci.ignite.apache.org/viewLog.html?buildId=5610305buildTypeId=IgniteTests24Java8_RunAll]

> System views design leads to bad user expirience.
> -
>
> Key: IGNITE-12921
> URL: https://issues.apache.org/jira/browse/IGNITE-12921
> Project: Ignite
>  Issue Type: Bug
>Affects Versions: 2.8
>Reporter: Andrey N. Gura
>Assignee: Nikolay Izhikov
>Priority: Critical
>  Labels: IEP-35
> Fix For: 2.10
>
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Current implementation of system views has broken system behavior which is 
> related with querying system views. 
> Before 2.8 system views were available via SQL queries (if indexing is 
> enabled). It did not depend on any configuration. 
> After implementation of IGNITE-12145 system views available only if 
> {{SqlViewExporterSpi}} is passed to 
> {{IgniteConfiguration.setSystemViewExporterSpi()}}. Now, if an user 
> configures some {{SystemViewExporterSpi}} then provided user configuration 
> will rewrite default configuration and {{SqlViewExporterSpi}} won't be 
> initialized. As result it is impossible to query system views and any query 
> to the views fails with exception. This behavior is not obvious for the user. 
> See tests below.
> The second problem is kind of design problem. System view is internal part of 
> the system and should be available regardless of any exporter configuration 
> (at least via SQL) such as it was implemented before 2.8 release. 
> My suggestion is the following: we should remove {{SqlViewExporterSpi}} and 
> configure all views on indexing module initialization. {{SqlViewExporterSPI}} 
> also doesn't make sense because:
> - it operates by some internal API ({{SchemaManager}}, {{GridKernalContext}}, 
> {{IgniteH2Indexing}}).
> - it doesn't allow to end user to add any new system view.
> Only thing that could be useful is a filtering. But it could be done with SQL.
> Reproducer of broken behavior:
> {code:java}
> package org.apache.ignite.internal.processors.cache.metric;
> import org.apache.ignite.cache.query.SqlFieldsQuery;
> import org.apache.ignite.cluster.ClusterState;
> import org.apache.ignite.configuration.DataRegionConfiguration;
> import org.apache.ignite.configuration.DataStorageConfiguration;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.internal.IgniteEx;
> import org.apache.ignite.spi.systemview.jmx.JmxSystemViewExporterSpi;
> import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
> import org.junit.Test;
> import java.util.HashSet;
> import java.util.List;
> import java.util.Set;
> import static java.util.Arrays.asList;
> import static 
> org.apache.ignite.internal.processors.cache.index.AbstractSchemaSelfTest.queryProcessor;
> public class SystemViewTest extends GridCommonAbstractTest {
> private static boolean useDefaultSpi;
> /** {@inheritDoc} */
> @Override protected IgniteConfiguration getConfiguration(String 
> igniteInstanceName) throws Exception {
> IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
> cfg.setConsistentId(igniteInstanceName);
> cfg.setDataStorageConfiguration(new DataStorageConfiguration()
> .setDataRegionConfigurations(
> new 
> DataRegionConfiguration().setName("in-memory").setMaxSize(100L * 1024 * 1024))
> .setDefaultDataRegionConfiguration(
> new DataRegionConfiguration()
> .setPersistenceEnabled(true)));
> if (!useDefaultSpi) {
> // Configure user provided system view exporter SPI.
> cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
> }
> return cfg;
> }
> /**
>  * Will executed succefully.
>  */
> @Test
> public void testSystemViewWithDefaultSpi() throws Exception {
> useDefaultSpi = true;
> doTestSystemView();
> }
> /**
>  * Will fail with Table "VIEWS" not found.
>  */
> @Test
> public void testSystemViewWithCustomSpi() throws Exception {
> useDefaultSpi = false;
> doTestSystemView();
> }
> private void doTestSystemView() throws Exception {
> try (IgniteEx ignite = startGrid()) 

[jira] [Commented] (IGNITE-12921) System views design leads to bad user expirience.

2020-09-17 Thread Nikolay Izhikov (Jira)


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

Nikolay Izhikov commented on IGNITE-12921:
--

[~agura] Thanks for pointing this out.

Will fix in the nearest time.

> System views design leads to bad user expirience.
> -
>
> Key: IGNITE-12921
> URL: https://issues.apache.org/jira/browse/IGNITE-12921
> Project: Ignite
>  Issue Type: Bug
>Affects Versions: 2.8
>Reporter: Andrey N. Gura
>Assignee: Nikolay Izhikov
>Priority: Critical
>  Labels: IEP-35
> Fix For: 2.10
>
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Current implementation of system views has broken system behavior which is 
> related with querying system views. 
> Before 2.8 system views were available via SQL queries (if indexing is 
> enabled). It did not depend on any configuration. 
> After implementation of IGNITE-12145 system views available only if 
> {{SqlViewExporterSpi}} is passed to 
> {{IgniteConfiguration.setSystemViewExporterSpi()}}. Now, if an user 
> configures some {{SystemViewExporterSpi}} then provided user configuration 
> will rewrite default configuration and {{SqlViewExporterSpi}} won't be 
> initialized. As result it is impossible to query system views and any query 
> to the views fails with exception. This behavior is not obvious for the user. 
> See tests below.
> The second problem is kind of design problem. System view is internal part of 
> the system and should be available regardless of any exporter configuration 
> (at least via SQL) such as it was implemented before 2.8 release. 
> My suggestion is the following: we should remove {{SqlViewExporterSpi}} and 
> configure all views on indexing module initialization. {{SqlViewExporterSPI}} 
> also doesn't make sense because:
> - it operates by some internal API ({{SchemaManager}}, {{GridKernalContext}}, 
> {{IgniteH2Indexing}}).
> - it doesn't allow to end user to add any new system view.
> Only thing that could be useful is a filtering. But it could be done with SQL.
> Reproducer of broken behavior:
> {code:java}
> package org.apache.ignite.internal.processors.cache.metric;
> import org.apache.ignite.cache.query.SqlFieldsQuery;
> import org.apache.ignite.cluster.ClusterState;
> import org.apache.ignite.configuration.DataRegionConfiguration;
> import org.apache.ignite.configuration.DataStorageConfiguration;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.internal.IgniteEx;
> import org.apache.ignite.spi.systemview.jmx.JmxSystemViewExporterSpi;
> import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
> import org.junit.Test;
> import java.util.HashSet;
> import java.util.List;
> import java.util.Set;
> import static java.util.Arrays.asList;
> import static 
> org.apache.ignite.internal.processors.cache.index.AbstractSchemaSelfTest.queryProcessor;
> public class SystemViewTest extends GridCommonAbstractTest {
> private static boolean useDefaultSpi;
> /** {@inheritDoc} */
> @Override protected IgniteConfiguration getConfiguration(String 
> igniteInstanceName) throws Exception {
> IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
> cfg.setConsistentId(igniteInstanceName);
> cfg.setDataStorageConfiguration(new DataStorageConfiguration()
> .setDataRegionConfigurations(
> new 
> DataRegionConfiguration().setName("in-memory").setMaxSize(100L * 1024 * 1024))
> .setDefaultDataRegionConfiguration(
> new DataRegionConfiguration()
> .setPersistenceEnabled(true)));
> if (!useDefaultSpi) {
> // Configure user provided system view exporter SPI.
> cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
> }
> return cfg;
> }
> /**
>  * Will executed succefully.
>  */
> @Test
> public void testSystemViewWithDefaultSpi() throws Exception {
> useDefaultSpi = true;
> doTestSystemView();
> }
> /**
>  * Will fail with Table "VIEWS" not found.
>  */
> @Test
> public void testSystemViewWithCustomSpi() throws Exception {
> useDefaultSpi = false;
> doTestSystemView();
> }
> private void doTestSystemView() throws Exception {
> try (IgniteEx ignite = startGrid()) {
> ignite.cluster().state(ClusterState.ACTIVE);
> Set cacheNames = new HashSet<>(asList("cache-1", 
> "cache-2"));
> for (String name : cacheNames)
> ignite.getOrCreateCache(name);
> SqlFieldsQuery qry = new SqlFieldsQuery("SELECT * FROM 
> SYS.VIEWS");
> List> 

[jira] [Commented] (IGNITE-12921) System views design leads to bad user expirience.

2020-09-17 Thread Andrey N. Gura (Jira)


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

Andrey N. Gura commented on IGNITE-12921:
-

The same about {{ZookeeperDiscoveryTopologyChangeAndReconnectTest}}

> System views design leads to bad user expirience.
> -
>
> Key: IGNITE-12921
> URL: https://issues.apache.org/jira/browse/IGNITE-12921
> Project: Ignite
>  Issue Type: Bug
>Affects Versions: 2.8
>Reporter: Andrey N. Gura
>Assignee: Nikolay Izhikov
>Priority: Critical
>  Labels: IEP-35
> Fix For: 2.10
>
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Current implementation of system views has broken system behavior which is 
> related with querying system views. 
> Before 2.8 system views were available via SQL queries (if indexing is 
> enabled). It did not depend on any configuration. 
> After implementation of IGNITE-12145 system views available only if 
> {{SqlViewExporterSpi}} is passed to 
> {{IgniteConfiguration.setSystemViewExporterSpi()}}. Now, if an user 
> configures some {{SystemViewExporterSpi}} then provided user configuration 
> will rewrite default configuration and {{SqlViewExporterSpi}} won't be 
> initialized. As result it is impossible to query system views and any query 
> to the views fails with exception. This behavior is not obvious for the user. 
> See tests below.
> The second problem is kind of design problem. System view is internal part of 
> the system and should be available regardless of any exporter configuration 
> (at least via SQL) such as it was implemented before 2.8 release. 
> My suggestion is the following: we should remove {{SqlViewExporterSpi}} and 
> configure all views on indexing module initialization. {{SqlViewExporterSPI}} 
> also doesn't make sense because:
> - it operates by some internal API ({{SchemaManager}}, {{GridKernalContext}}, 
> {{IgniteH2Indexing}}).
> - it doesn't allow to end user to add any new system view.
> Only thing that could be useful is a filtering. But it could be done with SQL.
> Reproducer of broken behavior:
> {code:java}
> package org.apache.ignite.internal.processors.cache.metric;
> import org.apache.ignite.cache.query.SqlFieldsQuery;
> import org.apache.ignite.cluster.ClusterState;
> import org.apache.ignite.configuration.DataRegionConfiguration;
> import org.apache.ignite.configuration.DataStorageConfiguration;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.internal.IgniteEx;
> import org.apache.ignite.spi.systemview.jmx.JmxSystemViewExporterSpi;
> import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
> import org.junit.Test;
> import java.util.HashSet;
> import java.util.List;
> import java.util.Set;
> import static java.util.Arrays.asList;
> import static 
> org.apache.ignite.internal.processors.cache.index.AbstractSchemaSelfTest.queryProcessor;
> public class SystemViewTest extends GridCommonAbstractTest {
> private static boolean useDefaultSpi;
> /** {@inheritDoc} */
> @Override protected IgniteConfiguration getConfiguration(String 
> igniteInstanceName) throws Exception {
> IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
> cfg.setConsistentId(igniteInstanceName);
> cfg.setDataStorageConfiguration(new DataStorageConfiguration()
> .setDataRegionConfigurations(
> new 
> DataRegionConfiguration().setName("in-memory").setMaxSize(100L * 1024 * 1024))
> .setDefaultDataRegionConfiguration(
> new DataRegionConfiguration()
> .setPersistenceEnabled(true)));
> if (!useDefaultSpi) {
> // Configure user provided system view exporter SPI.
> cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
> }
> return cfg;
> }
> /**
>  * Will executed succefully.
>  */
> @Test
> public void testSystemViewWithDefaultSpi() throws Exception {
> useDefaultSpi = true;
> doTestSystemView();
> }
> /**
>  * Will fail with Table "VIEWS" not found.
>  */
> @Test
> public void testSystemViewWithCustomSpi() throws Exception {
> useDefaultSpi = false;
> doTestSystemView();
> }
> private void doTestSystemView() throws Exception {
> try (IgniteEx ignite = startGrid()) {
> ignite.cluster().state(ClusterState.ACTIVE);
> Set cacheNames = new HashSet<>(asList("cache-1", 
> "cache-2"));
> for (String name : cacheNames)
> ignite.getOrCreateCache(name);
> SqlFieldsQuery qry = new SqlFieldsQuery("SELECT * FROM 
> SYS.VIEWS");
> List> res 

[jira] [Commented] (IGNITE-12921) System views design leads to bad user expirience.

2020-09-17 Thread Andrey N. Gura (Jira)


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

Andrey N. Gura commented on IGNITE-12921:
-

[~nizhikov] I found that after merge IGNITE-12922 test 
{{JdbcMetadataSelfTest.testGetAllView}} fails. Could you please fix this test 
as part this issue? And please remember about TC Bot visa.

> System views design leads to bad user expirience.
> -
>
> Key: IGNITE-12921
> URL: https://issues.apache.org/jira/browse/IGNITE-12921
> Project: Ignite
>  Issue Type: Bug
>Affects Versions: 2.8
>Reporter: Andrey N. Gura
>Assignee: Nikolay Izhikov
>Priority: Critical
>  Labels: IEP-35
> Fix For: 2.10
>
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Current implementation of system views has broken system behavior which is 
> related with querying system views. 
> Before 2.8 system views were available via SQL queries (if indexing is 
> enabled). It did not depend on any configuration. 
> After implementation of IGNITE-12145 system views available only if 
> {{SqlViewExporterSpi}} is passed to 
> {{IgniteConfiguration.setSystemViewExporterSpi()}}. Now, if an user 
> configures some {{SystemViewExporterSpi}} then provided user configuration 
> will rewrite default configuration and {{SqlViewExporterSpi}} won't be 
> initialized. As result it is impossible to query system views and any query 
> to the views fails with exception. This behavior is not obvious for the user. 
> See tests below.
> The second problem is kind of design problem. System view is internal part of 
> the system and should be available regardless of any exporter configuration 
> (at least via SQL) such as it was implemented before 2.8 release. 
> My suggestion is the following: we should remove {{SqlViewExporterSpi}} and 
> configure all views on indexing module initialization. {{SqlViewExporterSPI}} 
> also doesn't make sense because:
> - it operates by some internal API ({{SchemaManager}}, {{GridKernalContext}}, 
> {{IgniteH2Indexing}}).
> - it doesn't allow to end user to add any new system view.
> Only thing that could be useful is a filtering. But it could be done with SQL.
> Reproducer of broken behavior:
> {code:java}
> package org.apache.ignite.internal.processors.cache.metric;
> import org.apache.ignite.cache.query.SqlFieldsQuery;
> import org.apache.ignite.cluster.ClusterState;
> import org.apache.ignite.configuration.DataRegionConfiguration;
> import org.apache.ignite.configuration.DataStorageConfiguration;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.internal.IgniteEx;
> import org.apache.ignite.spi.systemview.jmx.JmxSystemViewExporterSpi;
> import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
> import org.junit.Test;
> import java.util.HashSet;
> import java.util.List;
> import java.util.Set;
> import static java.util.Arrays.asList;
> import static 
> org.apache.ignite.internal.processors.cache.index.AbstractSchemaSelfTest.queryProcessor;
> public class SystemViewTest extends GridCommonAbstractTest {
> private static boolean useDefaultSpi;
> /** {@inheritDoc} */
> @Override protected IgniteConfiguration getConfiguration(String 
> igniteInstanceName) throws Exception {
> IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
> cfg.setConsistentId(igniteInstanceName);
> cfg.setDataStorageConfiguration(new DataStorageConfiguration()
> .setDataRegionConfigurations(
> new 
> DataRegionConfiguration().setName("in-memory").setMaxSize(100L * 1024 * 1024))
> .setDefaultDataRegionConfiguration(
> new DataRegionConfiguration()
> .setPersistenceEnabled(true)));
> if (!useDefaultSpi) {
> // Configure user provided system view exporter SPI.
> cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
> }
> return cfg;
> }
> /**
>  * Will executed succefully.
>  */
> @Test
> public void testSystemViewWithDefaultSpi() throws Exception {
> useDefaultSpi = true;
> doTestSystemView();
> }
> /**
>  * Will fail with Table "VIEWS" not found.
>  */
> @Test
> public void testSystemViewWithCustomSpi() throws Exception {
> useDefaultSpi = false;
> doTestSystemView();
> }
> private void doTestSystemView() throws Exception {
> try (IgniteEx ignite = startGrid()) {
> ignite.cluster().state(ClusterState.ACTIVE);
> Set cacheNames = new HashSet<>(asList("cache-1", 
> "cache-2"));
> for (String name : cacheNames)
> 

[jira] [Commented] (IGNITE-12921) System views design leads to bad user expirience.

2020-09-15 Thread Andrey N. Gura (Jira)


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

Andrey N. Gura commented on IGNITE-12921:
-

[~nizhikov] LGTM. Please proceed with merge. Thanks for this change.

> System views design leads to bad user expirience.
> -
>
> Key: IGNITE-12921
> URL: https://issues.apache.org/jira/browse/IGNITE-12921
> Project: Ignite
>  Issue Type: Bug
>Affects Versions: 2.8
>Reporter: Andrey N. Gura
>Assignee: Nikolay Izhikov
>Priority: Critical
>  Labels: IEP-35
> Fix For: 2.10
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Current implementation of system views has broken system behavior which is 
> related with querying system views. 
> Before 2.8 system views were available via SQL queries (if indexing is 
> enabled). It did not depend on any configuration. 
> After implementation of IGNITE-12145 system views available only if 
> {{SqlViewExporterSpi}} is passed to 
> {{IgniteConfiguration.setSystemViewExporterSpi()}}. Now, if an user 
> configures some {{SystemViewExporterSpi}} then provided user configuration 
> will rewrite default configuration and {{SqlViewExporterSpi}} won't be 
> initialized. As result it is impossible to query system views and any query 
> to the views fails with exception. This behavior is not obvious for the user. 
> See tests below.
> The second problem is kind of design problem. System view is internal part of 
> the system and should be available regardless of any exporter configuration 
> (at least via SQL) such as it was implemented before 2.8 release. 
> My suggestion is the following: we should remove {{SqlViewExporterSpi}} and 
> configure all views on indexing module initialization. {{SqlViewExporterSPI}} 
> also doesn't make sense because:
> - it operates by some internal API ({{SchemaManager}}, {{GridKernalContext}}, 
> {{IgniteH2Indexing}}).
> - it doesn't allow to end user to add any new system view.
> Only thing that could be useful is a filtering. But it could be done with SQL.
> Reproducer of broken behavior:
> {code:java}
> package org.apache.ignite.internal.processors.cache.metric;
> import org.apache.ignite.cache.query.SqlFieldsQuery;
> import org.apache.ignite.cluster.ClusterState;
> import org.apache.ignite.configuration.DataRegionConfiguration;
> import org.apache.ignite.configuration.DataStorageConfiguration;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.internal.IgniteEx;
> import org.apache.ignite.spi.systemview.jmx.JmxSystemViewExporterSpi;
> import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
> import org.junit.Test;
> import java.util.HashSet;
> import java.util.List;
> import java.util.Set;
> import static java.util.Arrays.asList;
> import static 
> org.apache.ignite.internal.processors.cache.index.AbstractSchemaSelfTest.queryProcessor;
> public class SystemViewTest extends GridCommonAbstractTest {
> private static boolean useDefaultSpi;
> /** {@inheritDoc} */
> @Override protected IgniteConfiguration getConfiguration(String 
> igniteInstanceName) throws Exception {
> IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
> cfg.setConsistentId(igniteInstanceName);
> cfg.setDataStorageConfiguration(new DataStorageConfiguration()
> .setDataRegionConfigurations(
> new 
> DataRegionConfiguration().setName("in-memory").setMaxSize(100L * 1024 * 1024))
> .setDefaultDataRegionConfiguration(
> new DataRegionConfiguration()
> .setPersistenceEnabled(true)));
> if (!useDefaultSpi) {
> // Configure user provided system view exporter SPI.
> cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
> }
> return cfg;
> }
> /**
>  * Will executed succefully.
>  */
> @Test
> public void testSystemViewWithDefaultSpi() throws Exception {
> useDefaultSpi = true;
> doTestSystemView();
> }
> /**
>  * Will fail with Table "VIEWS" not found.
>  */
> @Test
> public void testSystemViewWithCustomSpi() throws Exception {
> useDefaultSpi = false;
> doTestSystemView();
> }
> private void doTestSystemView() throws Exception {
> try (IgniteEx ignite = startGrid()) {
> ignite.cluster().state(ClusterState.ACTIVE);
> Set cacheNames = new HashSet<>(asList("cache-1", 
> "cache-2"));
> for (String name : cacheNames)
> ignite.getOrCreateCache(name);
> SqlFieldsQuery qry = new SqlFieldsQuery("SELECT * FROM 
> SYS.VIEWS");
> List> res 

[jira] [Commented] (IGNITE-12921) System views design leads to bad user expirience.

2020-08-17 Thread Andrey N. Gura (Jira)


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

Andrey N. Gura commented on IGNITE-12921:
-

[~nizhikov] Thanks! Could you please take a look at my review comments?

> System views design leads to bad user expirience.
> -
>
> Key: IGNITE-12921
> URL: https://issues.apache.org/jira/browse/IGNITE-12921
> Project: Ignite
>  Issue Type: Bug
>Affects Versions: 2.8
>Reporter: Andrey N. Gura
>Assignee: Nikolay Izhikov
>Priority: Critical
>  Labels: IEP-35
> Fix For: 2.10
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Current implementation of system views has broken system behavior which is 
> related with querying system views. 
> Before 2.8 system views were available via SQL queries (if indexing is 
> enabled). It did not depend on any configuration. 
> After implementation of IGNITE-12145 system views available only if 
> {{SqlViewExporterSpi}} is passed to 
> {{IgniteConfiguration.setSystemViewExporterSpi()}}. Now, if an user 
> configures some {{SystemViewExporterSpi}} then provided user configuration 
> will rewrite default configuration and {{SqlViewExporterSpi}} won't be 
> initialized. As result it is impossible to query system views and any query 
> to the views fails with exception. This behavior is not obvious for the user. 
> See tests below.
> The second problem is kind of design problem. System view is internal part of 
> the system and should be available regardless of any exporter configuration 
> (at least via SQL) such as it was implemented before 2.8 release. 
> My suggestion is the following: we should remove {{SqlViewExporterSpi}} and 
> configure all views on indexing module initialization. {{SqlViewExporterSPI}} 
> also doesn't make sense because:
> - it operates by some internal API ({{SchemaManager}}, {{GridKernalContext}}, 
> {{IgniteH2Indexing}}).
> - it doesn't allow to end user to add any new system view.
> Only thing that could be useful is a filtering. But it could be done with SQL.
> Reproducer of broken behavior:
> {code:java}
> package org.apache.ignite.internal.processors.cache.metric;
> import org.apache.ignite.cache.query.SqlFieldsQuery;
> import org.apache.ignite.cluster.ClusterState;
> import org.apache.ignite.configuration.DataRegionConfiguration;
> import org.apache.ignite.configuration.DataStorageConfiguration;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.internal.IgniteEx;
> import org.apache.ignite.spi.systemview.jmx.JmxSystemViewExporterSpi;
> import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
> import org.junit.Test;
> import java.util.HashSet;
> import java.util.List;
> import java.util.Set;
> import static java.util.Arrays.asList;
> import static 
> org.apache.ignite.internal.processors.cache.index.AbstractSchemaSelfTest.queryProcessor;
> public class SystemViewTest extends GridCommonAbstractTest {
> private static boolean useDefaultSpi;
> /** {@inheritDoc} */
> @Override protected IgniteConfiguration getConfiguration(String 
> igniteInstanceName) throws Exception {
> IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
> cfg.setConsistentId(igniteInstanceName);
> cfg.setDataStorageConfiguration(new DataStorageConfiguration()
> .setDataRegionConfigurations(
> new 
> DataRegionConfiguration().setName("in-memory").setMaxSize(100L * 1024 * 1024))
> .setDefaultDataRegionConfiguration(
> new DataRegionConfiguration()
> .setPersistenceEnabled(true)));
> if (!useDefaultSpi) {
> // Configure user provided system view exporter SPI.
> cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
> }
> return cfg;
> }
> /**
>  * Will executed succefully.
>  */
> @Test
> public void testSystemViewWithDefaultSpi() throws Exception {
> useDefaultSpi = true;
> doTestSystemView();
> }
> /**
>  * Will fail with Table "VIEWS" not found.
>  */
> @Test
> public void testSystemViewWithCustomSpi() throws Exception {
> useDefaultSpi = false;
> doTestSystemView();
> }
> private void doTestSystemView() throws Exception {
> try (IgniteEx ignite = startGrid()) {
> ignite.cluster().state(ClusterState.ACTIVE);
> Set cacheNames = new HashSet<>(asList("cache-1", 
> "cache-2"));
> for (String name : cacheNames)
> ignite.getOrCreateCache(name);
> SqlFieldsQuery qry = new SqlFieldsQuery("SELECT * FROM 
> SYS.VIEWS");
> List> 

[jira] [Commented] (IGNITE-12921) System views design leads to bad user expirience.

2020-08-10 Thread Nikolay Izhikov (Jira)


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

Nikolay Izhikov commented on IGNITE-12921:
--

Hello, [~agura] can you please, take a look at my changes?



> System views design leads to bad user expirience.
> -
>
> Key: IGNITE-12921
> URL: https://issues.apache.org/jira/browse/IGNITE-12921
> Project: Ignite
>  Issue Type: Bug
>Affects Versions: 2.8
>Reporter: Andrey N. Gura
>Assignee: Nikolay Izhikov
>Priority: Critical
>  Labels: IEP-35
> Fix For: 2.10
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Current implementation of system views has broken system behavior which is 
> related with querying system views. 
> Before 2.8 system views were available via SQL queries (if indexing is 
> enabled). It did not depend on any configuration. 
> After implementation of IGNITE-12145 system views available only if 
> {{SqlViewExporterSpi}} is passed to 
> {{IgniteConfiguration.setSystemViewExporterSpi()}}. Now, if an user 
> configures some {{SystemViewExporterSpi}} then provided user configuration 
> will rewrite default configuration and {{SqlViewExporterSpi}} won't be 
> initialized. As result it is impossible to query system views and any query 
> to the views fails with exception. This behavior is not obvious for the user. 
> See tests below.
> The second problem is kind of design problem. System view is internal part of 
> the system and should be available regardless of any exporter configuration 
> (at least via SQL) such as it was implemented before 2.8 release. 
> My suggestion is the following: we should remove {{SqlViewExporterSpi}} and 
> configure all views on indexing module initialization. {{SqlViewExporterSPI}} 
> also doesn't make sense because:
> - it operates by some internal API ({{SchemaManager}}, {{GridKernalContext}}, 
> {{IgniteH2Indexing}}).
> - it doesn't allow to end user to add any new system view.
> Only thing that could be useful is a filtering. But it could be done with SQL.
> Reproducer of broken behavior:
> {code:java}
> package org.apache.ignite.internal.processors.cache.metric;
> import org.apache.ignite.cache.query.SqlFieldsQuery;
> import org.apache.ignite.cluster.ClusterState;
> import org.apache.ignite.configuration.DataRegionConfiguration;
> import org.apache.ignite.configuration.DataStorageConfiguration;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.internal.IgniteEx;
> import org.apache.ignite.spi.systemview.jmx.JmxSystemViewExporterSpi;
> import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
> import org.junit.Test;
> import java.util.HashSet;
> import java.util.List;
> import java.util.Set;
> import static java.util.Arrays.asList;
> import static 
> org.apache.ignite.internal.processors.cache.index.AbstractSchemaSelfTest.queryProcessor;
> public class SystemViewTest extends GridCommonAbstractTest {
> private static boolean useDefaultSpi;
> /** {@inheritDoc} */
> @Override protected IgniteConfiguration getConfiguration(String 
> igniteInstanceName) throws Exception {
> IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
> cfg.setConsistentId(igniteInstanceName);
> cfg.setDataStorageConfiguration(new DataStorageConfiguration()
> .setDataRegionConfigurations(
> new 
> DataRegionConfiguration().setName("in-memory").setMaxSize(100L * 1024 * 1024))
> .setDefaultDataRegionConfiguration(
> new DataRegionConfiguration()
> .setPersistenceEnabled(true)));
> if (!useDefaultSpi) {
> // Configure user provided system view exporter SPI.
> cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
> }
> return cfg;
> }
> /**
>  * Will executed succefully.
>  */
> @Test
> public void testSystemViewWithDefaultSpi() throws Exception {
> useDefaultSpi = true;
> doTestSystemView();
> }
> /**
>  * Will fail with Table "VIEWS" not found.
>  */
> @Test
> public void testSystemViewWithCustomSpi() throws Exception {
> useDefaultSpi = false;
> doTestSystemView();
> }
> private void doTestSystemView() throws Exception {
> try (IgniteEx ignite = startGrid()) {
> ignite.cluster().state(ClusterState.ACTIVE);
> Set cacheNames = new HashSet<>(asList("cache-1", 
> "cache-2"));
> for (String name : cacheNames)
> ignite.getOrCreateCache(name);
> SqlFieldsQuery qry = new SqlFieldsQuery("SELECT * FROM 
> SYS.VIEWS");
> List> res = 

[jira] [Commented] (IGNITE-12921) System views design leads to bad user expirience.

2020-07-10 Thread Aleksey Plekhanov (Jira)


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

Aleksey Plekhanov commented on IGNITE-12921:


[~agura], [~nizhikov], does anyone have plans to work on this ticket to resolve 
it in 2.9 release? Should we move this ticket to the next release?

> System views design leads to bad user expirience.
> -
>
> Key: IGNITE-12921
> URL: https://issues.apache.org/jira/browse/IGNITE-12921
> Project: Ignite
>  Issue Type: Bug
>Affects Versions: 2.8
>Reporter: Andrey N. Gura
>Priority: Critical
>  Labels: IEP-35
> Fix For: 2.9
>
>
> Current implementation of system views has broken system behavior which is 
> related with querying system views. 
> Before 2.8 system views were available via SQL queries (if indexing is 
> enabled). It did not depend on any configuration. 
> After implementation of IGNITE-12145 system views available only if 
> {{SqlViewExporterSpi}} is passed to 
> {{IgniteConfiguration.setSystemViewExporterSpi()}}. Now, if an user 
> configures some {{SystemViewExporterSpi}} then provided user configuration 
> will rewrite default configuration and {{SqlViewExporterSpi}} won't be 
> initialized. As result it is impossible to query system views and any query 
> to the views fails with exception. This behavior is not obvious for the user. 
> See tests below.
> The second problem is kind of design problem. System view is internal part of 
> the system and should be available regardless of any exporter configuration 
> (at least via SQL) such as it was implemented before 2.8 release. 
> My suggestion is the following: we should remove {{SqlViewExporterSpi}} and 
> configure all views on indexing module initialization. {{SqlViewExporterSPI}} 
> also doesn't make sense because:
> - it operates by some internal API ({{SchemaManager}}, {{GridKernalContext}}, 
> {{IgniteH2Indexing}}).
> - it doesn't allow to end user to add any new system view.
> Only thing that could be useful is a filtering. But it could be done with SQL.
> Reproducer of broken behavior:
> {code:java}
> package org.apache.ignite.internal.processors.cache.metric;
> import org.apache.ignite.cache.query.SqlFieldsQuery;
> import org.apache.ignite.cluster.ClusterState;
> import org.apache.ignite.configuration.DataRegionConfiguration;
> import org.apache.ignite.configuration.DataStorageConfiguration;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.internal.IgniteEx;
> import org.apache.ignite.spi.systemview.jmx.JmxSystemViewExporterSpi;
> import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
> import org.junit.Test;
> import java.util.HashSet;
> import java.util.List;
> import java.util.Set;
> import static java.util.Arrays.asList;
> import static 
> org.apache.ignite.internal.processors.cache.index.AbstractSchemaSelfTest.queryProcessor;
> public class SystemViewTest extends GridCommonAbstractTest {
> private static boolean useDefaultSpi;
> /** {@inheritDoc} */
> @Override protected IgniteConfiguration getConfiguration(String 
> igniteInstanceName) throws Exception {
> IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
> cfg.setConsistentId(igniteInstanceName);
> cfg.setDataStorageConfiguration(new DataStorageConfiguration()
> .setDataRegionConfigurations(
> new 
> DataRegionConfiguration().setName("in-memory").setMaxSize(100L * 1024 * 1024))
> .setDefaultDataRegionConfiguration(
> new DataRegionConfiguration()
> .setPersistenceEnabled(true)));
> if (!useDefaultSpi) {
> // Configure user provided system view exporter SPI.
> cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
> }
> return cfg;
> }
> /**
>  * Will executed succefully.
>  */
> @Test
> public void testSystemViewWithDefaultSpi() throws Exception {
> useDefaultSpi = true;
> doTestSystemView();
> }
> /**
>  * Will fail with Table "VIEWS" not found.
>  */
> @Test
> public void testSystemViewWithCustomSpi() throws Exception {
> useDefaultSpi = false;
> doTestSystemView();
> }
> private void doTestSystemView() throws Exception {
> try (IgniteEx ignite = startGrid()) {
> ignite.cluster().state(ClusterState.ACTIVE);
> Set cacheNames = new HashSet<>(asList("cache-1", 
> "cache-2"));
> for (String name : cacheNames)
> ignite.getOrCreateCache(name);
> SqlFieldsQuery qry = new SqlFieldsQuery("SELECT * FROM 
> SYS.VIEWS");
> List> res = 

[jira] [Commented] (IGNITE-12921) System views design leads to bad user expirience.

2020-04-22 Thread Nikolay Izhikov (Jira)


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

Nikolay Izhikov commented on IGNITE-12921:
--

Hello, [~agura] Thanks for the tickets! 

I think this improvement should be included in 2.9 release because 2.8.1 is a 
bugfix release.


> System views design leads to bad user expirience.
> -
>
> Key: IGNITE-12921
> URL: https://issues.apache.org/jira/browse/IGNITE-12921
> Project: Ignite
>  Issue Type: Bug
>Affects Versions: 2.8
>Reporter: Andrey N. Gura
>Priority: Critical
>  Labels: IEP-35
> Fix For: 2.8.1
>
>
> Current implementation of system views has broken system behavior which is 
> related with querying system views. 
> Before 2.8 system views were available via SQL queries (if indexing is 
> enabled). It did not depend on any configuration. 
> After implementation of IGNITE-12145 system views available only if 
> {{SqlViewExporterSpi}} is passed to 
> {{IgniteConfiguration.setSystemViewExporterSpi()}}. Now, if an user 
> configures some {{SystemViewExporterSpi}} then provided user configuration 
> will rewrite default configuration and {{SqlViewExporterSpi}} won't be 
> initialized. As result it is impossible to query system views and any query 
> to the views fails with exception. This behavior is not obvious for the user. 
> See tests below.
> The second problem is kind of design problem. System view is internal part of 
> the system and should be available regardless of any exporter configuration 
> (at least via SQL) such as it was implemented before 2.8 release. 
> My suggestion is the following: we should remove {{SqlViewExporterSpi}} and 
> configure all views on indexing module initialization. {{SqlViewExporterSPI}} 
> also doesn't make sense because:
> - it operates by some internal API ({{SchemaManager}}, {{GridKernalContext}}, 
> {{IgniteH2Indexing}}).
> - it doesn't allow to end user to add any new system view.
> Only thing that could be useful is a filtering. But it could be done with SQL.
> Reproducer of broken behavior:
> {code:java}
> package org.apache.ignite.internal.processors.cache.metric;
> import org.apache.ignite.cache.query.SqlFieldsQuery;
> import org.apache.ignite.cluster.ClusterState;
> import org.apache.ignite.configuration.DataRegionConfiguration;
> import org.apache.ignite.configuration.DataStorageConfiguration;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.internal.IgniteEx;
> import org.apache.ignite.spi.systemview.jmx.JmxSystemViewExporterSpi;
> import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
> import org.junit.Test;
> import java.util.HashSet;
> import java.util.List;
> import java.util.Set;
> import static java.util.Arrays.asList;
> import static 
> org.apache.ignite.internal.processors.cache.index.AbstractSchemaSelfTest.queryProcessor;
> public class SystemViewTest extends GridCommonAbstractTest {
> private static boolean useDefaultSpi;
> /** {@inheritDoc} */
> @Override protected IgniteConfiguration getConfiguration(String 
> igniteInstanceName) throws Exception {
> IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
> cfg.setConsistentId(igniteInstanceName);
> cfg.setDataStorageConfiguration(new DataStorageConfiguration()
> .setDataRegionConfigurations(
> new 
> DataRegionConfiguration().setName("in-memory").setMaxSize(100L * 1024 * 1024))
> .setDefaultDataRegionConfiguration(
> new DataRegionConfiguration()
> .setPersistenceEnabled(true)));
> if (!useDefaultSpi) {
> // Configure user provided system view exporter SPI.
> cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
> }
> return cfg;
> }
> /**
>  * Will executed succefully.
>  */
> @Test
> public void testSystemViewWithDefaultSpi() throws Exception {
> useDefaultSpi = true;
> doTestSystemView();
> }
> /**
>  * Will fail with Table "VIEWS" not found.
>  */
> @Test
> public void testSystemViewWithCustomSpi() throws Exception {
> useDefaultSpi = false;
> doTestSystemView();
> }
> private void doTestSystemView() throws Exception {
> try (IgniteEx ignite = startGrid()) {
> ignite.cluster().state(ClusterState.ACTIVE);
> Set cacheNames = new HashSet<>(asList("cache-1", 
> "cache-2"));
> for (String name : cacheNames)
> ignite.getOrCreateCache(name);
> SqlFieldsQuery qry = new SqlFieldsQuery("SELECT * FROM 
> SYS.VIEWS");
> List> res =