Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
By replaying IoTDBTimePartitionIT.testOrderByTimeDesc
Steps:
- Setup a 3 nodes cluster with 2 replicas
- Enable time partition with partition_interval 2592000
- Prepare the following data
insert into root.group_1.d_1(timestamp, s_1) values(2018-07-18T00:00:00.000+08:00, 18.0); insert into root.group_1.d_1(timestamp, s_1) values(2018-07-19T00:00:00.000+08:00, 19.0); insert into root.group_1.d_1(timestamp, s_1) values(2019-08-19T00:00:00.000+08:00, 20.0);
By executing query
select * from root.group_1.d_1 order by time desc;
We got
The result order is incorrect.
The main reason is:
The underlying data has been separated into different partitions, so we use two readers to read them. As we specify the decending order, the reader returns the data in a descending manner. However, in current cluster query, the AssignPathPriorityMergeReader merges the data from mutl readers with a min heap. But we need to use a max heap in a decending query.
reader1 returns [2019-08-19, 2018-07-19] reader2 returns [2018-07-18] Use a min heap, it returns 2018-07-18 firstly. and then reader2 is empty, it will return 2019-08-19, and 2018-07-19. If we use a max heap instead, it will return 2019-08-19 firstly. And reader1 has 2018-07-19 left, reader2 has 2018-07-18. Then 2018-07-19 will be returned because of the max heap. The last one is 2018-07-18.
Attachments
Attachments
Issue Links
- relates to
-
IOTDB-2146 After starting the 3nodes 2 replicas, insert 3 pieces of data into one node, and queried data and number are wrong
- Closed
- links to