使用presto查询tidb产生重复数据

复制链接完成认证,获得“加急”处理问题的权限,方便您更快速地解决问题。

为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:

【概述】 场景 + 问题概述

【应用框架及开发适配业务逻辑】

【背景】 做过哪些操作

【现象】 业务和数据库现象

【问题】 当前遇到的问题

【业务影响】

【TiDB 版本】 4.07

【附件】 相关日志及监控(https://metricstool.pingcap.com/)


若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。

你好 我这边生存环境使用presto 查询tidb ,使用的是知乎的tibigdata驱动。然后会出现如下bug。

使用知乎的tibigdata驱动查询的结果。同一个主键 会产生2条数据。

使用mysql的驱动 不会产生2条数据

能否稳定复现呢,可以提供表结构以及测试数据吗?

presto使用的是prestosql还是prestodb,版本是多少

prestosql338版本。 可以稳定复现,
这个是一个频繁更新数据量的表。是使用repalce去更新的。
CREATE TABLE ods_tms_transtrack (
row_wid varchar(1024) NOT NULL,
etl_proc_wid varchar(32) DEFAULT NULL,
w_insert_dt varchar(32) DEFAULT NULL COMMENT ‘记录的新增时间’,
w_update_dt varchar(32) NOT NULL COMMENT ‘记录的修改时间’,
datasource_num_id varchar(32) NOT NULL,
data_flag varchar(32) NOT NULL,
integration_id varchar(32) DEFAULT NULL,
created_on_dt varchar(32) DEFAULT NULL,
changed_on_dt varchar(32) DEFAULT NULL,
kafka_partition varchar(512) DEFAULT NULL,
kafka_offset varchar(512) DEFAULT NULL,
kafka_timestamp varchar(512) DEFAULT NULL,
id varchar(1024) NOT NULL,
tms_id varchar(1024) DEFAULT NULL,
main_id varchar(1024) DEFAULT NULL,
source_order_id varchar(1024) DEFAULT NULL,
order_id varchar(1024) DEFAULT NULL,
tracking_number varchar(1024) DEFAULT NULL,
tracking_number_unique_identifier varchar(1024) DEFAULT NULL,
ship_to_zip_code varchar(1024) DEFAULT NULL,
ship_to_country varchar(1024) DEFAULT NULL,
ship_to_city varchar(1024) DEFAULT NULL,
ship_to_state varchar(1024) DEFAULT NULL,
warehouse_code varchar(1024) DEFAULT NULL,
lms_account_id varchar(1024) DEFAULT NULL,
way_billNumber varchar(1024) DEFAULT NULL,
time_zone_originating_place varchar(1024) DEFAULT NULL,
user_id varchar(1024) DEFAULT NULL,
channel_name varchar(1024) DEFAULT NULL,
delivery_method varchar(1024) DEFAULT NULL,
rule_id varchar(1024) DEFAULT NULL,
state varchar(1024) DEFAULT NULL,
code varchar(1024) DEFAULT NULL,
creation_time varchar(1024) DEFAULT NULL,
update_time varchar(1024) DEFAULT NULL,
sync_time varchar(1024) DEFAULT NULL,
tracking_batch_no varchar(1024) DEFAULT NULL,
sharding_no varchar(1024) DEFAULT NULL,
status longtext DEFAULT NULL,
status_version varchar(1024) DEFAULT NULL,
last_tracking_time varchar(1024) DEFAULT NULL,
tracking_hash varchar(1024) DEFAULT NULL,
tracking_change_times varchar(1024) DEFAULT NULL,
tracking_error_times varchar(1024) DEFAULT NULL,
tracking_change_time varchar(1024) DEFAULT NULL,
next_tracking_time varchar(1024) DEFAULT NULL,
next_tracking_priority varchar(1024) DEFAULT NULL,
a_scan_date varchar(1024) DEFAULT NULL,
d_scan_date varchar(1024) DEFAULT NULL,
data_source varchar(1024) DEFAULT NULL,
first_ascan_gettime varchar(1024) DEFAULT NULL,
first_dscan_gettime varchar(1024) DEFAULT NULL,
cluster_time varchar(1024) DEFAULT NULL,
UNIQUE KEY row_wid (row_wid),
KEY creation_time (creation_time)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin/*!90000 SHARD_ROW_ID_BITS=4 PRE_SPLIT_REGIONS=2 */;

感觉复现条件 1.需要rapalce去更新这个表 2 一般出现重复的数据都是当前的数据 几秒前的数据查询就不会。

INSERT INTO ods_tms_transtrack (row_wid, etl_proc_wid, w_insert_dt, w_update_dt, datasource_num_id, data_flag, integration_id, created_on_dt, changed_on_dt, kafka_partition, kafka_offset, kafka_timestamp, id, tms_id, main_id, source_order_id, order_id, tracking_number, tracking_number_unique_identifier, ship_to_zip_code, ship_to_country, ship_to_city, ship_to_state, warehouse_code, lms_account_id, way_billNumber, time_zone_originating_place, user_id, channel_name, delivery_method, rule_id, state, code, creation_time, update_time, sync_time, tracking_batch_no, sharding_no, status, status_version, last_tracking_time, tracking_hash, tracking_change_times, tracking_error_times, tracking_change_time, next_tracking_time, next_tracking_priority, a_scan_date, d_scan_date, data_source, first_ascan_gettime, first_dscan_gettime, cluster_time)
VALUES
(‘60b7292a38694110413ef04a’, NULL, NULL, ‘2021-06-03 10:06:10’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-1’, ‘1469523’, ‘2021-06-03 10:06:09’, ‘60b7292a38694110413ef04a’, ‘-1’, NULL, ‘G1132-210602-2451’, ‘G1132-210602-2451’, ‘1Z3Y18820313117423’, ‘’, ‘48066-2256’, ‘US’, ‘Roseville’, ‘MI’, ‘USEA-5’, ‘1187210669062099061’, ‘L101210602210252840’, ‘-5.0’, ‘11.0’, ‘UPS’, ‘Ground’, ‘TR_UPS’, ‘0.0’, ‘TMS_AS’, ‘2021-06-02 14:46:02’, ‘2021-06-02 14:46:02’, ‘2021-06-02 14:46:02’, ‘20210602’, ‘17’, ‘[{“original_code”:“M”,“code”:“TMS_OC”,“original_timestamp”:“2021-06-02 10:46:01”,“sub_code”:"",“location”:", , US",“timestamp”:“2021-06-02 14:46:01”,“info”:“Shipper created a label, UPS has not received the package yet.”},{“original_code”:“I”,“code”:“TMS_AS”,“original_timestamp”:“2021-06-03 05:09:31”,“sub_code”:"",“location”:“Edison, NJ, US”,“timestamp”:“2021-06-03 09:09:31”,“info”:“Package is in transit to a UPS facility”}]’, ‘27’, ‘2021-06-03 06:46:10’, ‘4EACE71C9B2946F179DF729D76F35EC6’, ‘2.0’, ‘0.0’, ‘2021-06-03 06:46:10’, ‘2021-06-03 18:46:10’, ‘0.0’, NULL, NULL, ‘Create’, ‘’, ‘’, ‘2021-06-02 18:46:05’),
(‘60b4861b3869411041be09f2’, NULL, NULL, ‘2021-06-03 10:06:10’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-1’, ‘1469524’, ‘2021-06-03 10:06:09’, ‘60b4861b3869411041be09f2’, ‘-1’, NULL, ‘200-210531-2998’, ‘200-210531-2998’, ‘1Z4E2W090316131901’, ‘’, ‘25705-3705’, ‘US’, ‘Huntington’, ‘WV’, ‘USWE-5’, ‘1251441159880847614’, ‘L101210531210284430’, ‘-8.0’, ‘11.0’, ‘UPS’, ‘Ground’, ‘TR_UPS’, ‘0.0’, ‘TMS_IT’, ‘2021-05-31 14:45:47’, ‘2021-05-31 14:45:47’, ‘2021-05-31 14:45:47’, ‘20210602’, ‘94’, ‘[{“original_code”:“M”,“code”:“TMS_OC”,“original_timestamp”:“2021-05-31 07:45:47”,“sub_code”:"",“location”:", , US",“timestamp”:“2021-05-31 14:45:47”,“info”:“Shipper created a label, UPS has not received the package yet.”},{“original_code”:“I”,“code”:“TMS_AS”,“original_timestamp”:“2021-06-01 08:54:43”,“sub_code”:"",“location”:“Ontario, CA, US”,“timestamp”:“2021-06-01 15:54:43”,“info”:“Package is in transit to a UPS facility”},{“original_code”:“I”,“code”:“TMS_PU”,“original_timestamp”:“2021-06-01 19:17:39”,“sub_code”:"",“location”:“Ontario, CA, US”,“timestamp”:“2021-06-02 02:17:39”,“info”:“Origin Scan”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-02 06:12:00”,“sub_code”:"",“location”:“Ontario, CA, US”,“timestamp”:“2021-06-02 13:12:00”,“info”:“Departed from Facility”}]’, ‘27’, ‘2021-06-03 06:46:10’, ‘EF05603F38699010CA36E9721C9CB69D’, ‘5.0’, ‘0.0’, ‘2021-06-03 06:46:10’, ‘2021-06-03 18:46:10’, ‘0.0’, ‘2021-06-02 02:17:39’, NULL, ‘Create’, ‘2021-06-02 06:46:00’, ‘’, ‘2021-06-02 18:46:05’),
(‘60b7258438694110413e1ffe’, NULL, NULL, ‘2021-06-03 10:06:10’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-1’, ‘1469538’, ‘2021-06-03 10:06:09’, ‘60b7258438694110413e1ffe’, ‘-1’, NULL, ‘G982-210602-1563’, ‘G982-210602-1563’, ‘338XH008210801000935102’, ‘’, ‘3980’, ‘AU’, ‘Warneet’, ‘VIC’, ‘AU_SYD’, ‘1323914027222446525’, ‘L101210602210241192’, ‘0.0’, ‘11.0’, ‘YKD_A2’, ‘AU_EPARCEL’, ‘’, ‘0.0’, ‘’, ‘2021-06-02 14:30:28’, ‘2021-06-02 14:30:28’, ‘2021-06-02 14:30:28’, ‘20210602’, ‘44’, ‘[]’, ‘0’, ‘2021-06-03 06:46:05’, ‘’, ‘0.0’, ‘7.0’, ‘2021-06-02 14:30:28’, ‘2021-06-03 18:46:05’, ‘0.0’, NULL, NULL, ‘Create’, ‘’, ‘’, ‘2021-06-02 18:46:05’),
(‘60b549aa3869411041e11ee4’, NULL, NULL, ‘2021-06-03 10:06:10’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-1’, ‘1469544’, ‘2021-06-03 10:06:09’, ‘60b549aa3869411041e11ee4’, ‘-1’, NULL, ‘PO21060103937’, ‘PO21060103937’, ‘41950030000739’, ‘’, ‘WD23 2FF’, ‘GB’, ‘Bushey’, ‘Hertfordshire’, ‘UK-5’, ‘1390912395307647199’, ‘L101210531210419755’, NULL, ‘1246.0’, ‘UKDHL’, ‘DHL_Domestic’, ‘TR_UKDHL’, ‘1.0’, ‘TMS_FD’, ‘2021-06-01 04:40:10’, ‘2021-06-01 04:40:10’, ‘2021-06-01 04:40:10’, ‘20210602’, ‘-90’, ‘[{“original_code”:“2”,“code”:“TMS_PU”,“original_timestamp”:“2021-06-02 04:09:14”,“sub_code”:"",“timestamp”:“2021-06-02 04:09:14”,“info”:“Collected”},{“original_code”:“3”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-02 11:00:45”,“sub_code”:"",“timestamp”:“2021-06-02 11:00:45”,“info”:“At Delivery Location”},{“original_code”:“4”,“code”:“TMS_OD”,“original_timestamp”:“2021-06-02 15:55:15”,“sub_code”:"",“timestamp”:“2021-06-02 15:55:15”,“info”:“Out For Delivery”},{“original_code”:“5”,“code”:“TMS_FD”,“original_timestamp”:“2021-06-02 21:06:38”,“sub_code”:"",“timestamp”:“2021-06-02 21:06:38”,“info”:“Delivered”}]’, ‘2’, ‘2021-06-02 22:46:11’, ‘4E86F8E4FC9DBE226263D8BB9168753F’, ‘2.0’, ‘0.0’, ‘2021-06-02 22:46:11’, ‘2021-06-03 02:46:11’, ‘0.0’, ‘2021-06-02 04:09:14’, ‘2021-06-02 21:06:38’, ‘Create’, ‘2021-06-02 18:46:05’, ‘2021-06-02 22:46:11’, ‘2021-06-02 18:46:05’),
(‘60b550d23869411041e28c6c’, NULL, NULL, ‘2021-06-03 10:06:10’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-1’, ‘1469545’, ‘2021-06-03 10:06:09’, ‘60b550d23869411041e28c6c’, ‘-1’, NULL, ‘PO21060105500’, ‘PO21060105500’, ‘41950030000745’, ‘’, ‘LE67 2EL’, ‘GB’, ‘Coalville’, ‘Leicestershire’, ‘UK-5’, ‘1390912395307647199’, ‘L101210531210435353’, NULL, ‘1246.0’, ‘UKDHL’, ‘DHL_Domestic’, ‘TR_UKDHL’, ‘1.0’, ‘TMS_FD’, ‘2021-06-01 05:10:42’, ‘2021-06-01 05:10:42’, ‘2021-06-01 05:10:42’, ‘20210602’, ‘-90’, ‘[{“original_code”:“2”,“code”:“TMS_PU”,“original_timestamp”:“2021-06-02 03:56:06”,“sub_code”:"",“timestamp”:“2021-06-02 03:56:06”,“info”:“Collected”},{“original_code”:“3”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-02 10:42:28”,“sub_code”:"",“timestamp”:“2021-06-02 10:42:28”,“info”:“At Delivery Location”},{“original_code”:“4”,“code”:“TMS_OD”,“original_timestamp”:“2021-06-02 13:12:31”,“sub_code”:"",“timestamp”:“2021-06-02 13:12:31”,“info”:“Out For Delivery”},{“original_code”:“5”,“code”:“TMS_FD”,“original_timestamp”:“2021-06-02 18:41:03”,“sub_code”:"",“timestamp”:“2021-06-02 18:41:03”,“info”:“Delivered”}]’, ‘2’, ‘2021-06-02 18:46:05’, ‘ADB6B29BF1F22ADD5F0E6BA1D035F63B’, ‘2.0’, ‘0.0’, ‘2021-06-02 18:46:05’, ‘2021-06-02 22:46:05’, ‘0.0’, ‘2021-06-02 03:56:06’, ‘2021-06-02 18:41:03’, ‘Create’, ‘2021-06-02 14:45:59’, ‘2021-06-02 18:46:05’, ‘2021-06-02 18:46:05’),
(‘60a2b93638694110410ff14d’, NULL, NULL, ‘2021-06-03 10:06:10’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-1’, ‘1469571’, ‘2021-06-03 10:06:09’, ‘60a2b93638694110410ff14d’, ‘-1’, NULL, ‘3808764973’, ‘3808764973’, ‘9201990254567426265480’, ‘’, ‘08512’, ‘US’, ‘Cranbury’, ‘NJ’, ‘USEA-4’, ‘1190196911357833216’, ‘L102210517210330468’, ‘-5.0’, ‘1211.0’, ‘USPS’, ‘RL_USPS_P_2’, ‘TR_USPS’, ‘0.0’, ‘TMS_OC’, ‘2021-05-18 02:43:02’, ‘2021-05-18 02:43:02’, ‘2021-05-18 02:43:02’, ‘20210603’, ‘6’, ‘[{“original_code”:“MA”,“code”:“TMS_OC”,“original_timestamp”:“2021-05-17 08:00:00”,“sub_code”:"",“location”:" ",“timestamp”:“2021-05-17 12:00:00”,“info”:“Pre-Shipment Info Sent to USPS, USPS Awaiting Item”}]’, ‘34’, ‘2021-06-03 08:58:25’, ‘BB300FBF0D72A3A2F17BC222FD53396F’, ‘2.0’, ‘0.0’, ‘2021-06-03 08:58:25’, ‘2021-06-03 20:58:25’, ‘0.0’, NULL, NULL, ‘Create’, ‘’, ‘’, ‘2021-06-02 18:46:05’),
(‘609d73673869411041e7c984’, NULL, NULL, ‘2021-06-03 10:06:10’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-1’, ‘1469595’, ‘2021-06-03 10:06:09’, ‘609d73673869411041e7c984’, ‘-1’, NULL, ‘G679-210514-0139’, ‘G679-210514-0139’, ‘H00DJC0002204104’, ‘’, ‘71440’, ‘FR’, ‘La Frette’, ‘’, ‘UK-7’, ‘1191272624890589322’, ‘L101210513210422256’, NULL, ‘11.0’, ‘HERMES’, ‘Standard’, ‘TR_Hermes’, ‘0.0’, ‘TMS_AS’, ‘2021-05-14 02:43:51’, ‘2021-05-14 02:43:51’, ‘2021-05-14 02:43:51’, ‘20210602’, ‘61’, ‘[{“code”:“TMS_OC”,“original_timestamp”:“2021-05-14 03:43:51”,“sub_code”:"",“timestamp”:“2021-05-14 03:43:51”,“info”:“Order placed”},{“code”:“TMS_AS”,“original_timestamp”:“2021-05-14 04:29:00”,“sub_code”:"",“timestamp”:“2021-05-14 04:29:00”,“info”:“Carrier Receipt”}]’, ‘43’, ‘2021-06-03 06:46:10’, ‘4E0B072473301BCA07074FDE66D4A6E2’, ‘1.0’, ‘0.0’, ‘2021-05-14 06:43:55’, ‘2021-06-03 18:46:10’, ‘0.0’, NULL, NULL, ‘Create’, ‘’, ‘’, ‘2021-06-02 18:46:05’),
(‘60b6805038694110411c6dee’, NULL, NULL, ‘2021-06-03 10:06:10’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-1’, ‘1469610’, ‘2021-06-03 10:06:09’, ‘60b6805038694110411c6dee’, ‘-1’, NULL, ‘YT2114221236007257’, ‘YT2114221236007257’, ‘D10012477740550’, ‘’, ‘94080’, ‘US’, ‘South San Francisco’, ‘CA’, ‘USWE-7’, ‘1277847494310506936’, ‘L101210601210402893’, ‘-8.0’, ‘42.0’, ‘ONTRAC’, ‘OnTrac_Ground’, ‘TR_OnTrac’, ‘0.0’, ‘TMS_OC’, ‘2021-06-02 02:45:36’, ‘2021-06-02 02:45:36’, ‘2021-06-02 02:45:36’, ‘20210602’, ‘15’, ‘[{“original_code”:“XX”,“code”:“TMS_OC”,“original_timestamp”:“2021-06-01 19:45:35”,“sub_code”:"",“location”:“COMMERCE,CA,90040”,“timestamp”:“2021-06-02 02:45:35”,“info”:“SHIPPING LABEL CREATED; DATA RECEIVED.”}]’, ‘8’, ‘2021-06-03 06:46:10’, ‘B7C5A8481E539D285E5D047F7D0F8F9A’, ‘2.0’, ‘0.0’, ‘2021-06-03 06:46:10’, ‘2021-06-03 18:46:10’, ‘0.0’, NULL, NULL, ‘Create’, ‘’, ‘’, ‘2021-06-02 18:46:05’),
(‘60a9f9e43869411041a89e58’, NULL, NULL, ‘2021-06-03 10:06:10’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-1’, ‘1469611’, ‘2021-06-03 10:06:09’, ‘60a9f9e43869411041a89e58’, ‘-1’, NULL, ‘61-210523-0316’, ‘61-210523-0316’, ‘1ZA404V7YW03243959’, ‘’, ‘16150-9319’, ‘US’, ‘Sharpsville’, ‘PA’, ‘USWE-5’, ‘1303147225748090941’, ‘L101210523210368021’, NULL, ‘11.0’, ‘JS’, ‘JS_SUREPOST’, ‘TR_JS’, ‘1.0’, ‘TMS_FD’, ‘2021-05-23 14:44:52’, ‘2021-05-23 14:44:52’, ‘2021-05-23 14:44:52’, ‘20210602’, ‘-13’, ‘[{“original_code”:“M”,“code”:“TMS_OC”,“original_timestamp”:“2021-05-23 07:44:51”,“sub_code”:"",“location”:", , US",“timestamp”:“2021-05-23 07:44:51”,“info”:“Shipper created a label, UPS has not received the package yet.”},{“original_code”:“I”,“code”:“TMS_PU”,“original_timestamp”:“2021-05-24 21:21:56”,“sub_code”:"",“location”:“Ontario, CA, US”,“timestamp”:“2021-05-24 21:21:56”,“info”:“Origin Scan”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-05-25 09:07:00”,“sub_code”:"",“location”:“Ontario, CA, US”,“timestamp”:“2021-05-25 09:07:00”,“info”:“Departed from Facility”},{“original_code”:“X”,“code”:“TMS_UN”,“original_timestamp”:“2021-05-28 10:00:00”,“sub_code”:"",“timestamp”:“2021-05-28 10:00:00”,“info”:“A train derailment has delayed delivery. We\u0027re adjusting plans to deliver your package as quickly as possible.”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-05-28 11:27:00”,“sub_code”:"",“location”:“New Stanton, PA, US”,“timestamp”:“2021-05-28 11:27:00”,“info”:“Arrived at Facility”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-05-29 09:11:00”,“sub_code”:"",“location”:“New Stanton, PA, US”,“timestamp”:“2021-05-29 09:11:00”,“info”:“Departed from Facility”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-05-29 10:43:00”,“sub_code”:"",“location”:“New Wilmington, PA, US”,“timestamp”:“2021-05-29 10:43:00”,“info”:“Arrived at Facility”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-01 13:36:34”,“sub_code”:"",“location”:“New Wilmington, PA, US”,“timestamp”:“2021-06-01 13:36:34”,“info”:“Processing at UPS Facility”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-01 17:53:57”,“sub_code”:"",“timestamp”:“2021-06-01 17:53:57”,“info”:“Package transferred to post office”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-01 20:24:00”,“sub_code”:"",“timestamp”:“2021-06-01 20:24:00”,“info”:“Received by the local post office”},{“original_code”:“D”,“code”:“TMS_FD”,“original_timestamp”:“2021-06-02 17:20:00”,“sub_code”:"",“location”:", PA, US",“timestamp”:“2021-06-02 17:20:00”,“info”:“Package delivered by local post office.”}]’, ‘8’, ‘2021-06-03 06:46:08’, ‘BB8262F6F64429F8D156D2E5A0CB0956’, ‘8.0’, ‘0.0’, ‘2021-06-03 06:46:08’, ‘2021-06-03 18:46:08’, ‘0.0’, ‘2021-05-24 21:21:56’, ‘2021-06-02 17:20:00’, ‘Create’, ‘2021-05-25 06:45:17’, ‘2021-06-03 06:46:08’, ‘2021-06-02 18:46:05’),
(‘607fff623869411041d50adb’, NULL, NULL, ‘2021-06-03 10:06:10’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-1’, ‘1469612’, ‘2021-06-03 10:06:09’, ‘607fff623869411041d50adb’, ‘-1’, NULL, ‘RG666-210421-0842’, ‘RG666-210421-0842’, ‘00340434291899552507’, ‘’, ‘53881’, ‘DE’, ‘Euskirchen’, ‘’, ‘DE-3’, ‘1189383477418528803’, ‘L101210421210463954’, NULL, ‘11.0’, ‘GERDHL’, ‘Paket_RL’, ‘TR_GERDHL’, ‘0.0’, ‘TMS_OC’, ‘2021-04-21 18:33:06’, ‘2021-04-21 18:33:06’, ‘2021-04-21 18:33:06’, ‘20210602’, ‘17’, ‘[{“original_code”:“PARCV”,“code”:“TMS_OC”,“original_timestamp”:“2021-04-22 04:18:00”,“sub_code”:"",“location”:"",“timestamp”:“2021-04-22 04:18:00”,“info”:“The instruction data for this shipment have been provided by the sender to DHL electronically.”},{“original_code”:“DTNPC”,“code”:“TMS_OC”,“original_timestamp”:“2021-06-02 05:50:00”,“sub_code”:"",“location”:"",“timestamp”:“2021-06-02 05:50:00”,“info”:“The instruction data for this shipment have been provided by the sender to DHL electronically”}]’, ‘40’, ‘2021-06-03 06:46:09’, ‘B78CC510946E9DB9F49E106ED64FD97C’, ‘3.0’, ‘0.0’, ‘2021-06-02 06:46:02’, ‘2021-06-03 18:46:09’, ‘0.0’, NULL, NULL, ‘Create’, ‘’, ‘’, ‘2021-06-02 18:46:05’),
(‘60b486123869411041be04f1’, NULL, NULL, ‘2021-06-03 10:06:15’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-2’, ‘1456348’, ‘2021-06-03 10:06:10’, ‘60b486123869411041be04f1’, ‘-1’, NULL, ‘G3355-210531-1079’, ‘G3355-210531-1079’, ‘1Z4513EV0305805624’, ‘’, ‘18302-8454’, ‘US’, ‘East Stroudsburg’, ‘PA’, ‘USSC-1’, ‘1251438047149436976’, ‘L101210531210284367’, ‘-5.0’, ‘11.0’, ‘UPS’, ‘Ground’, ‘TR_UPS’, ‘0.0’, ‘TMS_IT’, ‘2021-05-31 14:45:38’, ‘2021-05-31 14:45:38’, ‘2021-05-31 14:45:38’, ‘20210602’, ‘73’, ‘[{“original_code”:“M”,“code”:“TMS_OC”,“original_timestamp”:“2021-05-31 10:45:37”,“sub_code”:"",“location”:", , US",“timestamp”:“2021-05-31 14:45:37”,“info”:“Shipper created a label, UPS has not received the package yet.”},{“original_code”:“I”,“code”:“TMS_PU”,“original_timestamp”:“2021-06-01 19:30:02”,“sub_code”:"",“location”:“Atlanta, GA, US”,“timestamp”:“2021-06-01 23:30:02”,“info”:“Origin Scan”},{“original_code”:“I”,“code”:“TMS_AS”,“original_timestamp”:“2021-06-01 22:07:38”,“sub_code”:"",“location”:“Atlanta, GA, US”,“timestamp”:“2021-06-02 02:07:38”,“info”:“Package is in transit to a UPS facility”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-02 14:37:00”,“sub_code”:"",“location”:“Atlanta, GA, US”,“timestamp”:“2021-06-02 18:37:00”,“info”:“Departed from Facility”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-03 00:37:00”,“sub_code”:"",“location”:“Fishersville, VA, US”,“timestamp”:“2021-06-03 04:37:00”,“info”:“Arrived at Facility”}]’, ‘27’, ‘2021-06-03 06:46:08’, ‘E463CDF8AAC9887752F2423C7ADAC933’, ‘3.0’, ‘0.0’, ‘2021-06-03 06:46:08’, ‘2021-06-03 18:46:08’, ‘0.0’, ‘2021-06-01 23:30:02’, NULL, ‘Create’, ‘2021-06-02 06:46:01’, ‘’, ‘2021-06-02 18:46:06’),
(‘60a210bc3869411041e75798’, NULL, NULL, ‘2021-06-03 10:06:15’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-2’, ‘1456360’, ‘2021-06-03 10:06:10’, ‘60a210bc3869411041e75798’, ‘-1’, NULL, ‘121-210517-1355’, ‘121-210517-1355’, ‘JJD0002247242092246’, ‘’, ‘M41 9DD’, ‘GB’, ‘URMSTON’, ‘’, ‘UK-3’, ‘1344181845515845872’, ‘L101210517210461197’, NULL, ‘11.0’, ‘HUBEUROPE’, ‘New_YODEL_Xpress48H_L’, ‘TR_HubEurope’, ‘0.0’, ‘TMS_OC’, ‘2021-05-17 14:44:12’, ‘2021-05-17 14:44:12’, ‘2021-05-17 14:44:12’, ‘20210602’, ‘98’, ‘[{“original_code”:“PU”,“code”:“TMS_OC”,“original_timestamp”:“2021-05-17 08:00:00”,“sub_code”:"",“location”:“LICHFIELD SERVICE CENTRE”,“timestamp”:“2021-05-17 08:00:00”,“info”:“Parcel data received awaiting coll.”},{“original_code”:“EA”,“code”:“TMS_OC”,“original_timestamp”:“2021-05-18 03:31:16”,“sub_code”:"",“location”:“LICHFIELD SERVICE CENTRE”,“timestamp”:“2021-05-18 03:31:16”,“info”:“Verified Delivery Address”},{“original_code”:“15”,“code”:“TMS_UN”,“original_timestamp”:“2021-05-18 08:00:00”,“sub_code”:"",“location”:“LICHFIELD SERVICE CENTRE”,“timestamp”:“2021-05-18 08:00:00”,“info”:“No pan data received”}]’, ‘27’, ‘2021-06-03 06:46:11’, ‘CDAF6A182B3175EC20D15067A16E9DE1’, ‘2.0’, ‘0.0’, ‘2021-05-18 06:44:18’, ‘2021-06-03 18:46:11’, ‘0.0’, NULL, NULL, ‘Create’, ‘’, ‘’, ‘2021-06-02 18:46:06’),
(‘60b7292338694110413eef66’, NULL, NULL, ‘2021-06-03 10:06:15’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-2’, ‘1456362’, ‘2021-06-03 10:06:10’, ‘60b7292338694110413eef66’, ‘-1’, NULL, ‘G1995-210602-0346’, ‘G1995-210602-0346’, ‘92748902711830543400397343’, ‘’, ‘92647’, ‘US’, ‘Huntington Beach’, ‘CA’, ‘USEA-5’, ‘1336578408821293173’, ‘L101210602210252766’, ‘-5.0’, ‘11.0’, ‘UPS’, ‘UPS_MI_4B’, ‘TR_UPS_MI’, ‘0.0’, ‘TMS_OC’, ‘2021-06-02 14:45:55’, ‘2021-06-02 14:45:55’, ‘2021-06-02 14:45:55’, ‘20210602’, ‘68’, ‘[{“code”:“TMS_OC”,“original_timestamp”:“2021-06-02 10:45:02”,“sub_code”:"",“location”:“United States”,“timestamp”:“2021-06-02 14:45:02”,“info”:“Order information received”}]’, ‘13’, ‘2021-06-03 06:46:07’, ‘1F0A5D5F9E3223DC4407315A3C38BB20’, ‘2.0’, ‘0.0’, ‘2021-06-03 06:46:07’, ‘2021-06-03 18:46:07’, ‘0.0’, NULL, NULL, ‘Create’, ‘’, ‘’, ‘2021-06-02 18:46:06’),
(‘60adee753869411041855c03’, NULL, NULL, ‘2021-06-03 10:06:15’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-2’, ‘1456396’, ‘2021-06-03 10:06:10’, ‘60adee753869411041855c03’, ‘-1’, NULL, ‘BG2105260133576’, ‘BG2105260133576’, ‘00EUERFO’, ‘’, ‘68100’, ‘FR’, ‘Mulhouse’, ‘Haut-rhin’, ‘FR’, ‘1240467722291122434’, ‘L101210526210302064’, NULL, ‘1169.0’, ‘FRGLS’, ‘FR_GLS’, ‘TR_FRGLS’, ‘0.0’, ‘TMS_OC’, ‘2021-05-26 14:45:09’, ‘2021-05-26 14:45:09’, ‘2021-05-26 14:45:09’, ‘20210602’, ‘87’, ‘[{“original_code”:“0.100”,“code”:“TMS_OC”,“original_timestamp”:“2021-05-26 16:45:08”,“sub_code”:"",“location”:", FR",“timestamp”:“2021-05-26 16:45:08”,“info”:“The parcel data was entered into the GLS IT system; the parcel was not yet handed over to GLS.”}]’, ‘15’, ‘2021-06-03 06:46:11’, ‘79F9C66F0F51C8B54414769C75066CF1’, ‘1.0’, ‘0.0’, ‘2021-05-26 18:45:11’, ‘2021-06-03 18:46:11’, ‘0.0’, NULL, NULL, ‘Create’, ‘’, ‘’, ‘2021-06-02 18:46:07’),
(‘60b486163869411041be06d1’, NULL, NULL, ‘2021-06-03 10:06:15’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-2’, ‘1456443’, ‘2021-06-03 10:06:10’, ‘60b486163869411041be06d1’, ‘-1’, NULL, ‘200-210531-2991’, ‘200-210531-2991’, ‘1ZA404V7YW95456879’, ‘’, ‘85345-7220’, ‘US’, ‘Peoria’, ‘AZ’, ‘USWE-5’, ‘1303147225748090941’, ‘L101210531210284449’, NULL, ‘11.0’, ‘JS’, ‘JS_SUREPOST’, ‘TR_JS’, ‘0.0’, ‘TMS_IT’, ‘2021-05-31 14:45:42’, ‘2021-05-31 14:45:42’, ‘2021-05-31 14:45:42’, ‘20210602’, ‘92’, ‘[{“original_code”:“M”,“code”:“TMS_OC”,“original_timestamp”:“2021-05-31 07:45:38”,“sub_code”:"",“location”:", , US",“timestamp”:“2021-05-31 07:45:38”,“info”:“Shipper created a label, UPS has not received the package yet.”},{“original_code”:“I”,“code”:“TMS_PU”,“original_timestamp”:“2021-06-01 21:59:59”,“sub_code”:"",“location”:“Ontario, CA, US”,“timestamp”:“2021-06-01 21:59:59”,“info”:“Origin Scan”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-02 10:12:00”,“sub_code”:"",“location”:“Ontario, CA, US”,“timestamp”:“2021-06-02 10:12:00”,“info”:“Departed from Facility”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-02 15:03:00”,“sub_code”:"",“location”:“Goodyear, AZ, US”,“timestamp”:“2021-06-02 15:03:00”,“info”:“Arrived at Facility”}]’, ‘8’, ‘2021-06-03 06:46:10’, ‘71E350224161E7648E1C9DC27F3B0A98’, ‘4.0’, ‘0.0’, ‘2021-06-03 06:46:10’, ‘2021-06-03 18:46:10’, ‘0.0’, ‘2021-06-01 21:59:59’, NULL, ‘Create’, ‘2021-06-02 06:46:01’, ‘’, ‘2021-06-02 18:46:07’),
(‘60b0918838694110410ad9e0’, NULL, NULL, ‘2021-06-03 10:06:15’, ‘9045’, ‘UPDATE’, NULL, NULL, NULL, ‘mongo.TmsTracking.sync_order-2’, ‘1456444’, ‘2021-06-03 10:06:10’, ‘60b0918838694110410ad9e0’, ‘-1’, NULL, ‘5713-210528-0022’, ‘5713-210528-0022’, ‘1ZF375V7YW98172196’, ‘’, ‘20878-5667’, ‘US’, ‘Gaithersburg’, ‘MD’, ‘USEA-5’, ‘1364168092388692238’, ‘L101210528210241781’, ‘-5.0’, ‘9.0’, ‘JS’, ‘JS_SUREPOST’, ‘TR_JS’, ‘1.0’, ‘TMS_FD’, ‘2021-05-28 14:45:28’, ‘2021-05-28 14:45:28’, ‘2021-05-28 14:45:28’, ‘20210602’, ‘-91’, ‘[{“original_code”:“M”,“code”:“TMS_OC”,“original_timestamp”:“2021-05-28 10:45:27”,“sub_code”:"",“location”:", , US",“timestamp”:“2021-05-28 14:45:27”,“info”:“Shipper created a label, UPS has not received the package yet.”},{“original_code”:“I”,“code”:“TMS_PU”,“original_timestamp”:“2021-05-31 19:42:23”,“sub_code”:"",“location”:“Monroe Township, NJ, US”,“timestamp”:“2021-05-31 23:42:23”,“info”:“Origin Scan”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-01 03:13:00”,“sub_code”:"",“location”:“Philadelphia, PA, US”,“timestamp”:“2021-06-01 07:13:00”,“info”:“Arrived at Facility”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-01 05:00:00”,“sub_code”:"",“location”:“Monroe Township, NJ, US”,“timestamp”:“2021-06-01 09:00:00”,“info”:“Departed from Facility”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-02 10:54:00”,“sub_code”:"",“location”:“Philadelphia, PA, US”,“timestamp”:“2021-06-02 14:54:00”,“info”:“Departed from Facility”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-02 13:38:00”,“sub_code”:"",“location”:“Gaithersburg, MD, US”,“timestamp”:“2021-06-02 17:38:00”,“info”:“Arrived at Facility”},{“original_code”:“X”,“code”:“TMS_EXCP”,“original_timestamp”:“2021-06-02 14:45:33”,“sub_code”:“TMS_EXCP_PDL”,“location”:“Gaithersburg, MD, US”,“timestamp”:“2021-06-02 18:45:33”,“info”:“UPS will be in your area and will deliver your package a day early.”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-02 14:46:31”,“sub_code”:"",“location”:“Gaithersburg, MD, US”,“timestamp”:“2021-06-02 18:46:31”,“info”:“Processing at UPS Facility”},{“original_code”:“I”,“code”:“TMS_IT”,“original_timestamp”:“2021-06-02 14:52:13”,“sub_code”:"",“location”:“Gaithersburg, MD, US”,“timestamp”:“2021-06-02 18:52:13”,“info”:“Loaded on Delivery Vehicle”},{“original_code”:“I”,“code”:“TMS_OD”,“original_timestamp”:“2021-06-02 17:31:20”,“sub_code”:"",“location”:“Gaithersburg, MD, US”,“timestamp”:“2021-06-02 21:31:20”,“info”:“Out For Delivery Today”},{“original_code”:“D”,“code”:“TMS_FD”,“original_timestamp”:“2021-06-02 20:20:55”,“sub_code”:"",“location”:“GAITHERSBURG, MD, US”,“timestamp”:“2021-06-03 00:20:55”,“info”:“Delivered”}]’, ‘8’, ‘2021-06-03 06:46:10’, ‘1F9FD505835422F1EF6CDD34A82D8D09’, ‘5.0’, ‘0.0’, ‘2021-06-03 06:46:10’, ‘2021-06-03 18:46:10’, ‘0.0’, ‘2021-05-31 23:42:23’, ‘2021-06-03 00:20:55’, ‘Create’, ‘2021-06-01 06:45:53’, ‘2021-06-03 06:46:10’, ‘2021-06-02 18:46:07’);

那是否有可能读缓存了。。。

应该不是缓存的问题,
我presto用mysql 驱动去查询 就不会出现这种情况

更新是怎么更新来着,把presto的查询sql也提供下,我来复现下试试

– 使用TiBigData查询的结果 row_wid对应的是tidb表的主键

SELECT

bt.row_wid , count (1)

FROM tidb.gc_lms.ods_tms_transtrack bt

WHERE

bt.creation_time >=DATE_FORMAT(DATE_TRUNC(‘day’, CURRENT_DATE ) - INTERVAL ‘1’ MONTH , ‘%Y-%m-%d 00:00:00’)

group by bt.row_wid having count (1) > 1

;

更新 这边是采取sparkstreaming 读取kafka 。 repalce到tidb的。上面给的insert的数据是落地到tidb的数据。

可能是这个原因,目前是每一个region单独取的快照时间,造成拿的tikv快照差个几毫秒的样子,今天我们修复下,改成全局取

你好 修复是指修复tibigdata 还是指修复tidb

tibigdata

ok 非常感谢

方便的话,麻烦也贴一下修复的 PR ,感谢

https://github.com/tidb-incubator/TiBigData/pull/78 在这里

1赞