data is lost when updating the partition key of a record with a value that will force the move of the record to another server
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Spider for MySQL |
Fix Released
|
High
|
Kentoku SHIBA |
Bug Description
This is what I have :
+------
| PLUGIN_NAME | PLUGIN_VERSION | PLUGIN_STATUS | PLUGIN_TYPE | PLUGIN_LIBRARY |
+------
| SPIDER | 2.22 | ACTIVE | STORAGE ENGINE | ha_spider.so |
+------
mysql [localhost] {msandbox} (asp) > select * from trace_ejb6 where id =15;
+----+-
| id | timestamp | timestamp2 | latitude | longitude | speed | heading | terminalID | mileage | creationtime | tracetype | customerID |
+----+-
| 15 | 1155292399058 | 2006-08-11 12:33:19 | 5085231 | 473206 | NULL | NULL | 0 | NULL | 0 | 0 | 0 |
+----+-
1 row in set (0.01 sec)
details of the table :
CREATE TABLE `trace_ejb6` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`timestamp` bigint(20) NOT NULL,
`timestamp2` datetime DEFAULT NULL,
`latitude` int(11) DEFAULT NULL,
`longitude` int(11) DEFAULT NULL,
`speed` smallint(6) DEFAULT NULL,
`heading` smallint(6) DEFAULT NULL,
`terminalID` int(11) NOT NULL,
`mileage` int(11) DEFAULT NULL,
`creationtime` bigint(20) NOT NULL,
`tracetype` int(11) DEFAULT NULL,
`customerID` int(11) NOT NULL DEFAULT '0',
KEY `id` (`id`,`
KEY `idx_trace_
KEY `idx_terminalID
KEY `idx_terminalID
KEY `idx_creationtime` (`creationtime`)
) ENGINE=SPIDER AUTO_INCREMENT=
/*!50100 PARTITION BY RANGE (timestamp)
(PARTITION pt1 VALUES LESS THAN (1199142000000) COMMENT = 'host "127.0.0.1", port "16850"' ENGINE = SPIDER,
PARTITION pt2 VALUES LESS THAN (1270072800000) COMMENT = 'host "127.0.0.1", port "16849"' ENGINE = SPIDER,
PARTITION pt3 VALUES LESS THAN MAXVALUE COMMENT = 'host "127.0.0.1", port "16848"' ENGINE = SPIDER)
mysql [localhost] {msandbox} (asp) > update trace_ejb6 set timestamp = unix_timestamp(
Query OK, 1 row affected (0.24 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql [localhost] {msandbox} (asp) > select * from trace_ejb6 where id =15;Empty set (0.00 sec)
in the binlog of the spider server :
# at 181
#100922 10:17:22 server id 5144 end_log_pos 323 Query thread_id=4 exec_time=0 error_code=0
use asp/*!*/;
SET TIMESTAMP=
update trace_ejb6 set timestamp = unix_timestamp(
/*!*/;
in the binlog of the shard where the new record should be moved (pt3):
# at 1535
#100922 10:17:22 server id 101 end_log_pos 1672 Query thread_id=43 exec_time=0 error_code=0
SET TIMESTAMP=
insert high_priority into `asp`.`
/*!*/;
in the binlog of the shard where the data was (pt1):
# at 3512
#100922 10:17:22 server id 103 end_log_pos 3897 Query thread_id=44 exec_time=0 error_code=0
SET TIMESTAMP=
delete from `asp`.`trace_ejb6` where `id` = 15 and `timestamp` = 1155292399058 and `timestamp2` = '2006-08-11 12:33:19' and `latitude` = 5085231 and `longitude` = 473206 and `speed` is null and `heading` is null and `terminalID` = 0 and `mileage` is null and `creationtime` = 0 and `tracetype` = 0 and `customerID` = 0 limit 1
/*!*/;
What I expect is that on the shard where the record should be moved instead of having :
insert high_priority into `asp`.`
I expect something like :
insert high_priority into `asp`.`
Thank you for your help.
Changed in spiderformysql: | |
assignee: | nobody → Kentoku SHIBA (kentokushiba) |
importance: | Undecided → High |
Changed in spiderformysql: | |
status: | Fix Committed → Fix Released |
Please use this attached file for avoiding this problem.