Skip to content

sql, storage: SCATTER doesn't do anything #17341

@RaduBerinde

Description

@RaduBerinde
root@:26257/ro> ALTER TABLE devices SCATTER;
+-----+--------+
| key | pretty |
+-----+--------+
+-----+--------+
(0 rows)
root@:26257/ro> SHOW TESTING_RANGES FROM TABLE devices;
+-----------+---------+----------+--------------+
| Start Key | End Key | Replicas | Lease Holder |
+-----------+---------+----------+--------------+
| NULL      | NULL    | {1,2,3}  |            3 |
+-----------+---------+----------+--------------+

The scatter command returns instantly and nothing changes (I can repeat the above many times and always see the same lease holder).

root@:26257/ro> alter table raw_visits scatter;
+-----+--------+
| key | pretty |
+-----+--------+
+-----+--------+
(0 rows)
root@:26257/ro> SHOW TESTING_RANGES FROM TABLE raw_visits;
+-----------+---------+----------+--------------+
| Start Key | End Key | Replicas | Lease Holder |
+-----------+---------+----------+--------------+
| NULL      | /1      | {1,2,3}  |            2 |
| /1        | /10     | {1,2,3}  |            1 |
| /10       | /20     | {1,2,3}  |            1 |
| /20       | /50     | {1,2,3}  |            1 |
| /50       | /100    | {1,2,3}  |            1 |
| /100      | NULL    | {1,2,3}  |            1 |
+-----------+---------+----------+--------------+
(6 rows)
root@:26257/ro> ALTER TABLE raw_visits SCATTER;
+-----+--------+
| key | pretty |
+-----+--------+
+-----+--------+
(0 rows)
root@:26257/ro> SHOW TESTING_RANGES FROM TABLE raw_visits;
+-----------+---------+----------+--------------+
| Start Key | End Key | Replicas | Lease Holder |
+-----------+---------+----------+--------------+
| NULL      | /1      | {1,2,3}  |            2 |
| /1        | /10     | {1,2,3}  |            1 |
| /10       | /20     | {1,2,3}  |            1 |
| /20       | /50     | {1,2,3}  |            1 |
| /50       | /100    | {1,2,3}  |            1 |
| /100      | NULL    | {1,2,3}  |            1 |
+-----------+---------+----------+--------------+
(6 rows)

This is on a 3-node cluster. I expect the lease holders to change when we scatter. Is this no longer the case? @benesch

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions