1

I had write some data in cnosdb and now I want to append a new column to my table. After using the RESTful write API, the new column can be queried but all values in the new column is just null.

I think it is a bug, or caused by my mistake, which one is it.

Branch: LTS/2.3 8a8b09a6 (2023-07-28)

Document: https://docs.cnosdb.com/en/latest/reference/rest_api.html

I can give the minimal replay:

# Start an instance of cnsodb.
$ cargo run -- run -M singleton --config ./config/data_8902.toml

# Send two write request, with the same timestamp and different column.
# column 
$ curl -X POST -u 'root:root' 'http://127.0.0.1:8902/api/v1/write?db=public' -d 'ds_1,area=a1 c_1=1.11 1688169600000000'
$ curl -X POST -u 'root:root' 'http://127.0.0.1:8902/api/v1/write?db=public' -d 'ds_1,area=a1 c_2=33.1 1688169600000000'
 
# Send query request, and it gives unexpected result set.
# You can see the value of column "c_2" is empty.
$ curl -X POST -u 'root:' ‘http://127.0.0.1:8902/api/v1/sql?db=public’ -d 'select * from ds_1'
time,area,c_1,c_2
1970-01-20T12:56:09.600000000,a1,1.11,

But if you restart the cnosdb server, the result set will be correct, so it is a bug.

# Restart the cnsodb server.
$ cargo run -- run -M singleton --config ./config/data_8902.toml

# Send query request, and now it gives the correct result set.
curl -X POST -u 'root:' 'http://127.0.0.1:8902/api/v1/sql?db=public' -d 'select * from ds_1'
time,area,c_1,c_2
1970-01-20T12:56:09.600000000,a1,1.11,33.1
Darts
  • 153
  • 5

0 Answers0