You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For indexes containing more than one column, SCRUB incorrectly reports an index_key_decoding_error during a PHYSICAL check table scan whenever it detects a value in a column that is earlier in sorted order than the value in the previous row.
In the below example, the val column is not in sorted order because it's not the first column in the primary key:
[email protected]:63898/defaultdb> show create test;
table_name | create_statement
+------------+---------------------------------------------------------+
test | CREATE TABLE test (
| id INT NOT NULL,
| val INT NOT NULL,
| CONSTRAINT "primary" PRIMARY KEY (id ASC, val ASC),
| FAMILY "primary" (id, val)
| )
(1 row)
Time: 4.194ms
[email protected]:63898/defaultdb> select * from test;
id | val
+----+-----+
1 | 2
2 | 1
(2 rows)
Time: 653µs
[email protected]:63898/defaultdb> experimental scrub table test with options physical;
job_uuid | error_type | database | table | primary_key | timestamp | repaired | details
+----------+--------------------------+-----------+-------+-------------+----------------------------------+----------+---------------------------------------------------------------------------------------------------------------------------------------------------+
NULL | index_key_decoding_error | defaultdb | test | (2,1) | 2018-12-05 21:51:18.954254+00:00 | false | {"error_message": "key ordering did not match datum ordering. IndexDescriptor=ASC", "index_name": "primary", "row_data": {"id": "2", "val": "1"}}
(1 row)
Time: 934µs
Previously `SCRUB` would erroneously report that index keys were out of order
for columns other than the first column in an index. This fixes the bug.
Fixescockroachdb#32874.
Release note (bug fix): Fixed bug where SCRUB would erroneously report that
index keys were out of order.
32908: sql: fix SCRUB index key order checking r=lucy-zhang a=lucy-zhang
Previously `SCRUB` would erroneously report that index keys were out of order
for columns other than the first column in an index. This fixes the bug.
Fixes#32874.
Release note (bug fix): Fixed bug where SCRUB would erroneously report that
index keys were out of order.
Co-authored-by: Lucy Zhang <[email protected]>
For indexes containing more than one column,
SCRUB
incorrectly reports anindex_key_decoding_error
during aPHYSICAL
check table scan whenever it detects a value in a column that is earlier in sorted order than the value in the previous row.In the below example, the
val
column is not in sorted order because it's not the first column in the primary key:The logic in https://github.com/cockroachdb/cockroach/blob/master/pkg/sql/row/fetcher.go#L1244 needs to be fixed.
The text was updated successfully, but these errors were encountered: