lealone / Lealone

比 MySQL 和 MongoDB 快10倍的 OLTP 关系数据库和文档数据库
Other
2.48k stars 520 forks source link

Sharding模式下插入后查询结果时有时无 #152

Closed J1031 closed 1 year ago

J1031 commented 2 years ago

根据文档Sharding集群搭建搭建了集群, 使用以下建库语句

CREATE DATABASE mydb_sharding RUN MODE sharding PARAMETERS(replication_factor: 2, assignment_factor: 2);

之后按文档建表, 并插入一条记录

insert into test values(1,2);

查询结果一会能查到, 一会查不到这条记录

sql> select * from test;
+----+----+
| F1 | F2 |
+----+----+
| 1  | 2  |
+----+----+
(1 row, 2 ms)

sql> select * from test;
+----+----+
| F1 | F2 |
+----+----+
| 1  | 2  |
+----+----+
(1 row, 2 ms)

sql> select * from test;
+----+----+
| F1 | F2 |
+----+----+
+----+----+
(0 rows, 1 ms)

sql> select * from test;
+----+----+
| F1 | F2 |
+----+----+
| 1  | 2  |
+----+----+
codefollower commented 2 years ago

应该是个 bug,感谢报告问题。