The two data nodes return different results, the step as follow:
bash run_cluster.sh # defalut script
2. Connect querytskv1 to create a new table, write data, and count tag counts:
➜ cnosdb git:(LTS/2.3) ✗ cnosdb-cli
CnosDB CLI v2.4.0
Input arguments: CliArgs { subcommand: None, host: "localhost", port: 8902, user: "root", password: None, private_key_path: None, database: "public", tenant: "cnosdb", precision: None, target_partitions: None, stream_trigger_interval: None, data_path: None, receive_data_encoding: None, send_data_encoding: None, file: [], rc: None, format: Table, quiet: false, write_line_protocol: None, use_ssl: false, use_unsafe_ssl: false, cacert: [], chunked: false, error_stop: false, process_cli_command: false }
public ❯ \d
Query took 0.041 seconds.
public ❯ CREATE TABLE air (visibility DOUBLE,temperature DOUBLE,pressure DOUBLE,TAGS(station));
INSERT INTO air (TIME, station, visibility, temperature, pressure) VALUES (1667456411000000000, 'XiaoMaiDao1', 56, 69, 411);
INSERT INTO air (TIME, station, visibility, temperature, pressure) VALUES (1667456411000000000, 'XiaoMaiDao2', 56, 69, 411);
INSERT INTO air (TIME, station, visibility, temperature, pressure) VALUES (1667456411000000000, 'XiaoMaiDao3', 56, 69, 411);
INSERT INTO air (TIME, station, visibility, temperature, pressure) VALUES (1667456411000000000, 'XiaoMaiDao4', 56, 69, 411);
Query took 0.017 seconds.
+------+
| rows |
+------+
| 1 |
+------+
Query took 0.045 seconds.
+------+
| rows |
+------+
| 1 |
+------+
Query took 0.008 seconds.
+------+
| rows |
+------+
| 1 |
+------+
Query took 0.007 seconds.
+------+
| rows |
+------+
| 1 |
+------+
Query took 0.007 seconds.
public ❯ \d
+------------+
| table_name |
+------------+
| air |
+------------+
Query took 0.016 seconds.
public ❯ select count(*) from air;
+-----------------+
| COUNT(UInt8(1)) |
+-----------------+
| 4 |
+-----------------+
Query took 0.009 seconds.
public ❯ \d air
+-------------+-----------------------+-------------+-------------------+
| column_name | data_type | column_type | compression_codec |
+-------------+-----------------------+-------------+-------------------+
| time | TIMESTAMP(NANOSECOND) | TIME | DEFAULT |
| station | STRING | TAG | DEFAULT |
| visibility | DOUBLE | FIELD | DEFAULT |
| temperature | DOUBLE | FIELD | DEFAULT |
| pressure | DOUBLE | FIELD | DEFAULT |
+-------------+-----------------------+-------------+-------------------+
Query took 0.012 seconds.
public ❯ select count(station) from air;
+--------------------+
| COUNT(air.station) |
+--------------------+
| 4 |
+--------------------+
Query took 0.015 seconds.
Connect querytskv2 to query the number of tags:
cnosdb git:(LTS/2.3) ✗ cnosdb-cli -P 8912
CnosDB CLI v2.4.0
Input arguments: CliArgs { subcommand: None, host: "localhost", port: 8912, user: "root", password: None, private_key_path: None, database: "public", tenant: "cnosdb", precision: None, target_partitions: None, stream_trigger_interval: None, data_path: None, receive_data_encoding: None, send_data_encoding: None, file: [], rc: None, format: Table, quiet: false, write_line_protocol: None, use_ssl: false, use_unsafe_ssl: false, cacert: [], chunked: false, error_stop: false, process_cli_command: false }
public ❯ \c test
Cannot connect to database test.
422 Unprocessable Entity, details: {"error_code":"030017","error_message":"Database not found: \"test\""}
public ❯ \d
+------------+
| table_name |
+------------+
| air |
+------------+
Query took 0.018 seconds.
public ❯ select count(*) from air;
+-----------------+
| COUNT(UInt8(1)) |
+-----------------+
| 4 |
+-----------------+
Query took 0.019 seconds.
public ❯ \d air
+-------------+-----------------------+-------------+-------------------+
| column_name | data_type | column_type | compression_codec |
+-------------+-----------------------+-------------+-------------------+
| time | TIMESTAMP(NANOSECOND) | TIME | DEFAULT |
| station | STRING | TAG | DEFAULT |
| visibility | DOUBLE | FIELD | DEFAULT |
| temperature | DOUBLE | FIELD | DEFAULT |
| pressure | DOUBLE | FIELD | DEFAULT |
+-------------+-----------------------+-------------+-------------------+
Query took 0.022 seconds.
public ❯ select count(station) from air;
+--------------------+
| COUNT(air.station) |
+--------------------+
| |
+--------------------+
Query took 2.138 seconds.
Why are the two results different for the same table? Does anyone else have the same problem?
Maybe a bug, could you make a issue for cnosdb.