You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/09/15 07:36:54 UTC

[GitHub] [shardingsphere] sandynz commented on a diff in pull request #20996: Improve migration increment connect handshake

sandynz commented on code in PR #20996:
URL: https://github.com/apache/shardingsphere/pull/20996#discussion_r971632781


##########
shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLAuthenticationPlugin.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.db.protocol.mysql.constant;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * MySQL client/server protocol authentication plugins.
+ *
+ * @see <a href="https://dev.mysql.com/doc/refman/8.0/en/authentication-plugins.html">Authentication Plugins</a>
+ */
+@RequiredArgsConstructor
+@Getter
+public enum MySQLAuthenticationPlugin {
+    
+    DEFAULT(null),
+    
+    NATIVE_PASSWORD_AUTHENTICATION("mysql_native_password"),
+    
+    SHA2_AUTHENTICATION("caching_sha2_password"),
+    
+    SHA256_AUTHENTICATION("sha256_password");
+    

Review Comment:
   1, From the doc, looks there's `mysql_clear_password`, `authentication_windows_client`, etc, is it enough?
   
   2, Except `Client-side plugin`, looks there's also `Server-side plugin`, it has other options. Basd on MySQLAuthenticationPlugin javadoc, seems it includes server-side authentication plugins.
   



##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/framework/container/compose/DockerContainerComposer.java:
##########
@@ -50,8 +54,12 @@ public final class DockerContainerComposer extends BaseContainerComposer {
     public DockerContainerComposer(final DatabaseType databaseType, final String storageContainerImage) {
         this.databaseType = databaseType;
         governanceContainer = getContainers().registerContainer(new ZookeeperContainer());
+        StorageContainerConfiguration storageContainerConfig = StorageContainerConfigurationFactory.newInstance(databaseType);
+        if (DatabaseTypeUtil.isMySQL(databaseType) && new DockerImageVersion(storageContainerImage).getMajorVersion() > 5) {
+            storageContainerConfig = ScalingMySQL8ContainerConfigurationFactory.newInstance();
+        }

Review Comment:
   Could we define different `my.cnf` for MySQL 8 and other MySQL version, it might be more flexible to define more dedicated configuration for different MySQL versions. And ScalingMySQL8ContainerConfigurationFactory might be not required.



##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/resources/env/mysql/01-initdb.sql:
##########
@@ -23,3 +23,4 @@ CREATE DATABASE scaling_it_4;
 
 GRANT REPLICATION CLIENT, REPLICATION SLAVE, SELECT, INSERT, UPDATE, DELETE, INDEX ON *.* TO `test_user`@`%`;
 GRANT CREATE, DROP ON TABLE *.* TO test_user;
+ALTER USER `test_user`@`%` IDENTIFIED WITH mysql_native_password by 'Test@123';

Review Comment:
   Is it required? (ALTER USER ... mysql_native_password)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org