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/05/10 05:56:07 UTC

[GitHub] [shardingsphere] sandynz opened a new pull request, #17511: Support string type primary key table scaling

sandynz opened a new pull request, #17511:
URL: https://github.com/apache/shardingsphere/pull/17511

   
   Changes proposed in this pull request:
   - InventoryTaskSplitter support string column type
   - Refactor PrimaryKeyPosition, Support string type primary key
   - DATA_MATCH consistency calculate alg support string primary key
   


-- 
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 pull request #17511: Support string type primary key table scaling

Posted by GitBox <gi...@apache.org>.
sandynz commented on PR #17511:
URL: https://github.com/apache/shardingsphere/pull/17511#issuecomment-1123118211

   Real testing on MogDB passed:
   ```
   MogDB=>show scaling status 0130317c30317c3154327c7363616c696e675f6462;
    item | data_source |  status  | active | inventory_finished_percentage | incremental_idle_seconds
   ------+-------------+----------+--------+-------------------------------+--------------------------
    0    | ds_0        | FINISHED | false  | 100                           | 186
    1    | ds_1        | FINISHED | false  | 100                           | 194
   (2 rows)
   
   MogDB=>select * from schema1.t_order;
    order_id | user_id |            status
   ----------+---------+-------------------------------
    6H       |       5 | 2022-05-11 10:12:16.135139+08
    2a       |       4 | 2022-05-11 10:12:16.155757+08
    4e       |       1 | 2022-05-11 10:12:16.129146+08
    3ddd     |       6 | 2022-05-11 10:12:16.129146+08
    1c       |       2 | 2022-05-11 10:12:16.135139+08
    5G       |       3 | 2022-05-11 10:12:16.135139+08
   (6 rows)
   
   MogDB=>preview select * from schema1.t_order;
    data_source_name |                                actual_sql
   ------------------+---------------------------------------------------------------------------
    ds_2             | select * from schema1.t_order_0 UNION ALL select * from schema1.t_order_3
    ds_3             | select * from schema1.t_order_1 UNION ALL select * from schema1.t_order_4
    ds_4             | select * from schema1.t_order_2 UNION ALL select * from schema1.t_order_5
   (3 rows)
   ```
   


-- 
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] tristaZero merged pull request #17511: Support string type primary key table scaling

Posted by GitBox <gi...@apache.org>.
tristaZero merged PR #17511:
URL: https://github.com/apache/shardingsphere/pull/17511


-- 
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 pull request #17511: Support string type primary key table scaling

Posted by GitBox <gi...@apache.org>.
sandynz commented on PR #17511:
URL: https://github.com/apache/shardingsphere/pull/17511#issuecomment-1122038381

   Real testing passed on MySQL manually.
   But it failed on MogDB since text ordering behavior is different as MySQL and PostgreSQL.
   
   Test on MySQL 5.7:
   ```
   mysql> CREATE TABLE t_order (order_id VARCHAR(64) NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
   Query OK, 0 rows affected (0.06 sec)
   
   mysql> insert into t_order (order_id, user_id, status) values ('!1c',2,'ok'),('2a',4,'ok'),('3ddd',6,'ok'),('ae',1,'ok'),('5G',3,'ok'),('~6H',5,'ok');
   Query OK, 6 rows affected (0.04 sec)
   Records: 6  Duplicates: 0  Warnings: 0
   
   mysql> select * from t_order order by order_id desc;
   +----------+---------+--------+
   | order_id | user_id | status |
   +----------+---------+--------+
   | ~6H      |       5 | ok     |
   | ae       |       1 | ok     |
   | 5G       |       3 | ok     |
   | 3ddd     |       6 | ok     |
   | 2a       |       4 | ok     |
   | !1c      |       2 | ok     |
   +----------+---------+--------+
   6 rows in set (0.00 sec)
   
   mysql> select * from t_order where order_id<'~';
   +----------+---------+--------+
   | order_id | user_id | status |
   +----------+---------+--------+
   | !1c      |       2 | ok     |
   | 2a       |       4 | ok     |
   | 3ddd     |       6 | ok     |
   | 5G       |       3 | ok     |
   | ae       |       1 | ok     |
   +----------+---------+--------+
   5 rows in set (0.00 sec)
   ```
   
   Test on PostgreSQL 13:
   ```
   postgres=# \c test1
   You are now connected to database "test1" as user "root".
   
   test1=# CREATE TABLE t_order (order_id VARCHAR(64) NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
   CREATE TABLE
   test1=# insert into t_order (order_id, user_id, status) values ('!1c',2,'ok'),('2a',4,'ok'),('3ddd',6,'ok'),('ae',1,'ok'),('5G',3,'ok'),('~6H',5,'ok');
   INSERT 0 6
   test1=# select * from t_order order by order_id desc;
    order_id | user_id | status
   ----------+---------+--------
    ~6H      |       5 | ok
    ae       |       1 | ok
    5G       |       3 | ok
    3ddd     |       6 | ok
    2a       |       4 | ok
    !1c      |       2 | ok
   (6 rows)
   
   test1=# select * from t_order where order_id<'~';
    order_id | user_id | status
   ----------+---------+--------
    !1c      |       2 | ok
    2a       |       4 | ok
    3ddd     |       6 | ok
    ae       |       1 | ok
    5G       |       3 | ok
   (5 rows)
   ```
   
   Test on MogDB 2.1.1:
   ```
   omm@b74ff82d07b4:~$ gsql -d postgres
   gsql ((MogDB 2.1.1 build b5f25b20) compiled at 2022-03-21 14:42:30 commit 0 last mr  )
   Non-SSL connection (SSL connection is recommended when requiring high-security)
   Type "help" for help.
   
   MogDB=#\c test1
   Non-SSL connection (SSL connection is recommended when requiring high-security)
   You are now connected to database "test1" as user "omm".
   MogDB=#\d
   No relations found.
   MogDB=#CREATE TABLE t_order (order_id VARCHAR(64) NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
   NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t_order_pkey" for table "t_order"
   CREATE TABLE
   MogDB=#insert into t_order (order_id, user_id, status) values ('!1c',2,'ok'),('2a',4,'ok'),('3ddd',6,'ok'),('ae',1,'ok'),('5G',3,'ok'),('~6H',5,'ok');
   INSERT 0 6
   MogDB=#select * from t_order order by order_id desc;
    order_id | user_id | status
   ----------+---------+--------
    ae       |       1 | ok
    ~6H      |       5 | ok
    5G       |       3 | ok
    3ddd     |       6 | ok
    2a       |       4 | ok
    !1c      |       2 | ok
   (6 rows)
   
   MogDB=#select * from t_order where order_id<'~';
    order_id | user_id | status
   ----------+---------+--------
   (0 rows)
   ```
   


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