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/04/09 08:13:00 UTC

[GitHub] [shardingsphere] sandynz opened a new issue, #16694: psql could not login to proxy if backend database is MogDB (openGauss) but could login to native database

sandynz opened a new issue, #16694:
URL: https://github.com/apache/shardingsphere/issues/16694

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   master branch, commit eae7e4bf42462740f57530c7a40f26360fc6f58c
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy, MogDB backend (based on openGauss)
   macOS
   
   ### Expected behavior
   Login success with psql.
   
   ### Actual behavior
   Login to proxy failed:
   ```
   % psql --host=localhost --port=3307 scaling_db root
   psql: error: none of the server's SASL authentication mechanisms are supported
   ```
   
   But psql could login to native MogDB (exposed port on local by docker `-p 15432:5432`)
   ```
   % psql --host=localhost --port=15432 -U mogdb mogdb
   Password for user mogdb:
   psql (13.4, server 9.2.4)
   Type "help" for help.
   
   mogdb=> \l
                                   List of databases
        Name      | Owner | Encoding |   Collate   |    Ctype    | Access privileges
   ---------------+-------+----------+-------------+-------------+-------------------
    mogdb         | omm   | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
    mogila        | omm   | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
    postgres      | omm   | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
    scaling_ds_0  | omm   | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
    scaling_ds_1  | omm   | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
    scaling_ds_10 | omm   | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
    scaling_ds_11 | omm   | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
    scaling_ds_12 | omm   | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
    template0     | omm   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/omm           +
                  |       |          |             |             | omm=CTc/omm
    template1     | omm   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/omm           +
                  |       |          |             |             | omm=CTc/omm
   (10 rows)
   ```
   
   ### Reason analyze (If you can)
   Maybe `OpenGaussAuthenticationEngine` is not compatible with psql.
   
   When I changed some code of `OpenGaussFrontendEngine`,
   From
   ```
       private final OpenGaussAuthenticationEngine authenticationEngine = new OpenGaussAuthenticationEngine();
   ```
   To
   ```
       private final AuthenticationEngine authenticationEngine = new PostgreSQLAuthenticationEngine();
   ```
   Login works, and also other features:
   ```
   % psql --host=localhost --port=3307 scaling_db root
   Password for user root:
   psql (13.4, server 9.2.4-ShardingSphere-Proxy 5.1.1-SNAPSHOT-14982f6)
   Type "help" for help.
   scaling_db=> \d
   Did not find any relations.
   scaling_db=> CREATE TABLE t_order (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
   CREATE TABLE
   scaling_db=>
   scaling_db=> CREATE TABLE t_order_item (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
   CREATE TABLE
   scaling_db=> insert into t_order (order_id, user_id, status) values (1,2,'ok'),(2,4,'ok'),(3,6,'ok'),(4,1,'ok'),(5,3,'ok'),(6,5,'ok');
   INSERT 0 6
   scaling_db=>
   scaling_db=> insert into t_order_item (item_id, order_id, user_id, status) values (1,1,2,'ok'),(2,2,4,'ok'),(3,3,6,'ok'),(4,4,1,'ok'),(5,5,3,'ok'),(6,6,5,'ok');
   INSERT 0 6
   scaling_db=> preview select count(1) from t_order;
    data_source_name |                               actual_sql
   ------------------+-------------------------------------------------------------------------
    ds_0             | select count(1) from t_order_0 UNION ALL select count(1) from t_order_2
    ds_1             | select count(1) from t_order_1 UNION ALL select count(1) from t_order_3
   (2 rows)
   
   scaling_db=> select count(1) from t_order;
    count
   -------
        6
   (1 row)
   ```
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   1, Set up MogDB with docker mode, following [MogDB docker installation]( https://docs.mogdb.io/zh/mogdb/v2.1/docker-installation ).
   
   2, Login MogDB with gsql and create needed databases, SQLs:
   ```
   create database scaling_ds_0;
   create database scaling_ds_1;
   ```
   
   3, Configure `server.yaml` (use the default configuration). Configrue `config-sharding.yaml`, as following:
   ```
   schemaName: scaling_db
   
   dataSources:
     ds_0:
       url: jdbc:opengauss://127.0.0.1:15432/scaling_ds_0
       username: mogdb
       password: Enmo@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_1:
       url: jdbc:opengauss://127.0.0.1:15432/scaling_ds_1
       username: mogdb
       password: Enmo@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
     - !SHARDING
       autoTables:
         t_order:
           actualDataSources: ds_0,ds_1
           keyGenerateStrategy:
             column: order_id
             keyGeneratorName: t_order_snowflake
           logicTable: t_order
           shardingStrategy:
             standard:
               shardingAlgorithmName: t_order_hash_mod
               shardingColumn: order_id
         t_order_item:
           actualDataSources: ds_0,ds_1
           keyGenerateStrategy:
             column: order_id
             keyGeneratorName: t_order_item_snowflake
           logicTable: t_order_item
           shardingStrategy:
             standard:
               shardingAlgorithmName: t_order_item_hash_mod
               shardingColumn: order_id
       bindingTables:
         - t_order,t_order_item
       keyGenerators:
         t_order_snowflake:
           type: snowflake
         t_order_item_snowflake:
           type: snowflake
       shardingAlgorithms:
         t_order_hash_mod:
           props:
             sharding-count: '4'
           type: hash_mod
         t_order_item_hash_mod:
           props:
             sharding-count: '4'
           type: hash_mod
       scalingName: scaling_name1
       scaling:
         scaling_name1:
           completionDetector:
             props:
               incremental-task-idle-second-threshold: '1'
             type: IDLE
           dataConsistencyChecker:
             props:
               chunk-size: '1000'
             type: DATA_MATCH
   ```
   
   4, Start proxy
   
   5, Login proxy on shell with psql
   ```
   psql --host=localhost --port=3307 scaling_db root
   ```
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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.apache.org

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


[GitHub] [shardingsphere] sandynz closed issue #16694: psql could not login to proxy if backend database is MogDB (openGauss) but could login to native database

Posted by GitBox <gi...@apache.org>.
sandynz closed issue #16694: psql could not login to proxy if backend database is MogDB (openGauss) but could login to native database
URL: https://github.com/apache/shardingsphere/issues/16694


-- 
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


[GitHub] [shardingsphere] TeslaCN commented on issue #16694: psql could not login to proxy if backend database is MogDB (openGauss) but could login to native database

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #16694:
URL: https://github.com/apache/shardingsphere/issues/16694#issuecomment-1094026840

   @sandynz The SCRAM authentication of openGauss is different PostgreSQL's SCRAM authentication. At present, ShardingSphere-Proxy openGauss can be connected by `gsql` only.


-- 
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


[GitHub] [shardingsphere] sandynz commented on issue #16694: psql could not login to proxy if backend database is MogDB (openGauss) but could login to native database

Posted by GitBox <gi...@apache.org>.
sandynz commented on issue #16694:
URL: https://github.com/apache/shardingsphere/issues/16694#issuecomment-1094041673

   > @sandynz The SCRAM authentication of openGauss is different PostgreSQL's SCRAM authentication. At present, ShardingSphere-Proxy openGauss can be connected by `gsql` only.
   
   OK, thanks.


-- 
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


[GitHub] [shardingsphere] sandynz commented on issue #16694: psql could not login to proxy if backend database is MogDB (openGauss) but could login to native database

Posted by GitBox <gi...@apache.org>.
sandynz commented on issue #16694:
URL: https://github.com/apache/shardingsphere/issues/16694#issuecomment-1094277336

   Closed now. It will be supported later.


-- 
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