After setting constraints on the RANGE default zone, the system.replication_constraint_stats incorrectly report system ranges which are in violation of the zone configuration.
ALTER RANGE default CONFIGURE ZONE USING
num_replicas = 5,
constraints = '{+DC=dc1: 2, +DC=dc2: 2, +region=region2: 1}';
Populating any user-created database correctly replicates based on the constraints and there are therefore no entries in the system.replication_constraints_stats table.
However, ranges that belong to the system database do not conform to these constraints because they conform to the RANGE system zone configuration instead. However, when querying system.replication_constraints_stats, system ranges can appear in here as a violation, for example:
The system.replication_constraints_stats table should not be validating system ranges against default ranges. This table should not be populated as a result of the above zone configuration.
I now have a client that is experiencing this scenario and it is causing their internally written health/sanity checks to fail before various maint activities move forward.
After setting constraints on the
RANGE default
zone, thesystem.replication_constraint_stats
incorrectly report system ranges which are in violation of the zone configuration.To Reproduce
Create 9 nodes, with the following localities:
Then run:
Populating any user-created database correctly replicates based on the constraints and there are therefore no entries in the
system.replication_constraints_stats
table.However, ranges that belong to the
system
database do not conform to these constraints because they conform to theRANGE system
zone configuration instead. However, when queryingsystem.replication_constraints_stats
, system ranges can appear in here as a violation, for example:The system.replication_constraints_stats table should not be validating system ranges against default ranges. This table should not be populated as a result of the above zone configuration.
Verified on CRDB 21.1.6 and 21.1.8
Jira issue: CRDB-9905
Epic CRDB-32131