[MDEV-6463] SPIDER_COPY_TABLES doesn't work Created: 2014-07-19  Updated: 2020-05-18  Resolved: 2020-05-18

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Spider
Affects Version/s: 10.0.12
Fix Version/s: 10.0.12

Type: Bug Priority: Major
Reporter: Pierre Mavro Assignee: Kentoku Shiba (Inactive)
Resolution: Not a Bug Votes: 0
Labels: spider
Environment:

Debian 7 x64 under Virtualbox



 Description   

The spider_copy_tables function doesn't work at all. I tried to shut off a MariaDB server, rerun it again, the status_link was equal to 3. I truncated the partition on which the server failed. Tries to changed it to 2 for maintenance purpose:

ALTER TABLE backend.sbtest 
ENGINE=spider COMMENT='wrapper "mysql", table "sbtest"' 
 PARTITION BY KEY (id) 
( 
 PARTITION pt1 COMMENT = 'srv "backend1 backend2_replication"  mbk "2", mkd "2", msi "3306", link_status "2 0"', 
 PARTITION pt2 COMMENT = 'srv "backend2 backend1_replication"  mbk "2", mkd "2", msi "3306", link_status "0 0"' 
);

Then copy the Spider table using spider_copy_tables:

MariaDB [(none)]> select spider_copy_tables('backend.sbtest#P#pt2','1','0');
+----------------------------------------------------+
| spider_copy_tables('backend.sbtest#P#pt2','1','0') |
+----------------------------------------------------+
|                                                  1 |
+----------------------------------------------------+
1 row in set (2 min 0.73 sec)

The return code means it's ok, however the table remains still empty. Nothings have been copied.



 Comments   
Comment by Kentoku Shiba (Inactive) [ 2020-05-18 ]

This procedure in this jira task has 2 issues.
1. Missing some commas for separating table parameter.

Current:

 PARTITION pt1 COMMENT = 'srv "backend1 backend2_replication"  mbk "2", mkd "2", msi "3306", link_status "2 0"', 
 PARTITION pt2 COMMENT = 'srv "backend2 backend1_replication"  mbk "2", mkd "2", msi "3306", link_status "0 0"' 

Fixed:

 PARTITION pt1 COMMENT = 'srv "backend1 backend2_replication", mbk "2", mkd "2", msi "3306", link_status "2 0"', 
 PARTITION pt2 COMMENT = 'srv "backend2 backend1_replication", mbk "2", mkd "2", msi "3306", link_status "0 0"' 

2. spider_copy_tables was used for another partition.

Current:

MariaDB [(none)]> select spider_copy_tables('backend.sbtest#P#pt2','1','0');

Fixed:

MariaDB [(none)]> select spider_copy_tables('backend.sbtest#P#pt1','1','0');

spider_copy_tables returns success code even if the destination table has same records. Because maintainance mode allows updating to the table, and this behavior is required for online copy table.
Please retry with above changes.

Comment by Kentoku Shiba (Inactive) [ 2020-05-18 ]

Try to reproduce, investigate issue

Generated at Thu Feb 08 07:12:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.