TBase is an enterprise-level distributed HTAP database. Through a single database cluster to provide users with highly consistent distributed database services and high-performance data warehouse services, a set of integrated enterprise-level solutions is formed.
场景:TBase按照部署文档进行两节点部署,导入1000仓,run一段时间后报错:
3:58:59,764 [Thread-696] ERROR jTPCCTData : Unexpected SQLException in NEW_ORDER
13:58:59,764 [Thread-696] ERROR jTPCCTData : ERROR: node:dn002, backend_pid:82192, nodename:dn002,backend_pid:82192,message:could not read block 158 in file "base/16388/18824": read only 0 of 8192 bytes
查看log信息:2022-01-18 09:59:51.182 CST,"test","test",50612,coord(49509.28),"[local]",61e61f02.c5b4,coord(49509.28),14,"SELECT",2022-01-18 09:59:30 CST,109/54,16671,ERROR,XX001,"could not read block 12 in file ""base/16388/16398"": read only 0 of 8192 bytes",,,,,,"SELECT d_tax, d_next_o_id FROM bmsql_district WHERE ((d_w_id = $1) AND (d_id = $2)) FOR UPDATE OF bmsql_district",,,"pgxc:cn001"
分区建表语句:
create table bmsql_district (
d_w_id integer not null,
d_id integer not null,
d_ytd decimal(12,2),
d_tax decimal(4,4),
d_next_o_id integer,
d_name varchar(10),
d_street_1 varchar(20),
d_street_2 varchar(20),
d_city varchar(20),
d_state char(2),
d_zip char(9)
)
partition by range (d_w_id) begin (1) step (10) partitions (10) distribute by shard(d_id) to group default_group;
create table bmsql_customer (
c_w_id integer not null,
c_d_id integer not null,
c_id integer not null,
c_discount decimal(4,4),
c_credit char(2),
c_last varchar(16),
c_first varchar(16),
c_credit_lim decimal(12,2),
c_balance decimal(12,2),
c_ytd_payment decimal(12,2),
c_payment_cnt integer,
c_delivery_cnt integer,
c_street_1 varchar(20),
c_street_2 varchar(20),
c_city varchar(20),
c_state char(2),
c_zip char(9),
c_phone char(16),
c_since timestamp,
c_middle char(2),
c_data varchar(500)
)
partition by range (c_w_id) begin (1) step (100) partitions (10) distribute by shard(c_d_id) to group default_group;
create sequence bmsql_hist_id_seq;
create table bmsql_history (
hist_id integer,
h_c_id integer,
h_c_d_id integer,
h_c_w_id integer,
h_d_id integer,
h_w_id integer,
h_date timestamp,
h_amount decimal(6,2),
h_data varchar(24)
)
partition by range (h_w_id) begin (1) step (100) partitions (10) distribute by shard(h_d_id) to group default_group;
create table bmsql_new_order (
no_w_id integer not null,
no_d_id integer not null,
no_o_id integer not null
)
partition by range (no_w_id) begin (1) step (100) partitions (10) distribute by shard(no_d_id) to group default_group;
create table bmsql_oorder (
o_w_id integer not null,
o_d_id integer not null,
o_id integer not null,
o_c_id integer,
o_carrier_id integer,
o_ol_cnt integer,
o_all_local integer,
o_entry_d timestamp
)
partition by range (o_w_id) begin (1) step (100) partitions (10) distribute by shard(o_d_id) to group default_group;
create table bmsql_order_line (
ol_w_id integer not null,
ol_d_id integer not null,
ol_o_id integer not null,
ol_number integer not null,
ol_i_id integer not null,
ol_delivery_d timestamp,
ol_amount decimal(6,2),
ol_supply_w_id integer,
ol_quantity integer,
ol_dist_info char(24)
)
partition by range (ol_w_id) begin (1) step (100) partitions (10) distribute by shard(ol_d_id) to group default_group;
场景:TBase按照部署文档进行两节点部署,导入1000仓,run一段时间后报错: 3:58:59,764 [Thread-696] ERROR jTPCCTData : Unexpected SQLException in NEW_ORDER 13:58:59,764 [Thread-696] ERROR jTPCCTData : ERROR: node:dn002, backend_pid:82192, nodename:dn002,backend_pid:82192,message:could not read block 158 in file "base/16388/18824": read only 0 of 8192 bytes
查看log信息:2022-01-18 09:59:51.182 CST,"test","test",50612,coord(49509.28),"[local]",61e61f02.c5b4,coord(49509.28),14,"SELECT",2022-01-18 09:59:30 CST,109/54,16671,ERROR,XX001,"could not read block 12 in file ""base/16388/16398"": read only 0 of 8192 bytes",,,,,,"SELECT d_tax, d_next_o_id FROM bmsql_district WHERE ((d_w_id = $1) AND (d_id = $2)) FOR UPDATE OF bmsql_district",,,"pgxc:cn001"
分区建表语句: create table bmsql_district ( d_w_id integer not null, d_id integer not null, d_ytd decimal(12,2), d_tax decimal(4,4), d_next_o_id integer, d_name varchar(10), d_street_1 varchar(20), d_street_2 varchar(20), d_city varchar(20), d_state char(2), d_zip char(9) ) partition by range (d_w_id) begin (1) step (10) partitions (10) distribute by shard(d_id) to group default_group;
create table bmsql_customer ( c_w_id integer not null, c_d_id integer not null, c_id integer not null, c_discount decimal(4,4), c_credit char(2), c_last varchar(16), c_first varchar(16), c_credit_lim decimal(12,2), c_balance decimal(12,2), c_ytd_payment decimal(12,2), c_payment_cnt integer, c_delivery_cnt integer, c_street_1 varchar(20), c_street_2 varchar(20), c_city varchar(20), c_state char(2), c_zip char(9), c_phone char(16), c_since timestamp, c_middle char(2), c_data varchar(500) ) partition by range (c_w_id) begin (1) step (100) partitions (10) distribute by shard(c_d_id) to group default_group;
create sequence bmsql_hist_id_seq;
create table bmsql_history ( hist_id integer, h_c_id integer, h_c_d_id integer, h_c_w_id integer, h_d_id integer, h_w_id integer, h_date timestamp, h_amount decimal(6,2), h_data varchar(24) ) partition by range (h_w_id) begin (1) step (100) partitions (10) distribute by shard(h_d_id) to group default_group;
create table bmsql_new_order ( no_w_id integer not null, no_d_id integer not null, no_o_id integer not null ) partition by range (no_w_id) begin (1) step (100) partitions (10) distribute by shard(no_d_id) to group default_group;
create table bmsql_oorder ( o_w_id integer not null, o_d_id integer not null, o_id integer not null, o_c_id integer, o_carrier_id integer, o_ol_cnt integer, o_all_local integer, o_entry_d timestamp ) partition by range (o_w_id) begin (1) step (100) partitions (10) distribute by shard(o_d_id) to group default_group;
create table bmsql_order_line ( ol_w_id integer not null, ol_d_id integer not null, ol_o_id integer not null, ol_number integer not null, ol_i_id integer not null, ol_delivery_d timestamp, ol_amount decimal(6,2), ol_supply_w_id integer, ol_quantity integer, ol_dist_info char(24) ) partition by range (ol_w_id) begin (1) step (100) partitions (10) distribute by shard(ol_d_id) to group default_group;
create table bmsql_item ( i_id integer not null, i_name varchar(24), i_price decimal(5,2), i_data varchar(50), i_im_id integer );
create table bmsql_stock ( s_w_id integer not null, s_i_id integer not null, s_quantity integer, s_ytd integer, s_order_cnt integer, s_remote_cnt integer, s_data varchar(50), s_dist_01 char(24), s_dist_02 char(24), s_dist_03 char(24), s_dist_04 char(24), s_dist_05 char(24), s_dist_06 char(24), s_dist_07 char(24), s_dist_08 char(24), s_dist_09 char(24), s_dist_10 char(24) ) partition by range (s_w_id) begin (1) step (100) partitions (10) distribute by shard(s_i_id) to group default_group;