[ignite] branch master updated: IGNITE-13716 Fixed an issue where control utility did not hide sensitive information. Fixes #8471
This is an automated email from the ASF dual-hosted git repository. sk0x50 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ignite.git The following commit(s) were added to refs/heads/master by this push: new f5dfac2 IGNITE-13716 Fixed an issue where control utility did not hide sensitive information. Fixes #8471 f5dfac2 is described below commit f5dfac22bd79fd0f13cce9840fe20114ab718976 Author: Slava Koptilin AuthorDate: Wed Dec 2 01:32:03 2020 +0300 IGNITE-13716 Fixed an issue where control utility did not hide sensitive information. Fixes #8471 --- .../internal/commandline/CommandHandler.java | 33 +++- .../internal/commandline/CommonArgParser.java | 15 ++ .../GridCommandHandlerSslWithSecurityTest.java | 59 +- 3 files changed, 104 insertions(+), 3 deletions(-) diff --git a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java index a612e1c..14c8799 100644 --- a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java +++ b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java @@ -46,6 +46,7 @@ import org.apache.ignite.internal.client.impl.connection.GridClientConnectionRes import org.apache.ignite.internal.client.ssl.GridSslBasicContextFactory; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.X; +import org.apache.ignite.internal.util.typedef.internal.SB; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.logger.java.JavaLoggerFileHandler; import org.apache.ignite.logger.java.JavaLoggerFormatter; @@ -266,7 +267,7 @@ public class CommandHandler { } logger.info("Command [" + commandName + "] started"); -logger.info("Arguments: " + String.join(" ", rawArgs)); +logger.info("Arguments: " + argumentsToString(rawArgs)); logger.info(DELIM); lastOperationRes = command.execute(clientCfg, logger, args.verbose()); @@ -455,6 +456,36 @@ public class CommandHandler { } /** + * Joins user's arguments and hides sensitive information. + * + * @param rawArgs Arguments which user has provided. + * @return String which could be shown in console and pritned to log. + */ +private String argumentsToString(List rawArgs) { +boolean hide = false; + +SB sb = new SB(); + +for (int i = 0; i < rawArgs.size(); i++) { +if (hide) { +sb.a("* "); + +hide = false; + +continue; +} + +String arg = rawArgs.get(i); + +sb.a(arg).a(' '); + +hide = CommonArgParser.isSensitiveArgument(arg); +} + +return sb.toString(); +} + +/** * Does one of three things: * * returns user name from connection parameters if it is there; diff --git a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/CommonArgParser.java b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/CommonArgParser.java index 52e95f4..e27179d 100644 --- a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/CommonArgParser.java +++ b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/CommonArgParser.java @@ -103,6 +103,9 @@ public class CommonArgParser { /** List of optional auxiliary commands. */ private static final Set AUX_COMMANDS = new HashSet<>(); +/** Set of sensitive arguments */ +private static final Set SENSITIVE_ARGUMENTS = new HashSet<>(); + static { AUX_COMMANDS.add(CMD_HOST); AUX_COMMANDS.add(CMD_PORT); @@ -127,6 +130,18 @@ public class CommonArgParser { AUX_COMMANDS.add(CMD_TRUSTSTORE); AUX_COMMANDS.add(CMD_TRUSTSTORE_PASSWORD); AUX_COMMANDS.add(CMD_TRUSTSTORE_TYPE); + +SENSITIVE_ARGUMENTS.add(CMD_PASSWORD); +SENSITIVE_ARGUMENTS.add(CMD_KEYSTORE_PASSWORD); +SENSITIVE_ARGUMENTS.add(CMD_TRUSTSTORE_PASSWORD); +} + +/** + * @param arg To check. + * @return True if provided argument is among sensitive one and not should be displayed. + */ +public static boolean isSensitiveArgument(String arg) { +return SENSITIVE_ARGUMENTS.contains(arg); } /** diff --git a/modules/control-utility/src/test/java/org/apache/ignite/internal/processors/security/GridCommandHandlerSslWithSecurityTest.java b/modules/control-utility/src/test/java/org/apache/ignite/internal/processors/security/GridCommandHandlerSslWithSecurityTest.java index 18a60ca..a34c619 100644 ---
[ignite-extensions] annotated tag ignite-flume-ext-1.0.0 created (now aa2c59e)
This is an automated email from the ASF dual-hosted git repository. agoncharuk pushed a change to annotated tag ignite-flume-ext-1.0.0 in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git. at aa2c59e (tag) tagging 3f45b3e32d617b652e08af614a90aad6b9ff945d (commit) by Alexey Goncharuk on Mon Nov 23 16:03:35 2020 +0300 - Log - Releasing ignite-flume-ext-1.0.0-rc1 --- No new revisions were added by this update.
[ignite-extensions] annotated tag ignite-flink-ext-1.0.0 created (now ebb68db)
This is an automated email from the ASF dual-hosted git repository. agoncharuk pushed a change to annotated tag ignite-flink-ext-1.0.0 in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git. at ebb68db (tag) tagging 3f45b3e32d617b652e08af614a90aad6b9ff945d (commit) by Alexey Goncharuk on Mon Nov 23 16:03:35 2020 +0300 - Log - Releasing ignite-flink-ext-1.0.0-rc1 --- No new revisions were added by this update.
[ignite-extensions] annotated tag ignite-mqtt-ext-1.0.0 created (now ce071fb)
This is an automated email from the ASF dual-hosted git repository. agoncharuk pushed a change to annotated tag ignite-mqtt-ext-1.0.0 in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git. at ce071fb (tag) tagging 3f45b3e32d617b652e08af614a90aad6b9ff945d (commit) by Alexey Goncharuk on Mon Nov 23 16:03:35 2020 +0300 - Log - Releasing ignite-mqtt-ext-1.0.0-rc1 --- No new revisions were added by this update.
[ignite-extensions] annotated tag ignite-pub-sub-ext-1.0.0 created (now 65d68ad)
This is an automated email from the ASF dual-hosted git repository. agoncharuk pushed a change to annotated tag ignite-pub-sub-ext-1.0.0 in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git. at 65d68ad (tag) tagging 3f45b3e32d617b652e08af614a90aad6b9ff945d (commit) by Alexey Goncharuk on Mon Nov 23 16:03:35 2020 +0300 - Log - Releasing ignite-pub-sub-ext-1.0.0-rc1 --- No new revisions were added by this update.
[ignite-extensions] annotated tag ignite-camel-ext-1.0.0 created (now 57ca12b)
This is an automated email from the ASF dual-hosted git repository. agoncharuk pushed a change to annotated tag ignite-camel-ext-1.0.0 in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git. at 57ca12b (tag) tagging 3f45b3e32d617b652e08af614a90aad6b9ff945d (commit) by Alexey Goncharuk on Mon Nov 23 16:03:35 2020 +0300 - Log - Releasing ignite-camel-ext-1.0.0-rc1 --- No new revisions were added by this update.
[ignite-extensions] annotated tag ignite-rocketmq-ext-1.0.0 created (now c04faf7)
This is an automated email from the ASF dual-hosted git repository. agoncharuk pushed a change to annotated tag ignite-rocketmq-ext-1.0.0 in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git. at c04faf7 (tag) tagging 3f45b3e32d617b652e08af614a90aad6b9ff945d (commit) by Alexey Goncharuk on Mon Nov 23 16:03:35 2020 +0300 - Log - Releasing ignite-rocketmq-ext-1.0.0-rc1 --- No new revisions were added by this update.
[ignite-extensions] annotated tag ignite-zeromq-ext-1.0.0 created (now 4a63143)
This is an automated email from the ASF dual-hosted git repository. agoncharuk pushed a change to annotated tag ignite-zeromq-ext-1.0.0 in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git. at 4a63143 (tag) tagging 3f45b3e32d617b652e08af614a90aad6b9ff945d (commit) by Alexey Goncharuk on Mon Nov 23 16:03:35 2020 +0300 - Log - Releasing ignite-zeromq-ext-1.0.0-rc1 --- No new revisions were added by this update.
[ignite-extensions] annotated tag ignite-jms11-ext-1.0.0 created (now ed555c2)
This is an automated email from the ASF dual-hosted git repository. agoncharuk pushed a change to annotated tag ignite-jms11-ext-1.0.0 in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git. at ed555c2 (tag) tagging 3f45b3e32d617b652e08af614a90aad6b9ff945d (commit) by Alexey Goncharuk on Mon Nov 23 16:03:35 2020 +0300 - Log - Releasing ignite-jms11-ext-1.0.0-rc1 --- No new revisions were added by this update.
[ignite-extensions] annotated tag ignite-storm-ext-1.0.0 created (now acd7ffd)
This is an automated email from the ASF dual-hosted git repository. agoncharuk pushed a change to annotated tag ignite-storm-ext-1.0.0 in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git. at acd7ffd (tag) tagging 3f45b3e32d617b652e08af614a90aad6b9ff945d (commit) by Alexey Goncharuk on Mon Nov 23 16:03:35 2020 +0300 - Log - Releasing ignite-storm-ext-1.0.0-rc1 --- No new revisions were added by this update.
[ignite-extensions] annotated tag ignite-twitter-ext-1.0.0 created (now 9fa9446)
This is an automated email from the ASF dual-hosted git repository. agoncharuk pushed a change to annotated tag ignite-twitter-ext-1.0.0 in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git. at 9fa9446 (tag) tagging 3f45b3e32d617b652e08af614a90aad6b9ff945d (commit) by Alexey Goncharuk on Mon Nov 23 16:03:35 2020 +0300 - Log - Releasing ignite-twitter-ext-1.0.0-rc1 --- No new revisions were added by this update.
[ignite-extensions] annotated tag ignite-kafka-ext-1.0.0 created (now a4e6ad3)
This is an automated email from the ASF dual-hosted git repository. agoncharuk pushed a change to annotated tag ignite-kafka-ext-1.0.0 in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git. at a4e6ad3 (tag) tagging 3f45b3e32d617b652e08af614a90aad6b9ff945d (commit) by Alexey Goncharuk on Mon Nov 23 16:03:35 2020 +0300 - Log - Releasing ignite-kafka-ext-1.0.0-rc1 --- No new revisions were added by this update.
[ignite] branch master updated (006c566 -> 2eaabd9)
This is an automated email from the ASF dual-hosted git repository. amashenkov pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/ignite.git. from 006c566 IGNITE-13765 Incorrect work of predicates (< and >) in where clause with compound primary key (closes #8510) add 2eaabd9 IGNITE-13756: Fix node crash if incorrect SQL query fails. (#8495) No new revisions were added by this update. Summary of changes: .../jdbc/thin/JdbcThinComplexQuerySelfTest.java| 36 +- 1 file changed, 35 insertions(+), 1 deletion(-)
[ignite] branch ignite-2.9.1 updated: IGNITE-13765 Incorrect work of predicates (< and >) in where clause with compound primary key (closes #8510)
This is an automated email from the ASF dual-hosted git repository. tledkov pushed a commit to branch ignite-2.9.1 in repository https://gitbox.apache.org/repos/asf/ignite.git The following commit(s) were added to refs/heads/ignite-2.9.1 by this push: new fc22988 IGNITE-13765 Incorrect work of predicates (< and >) in where clause with compound primary key (closes #8510) fc22988 is described below commit fc22988eb02fe6a7da6aebdb999bf62dc8d59642 Author: korlov42 AuthorDate: Tue Dec 1 12:26:58 2020 +0300 IGNITE-13765 Incorrect work of predicates (< and >) in where clause with compound primary key (closes #8510) (cherry picked from commit 006c566d6743d00c63eb816930b9c41f22e1e7a6) --- .../processors/query/h2/database/H2Tree.java | 34 ++ .../processors/query/h2/database/H2TreeIndex.java | 3 +- .../processors/cache/index/BasicIndexTest.java | 15 ++ 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java index 080c1b1..7950f67 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java @@ -577,6 +577,40 @@ public class H2Tree extends BPlusTree { } /** + * Checks both rows are the same. + * Primarly used to verify both search rows are the same and we can apply + * the single row lookup optimization. + * + * @param r1 The first row. + * @param r2 Another row. + * @return {@code true} in case both rows are efficiently the same, {@code false} otherwise. + */ +boolean checkRowsTheSame(H2Row r1, H2Row r2) { +if (r1 == r2) +return true; + +for (int i = 0, len = cols.length; i < len; i++) { +IndexColumn idxCol = cols[i]; + +int idx = idxCol.column.getColumnId(); + +Value v1 = r1.getValue(idx); +Value v2 = r2.getValue(idx); + +if (v1 == null && v2 == null) +continue; + +if (!(v1 != null && v2 != null)) +return false; + +if (compareValues(v1, v2) != 0) +return false; +} + +return true; +} + +/** * @param io IO. * @param pageAddr Page address. * @param idx Item index. diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java index b2d770e..6f5ffe4 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java @@ -25,6 +25,7 @@ import java.util.Map; import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; + import javax.cache.CacheException; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; @@ -384,7 +385,7 @@ public class H2TreeIndex extends H2TreeIndexBase { /** */ private boolean isSingleRowLookup(SearchRow lower, SearchRow upper, H2Tree tree) { return !cctx.mvccEnabled() && indexType.isPrimaryKey() && lower != null && upper != null && -tree.compareRows((H2Row)lower, (H2Row)upper) == 0 && hasAllIndexColumns(lower); +tree.checkRowsTheSame((H2Row)lower, (H2Row)upper) && hasAllIndexColumns(lower); } /** */ diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java index 7944e74..fe01d90 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java @@ -1183,6 +1183,21 @@ public class BasicIndexTest extends AbstractIndexingCommonTest { } /** */ +@Test +public void testOpenRangePredicateOnCompoundPk() throws Exception { +inlineSize = 10; + +startGrid(); + +sql("create table test (id1 int, id2 int, val int, constraint pk primary key (id1, id2))"); + +for (int i = 1; i <= 5; i++) +sql("insert into test (id1, id2, val) values (?, ?, ?)", 0, i, i); + +assertEquals(5, sql("select * from test where id1 = 0 and id2 > 0").getAll().size()); +} + +/** */ private void checkAll() { IgniteCache cache = grid(0).cache(DEFAULT_CACHE_NAME);
[ignite] branch master updated: IGNITE-13765 Incorrect work of predicates (< and >) in where clause with compound primary key (closes #8510)
This is an automated email from the ASF dual-hosted git repository. tledkov pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ignite.git The following commit(s) were added to refs/heads/master by this push: new 006c566 IGNITE-13765 Incorrect work of predicates (< and >) in where clause with compound primary key (closes #8510) 006c566 is described below commit 006c566d6743d00c63eb816930b9c41f22e1e7a6 Author: korlov42 AuthorDate: Tue Dec 1 12:26:58 2020 +0300 IGNITE-13765 Incorrect work of predicates (< and >) in where clause with compound primary key (closes #8510) --- .../processors/query/h2/database/H2Tree.java | 34 ++ .../processors/query/h2/database/H2TreeIndex.java | 3 +- .../processors/cache/index/BasicIndexTest.java | 15 ++ 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java index 99a0add..4fb9a41 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java @@ -626,6 +626,40 @@ public class H2Tree extends BPlusTree { } /** + * Checks both rows are the same. + * Primarly used to verify both search rows are the same and we can apply + * the single row lookup optimization. + * + * @param r1 The first row. + * @param r2 Another row. + * @return {@code true} in case both rows are efficiently the same, {@code false} otherwise. + */ +boolean checkRowsTheSame(H2Row r1, H2Row r2) { +if (r1 == r2) +return true; + +for (int i = 0, len = cols.length; i < len; i++) { +IndexColumn idxCol = cols[i]; + +int idx = idxCol.column.getColumnId(); + +Value v1 = r1.getValue(idx); +Value v2 = r2.getValue(idx); + +if (v1 == null && v2 == null) +continue; + +if (!(v1 != null && v2 != null)) +return false; + +if (compareValues(v1, v2) != 0) +return false; +} + +return true; +} + +/** * @param io IO. * @param pageAddr Page address. * @param idx Item index. diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java index 1b7ffe7..4701e8a 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java @@ -26,6 +26,7 @@ import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; + import javax.cache.CacheException; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; @@ -423,7 +424,7 @@ public class H2TreeIndex extends H2TreeIndexBase { /** */ private boolean isSingleRowLookup(SearchRow lower, SearchRow upper, H2Tree tree) { return !cctx.mvccEnabled() && indexType.isPrimaryKey() && lower != null && upper != null && -tree.compareRows((H2Row)lower, (H2Row)upper) == 0 && hasAllIndexColumns(lower); +tree.checkRowsTheSame((H2Row)lower, (H2Row)upper) && hasAllIndexColumns(lower); } /** */ diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java index 24a3759..9673af8 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java @@ -1373,6 +1373,21 @@ public class BasicIndexTest extends AbstractIndexingCommonTest { } /** */ +@Test +public void testOpenRangePredicateOnCompoundPk() throws Exception { +inlineSize = 10; + +startGrid(); + +sql("create table test (id1 int, id2 int, val int, constraint pk primary key (id1, id2))"); + +for (int i = 1; i <= 5; i++) +sql("insert into test (id1, id2, val) values (?, ?, ?)", 0, i, i); + +assertEquals(5, sql("select * from test where id1 = 0 and id2 > 0").getAll().size()); +} + +/** */ private void checkAll() { IgniteCache cache = grid(0).cache(DEFAULT_CACHE_NAME);
[ignite] branch ignite-ducktape updated: IGNITE-13778: fix startup_timeout_sec on discovery_test.py (#8519)
This is an automated email from the ASF dual-hosted git repository. av pushed a commit to branch ignite-ducktape in repository https://gitbox.apache.org/repos/asf/ignite.git The following commit(s) were added to refs/heads/ignite-ducktape by this push: new 1546a76 IGNITE-13778: fix startup_timeout_sec on discovery_test.py (#8519) 1546a76 is described below commit 1546a76a3e79a9bf9d359a0cd046d9e4b818db03 Author: Sergei Ryzhov AuthorDate: Tue Dec 1 11:09:25 2020 +0300 IGNITE-13778: fix startup_timeout_sec on discovery_test.py (#8519) --- modules/ducktests/tests/ignitetest/tests/discovery_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ducktests/tests/ignitetest/tests/discovery_test.py b/modules/ducktests/tests/ignitetest/tests/discovery_test.py index 1058830..b5fb66c 100644 --- a/modules/ducktests/tests/ignitetest/tests/discovery_test.py +++ b/modules/ducktests/tests/ignitetest/tests/discovery_test.py @@ -290,10 +290,11 @@ def start_servers(test_context, num_nodes, ignite_config, modules=None): """ servers = IgniteService(test_context, config=ignite_config, num_nodes=num_nodes, modules=modules, # mute spam in log. - jvm_opts=["-DIGNITE_DUMP_THREADS_ON_FAILURE=false"]) + jvm_opts=["-DIGNITE_DUMP_THREADS_ON_FAILURE=false"], +startup_timeout_sec=100) start = monotonic() -servers.start(timeout_sec=100) +servers.start() return servers, round(monotonic() - start, 1)