test(compat): cover float SST encoding

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
This commit is contained in:
discord9
2026-09-04 19:23:03 +08:00
parent 74440ca050
commit 2a62d3f3ce
8 changed files with 68 additions and 2 deletions
@@ -1,8 +1,8 @@
name = "downgrade_compatibility"
reason = "Verify v1.1.4 can reopen a table whose region WAL options were written by the current binary, and can read all rows of an append-only table flushed and compacted with preserve_row_sequence enabled."
reason = "Verify v1.1.4 can reopen tables whose region WAL options or byte-stream-split (BSS) float SSTs were written by the current binary, and can read all rows of an append-only table flushed and compacted with preserve_row_sequence enabled."
introduced_by = "fix: preserve legacy region WAL options format; preserve_row_sequence"
topologies = ["distributed", "standalone"]
from_range = [">=v1.2.0"]
to_range = ["=v1.1.4"]
features = ["table", "wal", "downgrade", "append", "preserve_row_sequence"]
features = ["table", "wal", "downgrade", "append", "preserve_row_sequence", "sst", "float", "byte_stream_split"]
owner = "metasrv"
@@ -32,3 +32,18 @@ INSERT INTO t_preserve_sequence_downgrade VALUES
ADMIN FLUSH_TABLE('t_preserve_sequence_downgrade');
ADMIN COMPACT_TABLE('t_preserve_sequence_downgrade');
CREATE TABLE t_sst_float_field_encoding_downgrade(
ts TIMESTAMP TIME INDEX,
host STRING PRIMARY KEY,
f FLOAT,
d DOUBLE
) ENGINE=mito
WITH('experimental_sst_float_field_encoding'='byte_stream_split');
INSERT INTO t_sst_float_field_encoding_downgrade VALUES
('2024-02-10 00:00:00+0000', 'host_a', 1.25, 10.5),
('2024-02-10 00:01:00+0000', 'host_b', -2.5, 20.25),
('2024-02-10 00:02:00+0000', 'host_c', NULL, NULL);
ADMIN FLUSH_TABLE('t_sst_float_field_encoding_downgrade');
@@ -17,3 +17,15 @@ SELECT ts, host, val FROM t_preserve_sequence_downgrade ORDER BY ts, host;
| 2024-02-09T00:02:00 | host_a | 3 |
| 2024-02-09T00:03:00 | host_c | 4 |
+---------------------+--------+-----+
SELECT ts, host, f, d
FROM t_sst_float_field_encoding_downgrade
ORDER BY ts, host;
+---------------------+--------+------+------+
| ts | host | f | d |
+---------------------+--------+------+------+
| 2024-02-10T00:00:00 | host_a | 1.25 | 10.5 |
| 2024-02-10T00:01:00 | host_b | -2.5 | 20.25 |
| 2024-02-10T00:02:00 | host_c | | |
+---------------------+--------+------+------+
@@ -1,3 +1,7 @@
SELECT ts, host, val FROM t_downgrade_compatibility ORDER BY ts, host;
SELECT ts, host, val FROM t_preserve_sequence_downgrade ORDER BY ts, host;
SELECT ts, host, f, d
FROM t_sst_float_field_encoding_downgrade
ORDER BY ts, host;
@@ -0,0 +1,8 @@
name = "sst_float_field_encoding_upgrade"
reason = "Verify newer binaries can read default-encoded Mito SSTs containing FLOAT and DOUBLE fields written by older binaries."
introduced_by = "experimental_sst_float_field_encoding"
topologies = ["distributed", "standalone"]
from_range = ["*"]
to_range = ["*"]
features = ["table", "sst", "float", "upgrade"]
owner = "storage"
@@ -0,0 +1,13 @@
CREATE TABLE t_sst_float_field_encoding_upgrade(
ts TIMESTAMP TIME INDEX,
host STRING PRIMARY KEY,
f FLOAT,
d DOUBLE
) ENGINE=mito;
INSERT INTO t_sst_float_field_encoding_upgrade VALUES
('2024-02-10 00:00:00+0000', 'host_a', 1.25, 10.5),
('2024-02-10 00:01:00+0000', 'host_b', -2.5, 20.25),
('2024-02-10 00:02:00+0000', 'host_c', NULL, NULL);
ADMIN FLUSH_TABLE('t_sst_float_field_encoding_upgrade');
@@ -0,0 +1,11 @@
SELECT ts, host, f, d
FROM t_sst_float_field_encoding_upgrade
ORDER BY ts, host;
+---------------------+--------+------+------+
| ts | host | f | d |
+---------------------+--------+------+------+
| 2024-02-10T00:00:00 | host_a | 1.25 | 10.5 |
| 2024-02-10T00:01:00 | host_b | -2.5 | 20.25 |
| 2024-02-10T00:02:00 | host_c | | |
+---------------------+--------+------+------+
@@ -0,0 +1,3 @@
SELECT ts, host, f, d
FROM t_sst_float_field_encoding_upgrade
ORDER BY ts, host;