You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2018/01/26 08:20:14 UTC
ignite git commit: IGNITE-7003: Fixed SQL WAL enable/disable command
usability: throw exception in case of change failure.
Repository: ignite
Updated Branches:
refs/heads/ignite-2.4 cde2176a7 -> 80736ccd7
IGNITE-7003: Fixed SQL WAL enable/disable command usability: throw exception in case of change failure.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/80736ccd
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/80736ccd
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/80736ccd
Branch: refs/heads/ignite-2.4
Commit: 80736ccd7e13b0d3438d2ffed25fed989edaf204
Parents: cde2176
Author: devozerov <vo...@gridgain.com>
Authored: Fri Jan 26 11:20:06 2018 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Fri Jan 26 11:20:06 2018 +0300
----------------------------------------------------------------------
.../thin/JdbcThinWalModeChangeSelfTest.java | 37 ++++++++++++++++----
.../WalModeChangeCommonAbstractSelfTest.java | 3 +-
.../query/h2/ddl/DdlStatementsProcessor.java | 16 ++++++---
.../config/benchmark-atomic.properties | 2 +-
4 files changed, 45 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/80736ccd/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinWalModeChangeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinWalModeChangeSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinWalModeChangeSelfTest.java
index 6a3ac52..2497d68 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinWalModeChangeSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinWalModeChangeSelfTest.java
@@ -26,6 +26,7 @@ import org.apache.ignite.internal.processors.query.QueryUtils;
import java.sql.Connection;
import java.sql.DriverManager;
+import java.sql.SQLException;
import java.sql.Statement;
/**
@@ -64,20 +65,44 @@ public class JdbcThinWalModeChangeSelfTest extends WalModeChangeAbstractSelfTest
/** {@inheritDoc} */
@Override protected boolean walEnable(Ignite node, String cacheName) {
- String cmd = "ALTER TABLE " + cacheName + " LOGGING";
+ try {
+ String cmd = "ALTER TABLE " + cacheName + " LOGGING";
- execute(node, cmd);
+ execute(node, cmd);
+
+ return true;
+ }
+ catch (RuntimeException e) {
+ if (e.getCause() != null && e.getCause() instanceof SQLException) {
+ SQLException e0 = (SQLException)e.getCause();
- return false;
+ if (e0.getMessage().startsWith("Logging already enabled"))
+ return false;
+ }
+
+ throw e;
+ }
}
/** {@inheritDoc} */
@Override protected boolean walDisable(Ignite node, String cacheName) {
- String cmd = "ALTER TABLE " + cacheName + " NOLOGGING";
+ try {
+ String cmd = "ALTER TABLE " + cacheName + " NOLOGGING";
- execute(node, cmd);
+ execute(node, cmd);
+
+ return true;
+ }
+ catch (RuntimeException e) {
+ if (e.getCause() != null && e.getCause() instanceof SQLException) {
+ SQLException e0 = (SQLException)e.getCause();
- return false;
+ if (e0.getMessage().startsWith("Logging already disabled"))
+ return false;
+ }
+
+ throw e;
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/80736ccd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/WalModeChangeCommonAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/WalModeChangeCommonAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/WalModeChangeCommonAbstractSelfTest.java
index 4467f7e..2e458f2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/WalModeChangeCommonAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/WalModeChangeCommonAbstractSelfTest.java
@@ -161,8 +161,7 @@ public abstract class WalModeChangeCommonAbstractSelfTest extends GridCommonAbst
protected void assertWalEnable(Ignite node, String cacheName, boolean expRes) {
boolean res = walEnable(node, cacheName);
- if (!jdbc)
- assertEquals(expRes, res);
+ assertEquals(expRes, res);
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/80736ccd/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ddl/DdlStatementsProcessor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ddl/DdlStatementsProcessor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ddl/DdlStatementsProcessor.java
index 2630239..ca7680a 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ddl/DdlStatementsProcessor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/ddl/DdlStatementsProcessor.java
@@ -188,10 +188,18 @@ public class DdlStatementsProcessor {
IgniteCluster cluster = ctx.grid().cluster();
- if (logging)
- cluster.enableWal(tbl.cacheName());
- else
- cluster.disableWal(tbl.cacheName());
+ if (logging) {
+ boolean res = cluster.enableWal(tbl.cacheName());
+
+ if (!res)
+ throw new IgniteSQLException("Logging already enabled for table: " + cmd0.tableName());
+ }
+ else {
+ boolean res = cluster.disableWal(tbl.cacheName());
+
+ if (!res)
+ throw new IgniteSQLException("Logging already disabled for table: " + cmd0.tableName());
+ }
fut = new GridFinishedFuture();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/80736ccd/modules/yardstick/config/benchmark-atomic.properties
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/benchmark-atomic.properties b/modules/yardstick/config/benchmark-atomic.properties
index 8e2413b..1f4e0c3 100644
--- a/modules/yardstick/config/benchmark-atomic.properties
+++ b/modules/yardstick/config/benchmark-atomic.properties
@@ -74,7 +74,7 @@ sm=PRIMARY_SYNC
# Run configuration.
# Note that each benchmark is set to run for 300 seconds (5 min) with warm-up set to 60 seconds (1 minute).
CONFIGS="\
--cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -dn IgniteGetBenchmark -sn IgniteNode -ds ${ver}atomic-get-${b}-backup,\
+-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -dn IgniteGetBenchmark -sn IgniteNode -ds ${ver}atomic-get-${b}-backup --single-shot ,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -dn IgnitePutGetBenchmark -sn IgniteNode -ds ${ver}atomic-put-get-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -dn IgnitePutBenchmark -sn IgniteNode -ds ${ver}atomic-put-${b}-backup,\
"