情况是表都在zone2里面的p0,然后执行事务会触发分布式事务,需要确定下原因
运维说代理了OBProxy的负载均衡给出来了一个代理ip,sql如下
UPDATE
taker_orders
SET status
= ?, vwap
= ?, filled_volume
= ?, total_value
= ?, update_time
= ?, update_by
= ? WHERE taker_orders
.id
= ? AND taker_orders
.core_order_id
= ?
这里面core_order_id这个是分区主键
建表语句如下
CREATE TABLE taker_orders
(
id
varchar(255) COLLATE utf8mb4_bin NOT NULL,
core_order_id
varchar(255) COLLATE utf8mb4_bin NOT NULL DEFAULT ‘’,
request_id
varchar(255) COLLATE utf8mb4_bin NOT NULL,
external_order_id
varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
省略了一些字段
PRIMARY KEY (id
, core_order_id
),
KEY takerorder_external_order_id_taker_id
(external_order_id
, taker_id
) BLOCK_SIZE 16384 LOCAL,
KEY takerorder_core_order_id
(core_order_id
) BLOCK_SIZE 16384 LOCAL,
KEY taker_orders_create_time
(create_time
) BLOCK_SIZE 16384 LOCAL,
KEY takerorder_request_id
(request_id
) BLOCK_SIZE 16384 LOCAL
) DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = DYNAMIC COMPRESSION = ‘zstd_1.3.8’ REPLICA_NUM = 3 BLOCK_SIZE = 16384 USE_BLOOM_FILTER = FALSE TABLET_SIZE = 134217728 PCTFREE = 0 TABLEGROUP = ‘clearing_cloud_v2_group’
partition by key(core_order_id)
(partition p0
,
partition p1
,
partition p2
,
partition p3
,
partition p4
,
partition p5
);
需要怎么指定能到本地事务,根据https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000508104这个文档,无法了解Session 指的是什么,以及怎么去匹配把这个事务搞成本地事务,在线等,急