You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2023/10/17 03:21:01 UTC

[shardingsphere] branch 5.4.1-release updated (0c31811e961 -> a748f1fc7c6)

This is an automated email from the ASF dual-hosted git repository.

zhonghongsheng pushed a change to branch 5.4.1-release
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


    from 0c31811e961 Resolve dependencies conflict for guava (#28743)
     new 6d954275da9 Upgrade jetcd dependency version to 0.7.6; (#28780)
     new a748f1fc7c6 Improve PostgreSQL TestDecodingPlugin encoding (#28781)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../proxy-native/src/main/release-docs/LICENSE     |  8 +++----
 distribution/proxy/src/main/release-docs/LICENSE   |  8 +++----
 .../memory/SimpleMemoryPipelineChannelTest.java    |  8 +++----
 .../ingest/wal/decode/TestDecodingPlugin.java      |  3 ++-
 .../ingest/wal/decode/TestDecodingPluginTest.java  | 21 +++++++++-------
 mode/type/cluster/repository/provider/etcd/pom.xml |  4 ----
 pom.xml                                            | 28 +++++++++++++++++-----
 7 files changed, 48 insertions(+), 32 deletions(-)


[shardingsphere] 01/02: Upgrade jetcd dependency version to 0.7.6; (#28780)

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zhonghongsheng pushed a commit to branch 5.4.1-release
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git

commit 6d954275da941cf14c2695303ad4b3a5681d6b47
Author: Hongsheng Zhong <zh...@apache.org>
AuthorDate: Tue Oct 17 10:36:13 2023 +0800

    Upgrade jetcd dependency version to 0.7.6; (#28780)
    
    Replace grpc-all dependency to separated ones
    
    (cherry picked from commit 5c6a9685bb579f5fd39a6b38bf693d0fdc4fa42c)
---
 .../proxy-native/src/main/release-docs/LICENSE     |  8 +++----
 distribution/proxy/src/main/release-docs/LICENSE   |  8 +++----
 mode/type/cluster/repository/provider/etcd/pom.xml |  4 ----
 pom.xml                                            | 28 +++++++++++++++++-----
 4 files changed, 30 insertions(+), 18 deletions(-)

diff --git a/distribution/proxy-native/src/main/release-docs/LICENSE b/distribution/proxy-native/src/main/release-docs/LICENSE
index 5bed3db28bf..dea86439e86 100644
--- a/distribution/proxy-native/src/main/release-docs/LICENSE
+++ b/distribution/proxy-native/src/main/release-docs/LICENSE
@@ -259,10 +259,10 @@ The text of each license is the standard Apache 2.0 license.
     jackson-dataformat-yaml 2.14.0: http://github.com/FasterXML/jackson, Apache 2.0
     jackson-datatype-jsr310 2.14.0: http://github.com/FasterXML/jackson, Apache 2.0
     jcl-over-slf4j 1.7.36: https://github.com/qos-ch/slf4j, Apache 2.0
-    jetcd-api 0.7.5: https://github.com/etcd-io/jetcd, Apache 2.0
-    jetcd-common 0.7.5: https://github.com/etcd-io/jetcd, Apache 2.0
-    jetcd-core 0.7.5: https://github.com/etcd-io/jetcd, Apache 2.0
-    jetcd-grpc 0.7.5: https://github.com/etcd-io/jetcd, Apache 2.0
+    jetcd-api 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
+    jetcd-common 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
+    jetcd-core 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
+    jetcd-grpc 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
     json-path 2.8.0: https://github.com/jayway/JsonPath, Apache 2.0
     json-smart 2.4.10: https://www.minidev.net/, Apache 2.0
     json-simple 1.1.1: https://code.google.com/archive/p/json-simple/, Apache 2.0
diff --git a/distribution/proxy/src/main/release-docs/LICENSE b/distribution/proxy/src/main/release-docs/LICENSE
index 5bed3db28bf..dea86439e86 100644
--- a/distribution/proxy/src/main/release-docs/LICENSE
+++ b/distribution/proxy/src/main/release-docs/LICENSE
@@ -259,10 +259,10 @@ The text of each license is the standard Apache 2.0 license.
     jackson-dataformat-yaml 2.14.0: http://github.com/FasterXML/jackson, Apache 2.0
     jackson-datatype-jsr310 2.14.0: http://github.com/FasterXML/jackson, Apache 2.0
     jcl-over-slf4j 1.7.36: https://github.com/qos-ch/slf4j, Apache 2.0
-    jetcd-api 0.7.5: https://github.com/etcd-io/jetcd, Apache 2.0
-    jetcd-common 0.7.5: https://github.com/etcd-io/jetcd, Apache 2.0
-    jetcd-core 0.7.5: https://github.com/etcd-io/jetcd, Apache 2.0
-    jetcd-grpc 0.7.5: https://github.com/etcd-io/jetcd, Apache 2.0
+    jetcd-api 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
+    jetcd-common 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
+    jetcd-core 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
+    jetcd-grpc 0.7.6: https://github.com/etcd-io/jetcd, Apache 2.0
     json-path 2.8.0: https://github.com/jayway/JsonPath, Apache 2.0
     json-smart 2.4.10: https://www.minidev.net/, Apache 2.0
     json-simple 1.1.1: https://code.google.com/archive/p/json-simple/, Apache 2.0
diff --git a/mode/type/cluster/repository/provider/etcd/pom.xml b/mode/type/cluster/repository/provider/etcd/pom.xml
index ff846395d5c..50b9ac89329 100644
--- a/mode/type/cluster/repository/provider/etcd/pom.xml
+++ b/mode/type/cluster/repository/provider/etcd/pom.xml
@@ -44,9 +44,5 @@
             <groupId>io.etcd</groupId>
             <artifactId>jetcd-core</artifactId>
         </dependency>
-        <dependency>
-            <groupId>io.grpc</groupId>
-            <artifactId>grpc-all</artifactId>
-        </dependency>
     </dependencies>
 </project>
diff --git a/pom.xml b/pom.xml
index 2c819228684..df951f684d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -94,7 +94,7 @@
         
         <zookeeper.version>3.9.0</zookeeper.version>
         <curator.version>5.5.0</curator.version>
-        <jetcd.version>0.7.5</jetcd.version>
+        <jetcd.version>0.7.6</jetcd.version>
         <grpc.version>1.58.0</grpc.version>
         
         <elasticjob.version>3.0.3</elasticjob.version>
@@ -427,15 +427,31 @@
                         <groupId>io.netty</groupId>
                         <artifactId>netty-transport-native-unix-common</artifactId>
                     </exclusion>
-                    <exclusion>
-                        <groupId>io.grpc</groupId>
-                        <artifactId>*</artifactId>
-                    </exclusion>
                 </exclusions>
             </dependency>
             <dependency>
                 <groupId>io.grpc</groupId>
-                <artifactId>grpc-all</artifactId>
+                <artifactId>grpc-core</artifactId>
+                <version>${grpc.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.grpc</groupId>
+                <artifactId>grpc-netty</artifactId>
+                <version>${grpc.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.grpc</groupId>
+                <artifactId>grpc-protobuf</artifactId>
+                <version>${grpc.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.grpc</groupId>
+                <artifactId>grpc-stub</artifactId>
+                <version>${grpc.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.grpc</groupId>
+                <artifactId>grpc-grpclb</artifactId>
                 <version>${grpc.version}</version>
             </dependency>
             


[shardingsphere] 02/02: Improve PostgreSQL TestDecodingPlugin encoding (#28781)

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zhonghongsheng pushed a commit to branch 5.4.1-release
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git

commit a748f1fc7c67df63bd9d1f3a8f5c9bbeb870b115
Author: Hongsheng Zhong <zh...@apache.org>
AuthorDate: Tue Oct 17 11:16:30 2023 +0800

    Improve PostgreSQL TestDecodingPlugin encoding (#28781)
    
    * Improve SimpleMemoryPipelineChannelTest
    
    * Use UTF-8 for PostgreSQL TestDecodingPlugin
    
    (cherry picked from commit d1f4df8b0e9e6a8aeebb9eefda6594fe312d7c3b)
---
 .../memory/SimpleMemoryPipelineChannelTest.java     |  8 ++++----
 .../ingest/wal/decode/TestDecodingPlugin.java       |  3 ++-
 .../ingest/wal/decode/TestDecodingPluginTest.java   | 21 ++++++++++++---------
 3 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/common/ingest/channel/memory/SimpleMemoryPipelineChannelTest.java b/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/common/ingest/channel/memory/SimpleMemoryPipelineChannelTest.java
index eebc8ef17df..ad7af129271 100644
--- a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/common/ingest/channel/memory/SimpleMemoryPipelineChannelTest.java
+++ b/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/common/ingest/channel/memory/SimpleMemoryPipelineChannelTest.java
@@ -31,11 +31,11 @@ class SimpleMemoryPipelineChannelTest {
         SimpleMemoryPipelineChannel simpleMemoryPipelineChannel = new SimpleMemoryPipelineChannel(10, new EmptyAckCallback());
         long startMills = System.currentTimeMillis();
         simpleMemoryPipelineChannel.fetchRecords(1, 1, TimeUnit.MILLISECONDS);
-        long endMills = System.currentTimeMillis();
-        assertTrue(endMills - startMills >= 1 && endMills - startMills < 50);
+        long delta = System.currentTimeMillis() - startMills;
+        assertTrue(delta >= 1 && delta < 50, "Delta is not in [1,50) : " + delta);
         startMills = System.currentTimeMillis();
         simpleMemoryPipelineChannel.fetchRecords(1, 500, TimeUnit.MILLISECONDS);
-        endMills = System.currentTimeMillis();
-        assertTrue(endMills - startMills >= 500 && endMills - startMills < 600);
+        delta = System.currentTimeMillis() - startMills;
+        assertTrue(delta >= 500 && delta < 650, "Delta is not in [500,650) : " + delta);
     }
 }
diff --git a/kernel/data-pipeline/dialect/postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPlugin.java b/kernel/data-pipeline/dialect/postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPlugin.java
index a8c5499c658..17532f617dc 100644
--- a/kernel/data-pipeline/dialect/postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPlugin.java
+++ b/kernel/data-pipeline/dialect/postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPlugin.java
@@ -32,6 +32,7 @@ import org.apache.shardingsphere.data.pipeline.postgresql.ingest.wal.event.Write
 
 import java.math.BigDecimal;
 import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
 import java.sql.Date;
 import java.sql.SQLException;
 import java.util.LinkedList;
@@ -252,7 +253,7 @@ public final class TestDecodingPlugin implements DecodingPlugin {
         for (int i = 0; i < offset; i++) {
             result[i] = data.get(startPosition + i);
         }
-        return new String(result);
+        return new String(result, StandardCharsets.UTF_8);
     }
     
     private String readNextString(final ByteBuffer data) {
diff --git a/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPluginTest.java b/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPluginTest.java
index 7689aa706f1..8ed9a27ed28 100644
--- a/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPluginTest.java
+++ b/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPluginTest.java
@@ -28,6 +28,7 @@ import org.postgresql.jdbc.TimestampUtils;
 import org.postgresql.replication.LogSequenceNumber;
 
 import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
 import java.sql.SQLException;
 
 import static org.hamcrest.CoreMatchers.instanceOf;
@@ -47,7 +48,7 @@ class TestDecodingPluginTest {
     @Test
     void assertDecodeWriteRowEvent() {
         ByteBuffer data = ByteBuffer.wrap(("table public.test: INSERT: data[character varying]:' 1 2 3'' 😊中' t_json_empty[json]:'{}' t_json[json]:'{\"test\":\"中中{中中}' 中\"}'"
-                + " t_jsonb[jsonb]:'{\"test\":\"😊Emoji中\"}'").getBytes());
+                + " t_jsonb[jsonb]:'{\"test\":\"😊Emoji中\"}'").getBytes(StandardCharsets.UTF_8));
         WriteRowEvent actual = (WriteRowEvent) new TestDecodingPlugin(null).decode(data, logSequenceNumber);
         assertThat(actual.getLogSequenceNumber(), is(logSequenceNumber));
         assertThat(actual.getTableName(), is("test"));
@@ -59,7 +60,8 @@ class TestDecodingPluginTest {
     
     @Test
     void assertDecodeUpdateRowEvent() {
-        ByteBuffer data = ByteBuffer.wrap("table public.test: UPDATE: unicode[character varying]:' 1 2 3'' 😊中 ' t_json_empty[json]:'{}' t_json[json]:'{\"test\":\"中中{中中}' 中\"}'".getBytes());
+        ByteBuffer data = ByteBuffer.wrap("table public.test: UPDATE: unicode[character varying]:' 1 2 3'' 😊中 ' t_json_empty[json]:'{}' t_json[json]:'{\"test\":\"中中{中中}' 中\"}'"
+                .getBytes(StandardCharsets.UTF_8));
         UpdateRowEvent actual = (UpdateRowEvent) new TestDecodingPlugin(null).decode(data, logSequenceNumber);
         assertThat(actual.getLogSequenceNumber(), is(logSequenceNumber));
         assertThat(actual.getTableName(), is("test"));
@@ -70,7 +72,7 @@ class TestDecodingPluginTest {
     
     @Test
     void assertDecodeDeleteRowEvent() {
-        ByteBuffer data = ByteBuffer.wrap("table public.test: DELETE: data[integer]:1".getBytes());
+        ByteBuffer data = ByteBuffer.wrap("table public.test: DELETE: data[integer]:1".getBytes(StandardCharsets.UTF_8));
         DeleteRowEvent actual = (DeleteRowEvent) new TestDecodingPlugin(null).decode(data, logSequenceNumber);
         assertThat(actual.getLogSequenceNumber(), is(logSequenceNumber));
         assertThat(actual.getTableName(), is("test"));
@@ -79,7 +81,7 @@ class TestDecodingPluginTest {
     
     @Test
     void assertDecodeWriteRowEventWithByteA() {
-        ByteBuffer data = ByteBuffer.wrap("table public.test: INSERT: data[bytea]:'\\xff00ab'".getBytes());
+        ByteBuffer data = ByteBuffer.wrap("table public.test: INSERT: data[bytea]:'\\xff00ab'".getBytes(StandardCharsets.UTF_8));
         WriteRowEvent actual = (WriteRowEvent) new TestDecodingPlugin(null).decode(data, logSequenceNumber);
         assertThat(actual.getLogSequenceNumber(), is(logSequenceNumber));
         assertThat(actual.getTableName(), is("test"));
@@ -88,13 +90,13 @@ class TestDecodingPluginTest {
     
     @Test
     void assertDecodeUnknownTableType() {
-        ByteBuffer data = ByteBuffer.wrap("unknown".getBytes());
+        ByteBuffer data = ByteBuffer.wrap("unknown".getBytes(StandardCharsets.UTF_8));
         assertThat(new TestDecodingPlugin(null).decode(data, logSequenceNumber), instanceOf(PlaceholderEvent.class));
     }
     
     @Test
     void assertDecodeUnknownRowEventType() {
-        ByteBuffer data = ByteBuffer.wrap("table public.test: UNKNOWN: data[character varying]:'1 2 3'''".getBytes());
+        ByteBuffer data = ByteBuffer.wrap("table public.test: UNKNOWN: data[character varying]:'1 2 3'''".getBytes(StandardCharsets.UTF_8));
         assertThrows(IngestException.class, () -> new TestDecodingPlugin(null).decode(data, logSequenceNumber));
     }
     
@@ -102,13 +104,14 @@ class TestDecodingPluginTest {
     void assertDecodeTime() throws SQLException {
         TimestampUtils timestampUtils = mock(TimestampUtils.class);
         when(timestampUtils.toTime(null, "1 2 3'")).thenThrow(new SQLException(""));
-        ByteBuffer data = ByteBuffer.wrap("table public.test: INSERT: data[time without time zone]:'1 2 3'''".getBytes());
+        ByteBuffer data = ByteBuffer.wrap("table public.test: INSERT: data[time without time zone]:'1 2 3'''".getBytes(StandardCharsets.UTF_8));
         assertThrows(DecodingException.class, () -> new TestDecodingPlugin(new PostgreSQLTimestampUtils(timestampUtils)).decode(data, logSequenceNumber));
     }
     
     @Test
     void assertDecodeInsertWithNullValue() {
-        ByteBuffer data = ByteBuffer.wrap("table public.test: INSERT: id[integer]:123 col0[integer]:null col1[character varying]:null col2[character varying]:'nonnull'".getBytes());
+        ByteBuffer data = ByteBuffer.wrap("table public.test: INSERT: id[integer]:123 col0[integer]:null col1[character varying]:null col2[character varying]:'nonnull'"
+                .getBytes(StandardCharsets.UTF_8));
         AbstractWALEvent actual = new TestDecodingPlugin(null).decode(data, logSequenceNumber);
         assertThat(actual, instanceOf(WriteRowEvent.class));
         WriteRowEvent actualWriteRowEvent = (WriteRowEvent) actual;
@@ -120,7 +123,7 @@ class TestDecodingPluginTest {
     
     @Test
     void assertDecodeJsonValue() {
-        ByteBuffer data = ByteBuffer.wrap("table public.test: INSERT: id[integer]:123 ".getBytes());
+        ByteBuffer data = ByteBuffer.wrap("table public.test: INSERT: id[integer]:123 ".getBytes(StandardCharsets.UTF_8));
         AbstractWALEvent actual = new TestDecodingPlugin(null).decode(data, logSequenceNumber);
         assertThat(actual, instanceOf(WriteRowEvent.class));
     }