Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to modify the zone configuration for the system.jobs table directly #39605

Closed
rkruze opened this issue Aug 12, 2019 · 2 comments · Fixed by #39638
Closed

Not able to modify the zone configuration for the system.jobs table directly #39605

rkruze opened this issue Aug 12, 2019 · 2 comments · Fixed by #39638
Assignees
Labels
A-kv Anything in KV that doesn't belong in a more specific category. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-productivity Severe issues that impede the productivity of CockroachDB developers.

Comments

@rkruze
Copy link

rkruze commented Aug 12, 2019

Describe the problem

Please describe the issue you observed, and any steps we can take to reproduce it:

When I go running the following command

ALTER TABLE system.public.jobs CONFIGURE ZONE USING                                                                                                                                                                                                                                                                                                     range_min_bytes = 16777216,                                                                                                                                                                                                                                                                                                                                                      range_max_bytes = 134217728,                                                                                                                                                                                                                                                                                                                                                     gc.ttlseconds = 600,                                                                                                                                                                                                                                                                                                                                                             num_replicas = 5,                                                                                                                                                                                                                                                                                                                                                                constraints = '[]',                                                                                                                                                                                                                                                                                                                                                              lease_preferences = '[]';

I would expect that when I go to the range report for the ranges making up the jobs table that they would state 128 MiB for Max Range Size Before Split. However, after the alter table command above it still shows 64 MiB. It is only when I do the following that I see the value for this range change:

ALTER DATABASE system CONFIGURE ZONE USING
	range_min_bytes = 16777216,
	range_max_bytes = 134217728,
	gc.ttlseconds = 90000,
	num_replicas = 5,
	constraints = '[]',
	lease_preferences = '[]'

Environment:

  • CockroachDB version 19.1.3
  • Server OS: Linux
@bdarnell
Copy link
Contributor

Indeed:

// For now, you can only set a zone config on the system database as a whole,
// not on any of its constituent tables. This is largely because all the
// "system config" tables are colocated in the same range by default and
// thus couldn't be managed separately.
objectID = keys.SystemDatabaseID

The simple fix is to change MaxReservedDescID to MaxSystemConfigDescID. This will create the slightly odd situation in which it's possible to set zone configs on some tables but not others (the gossiped tables will still ignore their zone configs in favor of the database-level one), but it would at least let us set zone configs on the jobs table.

@bdarnell
Copy link
Contributor

Note that this applies to both manual zone config changes like the one described here and the default zone config that sets the GC for this table (since version 2.0). So the jobs table has in practice been getting the default 24h gc instead of the intended 10m.

@ajwerner ajwerner self-assigned this Aug 13, 2019
@awoods187 awoods187 added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-productivity Severe issues that impede the productivity of CockroachDB developers. labels Aug 13, 2019
@awoods187 awoods187 added the A-kv Anything in KV that doesn't belong in a more specific category. label Aug 13, 2019
ajwerner added a commit to ajwerner/cockroach that referenced this issue Aug 15, 2019
Before this PR we would allow setting zone configurations on system tables but
they would not propagate because the GetZoneConfig function would return the
zone config for the entire system database. This leaves us in a still weird
situation where some system tables will ignore their zone configs but not
others.

Fixes cockroachdb#39605.

Release note (bug fix): Propagate zone configuration to non-gossiped system
tables.
craig bot pushed a commit that referenced this issue Aug 15, 2019
39638: config: propagate zone config info for non-gossiped system tables r=nvanbenschoten a=ajwerner

Before this PR we would allow setting zone configurations on system tables but
they would not propagate because the GetZoneConfig function would return the
zone config for the entire system database. This leaves us in a still weird
situation where some system tables will ignore their zone configs but not
others.

Fixes #39605.

Release note (bug fix): Propagate zone configuration to non-gossiped system
tables.

Co-authored-by: Andrew Werner <[email protected]>
@craig craig bot closed this as completed in #39638 Aug 15, 2019
ajwerner added a commit to ajwerner/cockroach that referenced this issue Aug 15, 2019
Before this PR we would allow setting zone configurations on system tables but
they would not propagate because the GetZoneConfig function would return the
zone config for the entire system database. This leaves us in a still weird
situation where some system tables will ignore their zone configs but not
others.

Fixes cockroachdb#39605.

Release note (bug fix): Propagate zone configuration to non-gossiped system
tables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-kv Anything in KV that doesn't belong in a more specific category. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-productivity Severe issues that impede the productivity of CockroachDB developers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants