diff --git a/pkg/ccl/spanconfigccl/spanconfigcomparedccl/testdata/basic b/pkg/ccl/spanconfigccl/spanconfigcomparedccl/testdata/basic index 74e6eb111623..6edf48528517 100644 --- a/pkg/ccl/spanconfigccl/spanconfigcomparedccl/testdata/basic +++ b/pkg/ccl/spanconfigccl/spanconfigcomparedccl/testdata/basic @@ -20,6 +20,10 @@ ALTER TABLE db.t1 CONFIGURE ZONE USING num_voters = 5; # range's contents whenever anything in it changes. # - The span configs infrastructure doesn't, at least for now, for # inter-operability with the gossip-backed system. +# That said, the span configs infrastructure is used to drive whether +# rangefeeds are enabled on the system database tables. It also controls +# whether strict GC is enforced. For that reason we expect to find different +# span configs from each ("range system" vs. "database system"). configs version=legacy offset=4 limit=3 ---- @@ -33,8 +37,8 @@ configs version=current offset=4 limit=3 ---- ... /System/"tse" range system -/Table/SystemConfigSpan/Start range system -/Table/11 range system +/Table/SystemConfigSpan/Start database system (host) +/Table/11 database system (host) ... # Both subsystems observe splits for the tables created above. @@ -42,8 +46,8 @@ configs version=current offset=4 limit=3 configs version=current offset=41 ---- ... -/Table/46 range system -/Table/47 range system +/Table/46 database system (host) +/Table/47 database system (host) /Table/56 num_replicas=7 num_voters=5 /Table/57 num_replicas=7 @@ -55,10 +59,88 @@ configs version=legacy offset=41 /Table/56 num_replicas=7 num_voters=5 /Table/57 num_replicas=7 -# Both subsystems are identical with respect to exposed configs (including for -# pseudo table IDs). +# Both subsystems differ slightly with respect to exposed configs ("range +# system" vs. "database system" as described earlier). This only applies to +# tables in the system database, excluding pseudo table IDs. diff ---- +--- gossiped system config span (legacy) ++++ span config infrastructure (current) +@@ -4,42 +4,42 @@ + /System/tsd range default + /System/"tse" range system +-/Table/SystemConfigSpan/Start range system +-/Table/11 range system +-/Table/12 range system +-/Table/13 range system +-/Table/14 range system +-/Table/15 range system ++/Table/SystemConfigSpan/Start database system (host) ++/Table/11 database system (host) ++/Table/12 database system (host) ++/Table/13 database system (host) ++/Table/14 database system (host) ++/Table/15 database system (host) + /Table/16 range system + /Table/17 range system + /Table/18 range system +-/Table/19 range system +-/Table/20 range system +-/Table/21 range system ++/Table/19 database system (host) ++/Table/20 database system (host) ++/Table/21 database system (host) + /Table/22 range system +-/Table/23 range system +-/Table/24 range system +-/Table/25 ttl_seconds=600 num_replicas=5 +-/Table/26 range system +-/Table/27 ttl_seconds=600 num_replicas=5 +-/Table/28 range system ++/Table/23 database system (host) ++/Table/24 database system (host) ++/Table/25 ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true ++/Table/26 database system (host) ++/Table/27 ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true ++/Table/28 database system (host) + /Table/29 range system +-/NamespaceTable/30 range system +-/NamespaceTable/Max range system +-/Table/32 range system +-/Table/33 range system +-/Table/34 range system +-/Table/35 range system +-/Table/36 range system +-/Table/37 range system ++/NamespaceTable/30 database system (host) ++/NamespaceTable/Max database system (host) ++/Table/32 database system (host) ++/Table/33 database system (host) ++/Table/34 database system (host) ++/Table/35 database system (host) ++/Table/36 database system (host) ++/Table/37 database system (host) + /Table/38 range system +-/Table/39 range system +-/Table/40 range system +-/Table/41 range system +-/Table/42 range system +-/Table/43 range system +-/Table/44 range system +-/Table/45 ttl_seconds=7200 num_replicas=5 +-/Table/46 range system +-/Table/47 range system ++/Table/39 database system (host) ++/Table/40 database system (host) ++/Table/41 database system (host) ++/Table/42 database system (host) ++/Table/43 database system (host) ++/Table/44 database system (host) ++/Table/45 ttl_seconds=7200 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true ++/Table/46 database system (host) ++/Table/47 database system (host) + /Table/56 num_replicas=7 num_voters=5 + /Table/57 num_replicas=7 # vim:ft=diff diff --git a/pkg/ccl/spanconfigccl/spanconfigcomparedccl/testdata/multitenant b/pkg/ccl/spanconfigccl/spanconfigcomparedccl/testdata/multitenant index 3c2449d34d17..d805ad985a0c 100644 --- a/pkg/ccl/spanconfigccl/spanconfigcomparedccl/testdata/multitenant +++ b/pkg/ccl/spanconfigccl/spanconfigcomparedccl/testdata/multitenant @@ -12,30 +12,37 @@ initialize tenant=11 ---- # Before kicking starting off tenant reconciliation, we should find seed -# configs for the newly initialized tenants. As yet, there are no differences -# between the subsystems. +# configs for the newly initialized tenants. As yet, there are no (unexpected) +# differences between the subsystems. + configs version=current offset=43 ---- ... /Tenant/10 range default /Tenant/11 range default -diff +diff offset=73 ---- +--- gossiped system config span (legacy) ++++ span config infrastructure (current) +... + /Tenant/10 range default + /Tenant/11 range default reconcile tenant=11 ---- # As soon as tenant-11 starts reconciling, we should observe more fine-grained # span configs within its keyspan. This isn't true for the legacy system. + configs version=current offset=43 limit=5 ---- ... /Tenant/10 range default -/Tenant/11 range default -/Tenant/11/Table/4 range default -/Tenant/11/Table/5 range default -/Tenant/11/Table/6 range default +/Tenant/11 database system (tenant) +/Tenant/11/Table/4 database system (tenant) +/Tenant/11/Table/5 database system (tenant) +/Tenant/11/Table/6 database system (tenant) ... configs version=legacy offset=43 @@ -44,20 +51,21 @@ configs version=legacy offset=43 /Tenant/10 range default /Tenant/11 range default -diff limit=10 +diff offset=73 limit=10 ---- --- gossiped system config span (legacy) +++ span config infrastructure (current) -@@ -44,3 +44,36 @@ +... /Tenant/10 range default - /Tenant/11 range default -+/Tenant/11/Table/4 range default -+/Tenant/11/Table/5 range default -+/Tenant/11/Table/6 range default -+/Tenant/11/Table/7 range default -+/Tenant/11/Table/11 range default -+/Tenant/11/Table/12 range default -+/Tenant/11/Table/13 range default +-/Tenant/11 range default ++/Tenant/11 database system (tenant) ++/Tenant/11/Table/4 database system (tenant) ++/Tenant/11/Table/5 database system (tenant) ++/Tenant/11/Table/6 database system (tenant) ++/Tenant/11/Table/7 database system (tenant) ++/Tenant/11/Table/11 database system (tenant) ++/Tenant/11/Table/12 database system (tenant) ++/Tenant/11/Table/13 database system (tenant) ... # Sanity check that new tenant tables show up correctly. @@ -69,46 +77,47 @@ CREATE TABLE db.t2(); ALTER TABLE db.t1 CONFIGURE ZONE using num_replicas = 42, gc.ttlseconds = 1000; ---- -diff +diff offset=73 ---- --- gossiped system config span (legacy) +++ span config infrastructure (current) -@@ -44,3 +44,38 @@ +... /Tenant/10 range default - /Tenant/11 range default -+/Tenant/11/Table/4 range default -+/Tenant/11/Table/5 range default -+/Tenant/11/Table/6 range default -+/Tenant/11/Table/7 range default -+/Tenant/11/Table/11 range default -+/Tenant/11/Table/12 range default -+/Tenant/11/Table/13 range default -+/Tenant/11/Table/14 range default -+/Tenant/11/Table/15 range default -+/Tenant/11/Table/19 range default -+/Tenant/11/Table/20 range default -+/Tenant/11/Table/21 range default -+/Tenant/11/Table/23 range default -+/Tenant/11/Table/24 range default -+/Tenant/11/Table/25 range default -+/Tenant/11/Table/26 range default -+/Tenant/11/Table/27 range default -+/Tenant/11/Table/28 range default -+/Tenant/11/NamespaceTable/30 range default -+/Tenant/11/NamespaceTable/Max range default -+/Tenant/11/Table/32 range default -+/Tenant/11/Table/33 range default -+/Tenant/11/Table/34 range default -+/Tenant/11/Table/35 range default -+/Tenant/11/Table/36 range default -+/Tenant/11/Table/37 range default -+/Tenant/11/Table/39 range default -+/Tenant/11/Table/40 range default -+/Tenant/11/Table/41 range default -+/Tenant/11/Table/42 range default -+/Tenant/11/Table/43 range default -+/Tenant/11/Table/44 range default -+/Tenant/11/Table/46 range default +-/Tenant/11 range default ++/Tenant/11 database system (tenant) ++/Tenant/11/Table/4 database system (tenant) ++/Tenant/11/Table/5 database system (tenant) ++/Tenant/11/Table/6 database system (tenant) ++/Tenant/11/Table/7 database system (tenant) ++/Tenant/11/Table/11 database system (tenant) ++/Tenant/11/Table/12 database system (tenant) ++/Tenant/11/Table/13 database system (tenant) ++/Tenant/11/Table/14 database system (tenant) ++/Tenant/11/Table/15 database system (tenant) ++/Tenant/11/Table/19 database system (tenant) ++/Tenant/11/Table/20 database system (tenant) ++/Tenant/11/Table/21 database system (tenant) ++/Tenant/11/Table/23 database system (tenant) ++/Tenant/11/Table/24 database system (tenant) ++/Tenant/11/Table/25 database system (tenant) ++/Tenant/11/Table/26 database system (tenant) ++/Tenant/11/Table/27 database system (tenant) ++/Tenant/11/Table/28 database system (tenant) ++/Tenant/11/NamespaceTable/30 database system (tenant) ++/Tenant/11/NamespaceTable/Max database system (tenant) ++/Tenant/11/Table/32 database system (tenant) ++/Tenant/11/Table/33 database system (tenant) ++/Tenant/11/Table/34 database system (tenant) ++/Tenant/11/Table/35 database system (tenant) ++/Tenant/11/Table/36 database system (tenant) ++/Tenant/11/Table/37 database system (tenant) ++/Tenant/11/Table/39 database system (tenant) ++/Tenant/11/Table/40 database system (tenant) ++/Tenant/11/Table/41 database system (tenant) ++/Tenant/11/Table/42 database system (tenant) ++/Tenant/11/Table/43 database system (tenant) ++/Tenant/11/Table/44 database system (tenant) ++/Tenant/11/Table/46 database system (tenant) +/Tenant/11/Table/56 ttl_seconds=1000 num_replicas=42 +/Tenant/11/Table/57 range default diff --git a/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/basic b/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/basic index 672e67ff93f9..f412ee57f6e2 100644 --- a/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/basic +++ b/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/basic @@ -12,48 +12,48 @@ upsert /System/NodeLiveness{-Max} ttl_seconds=600 num_replicas=5 upsert /System/{NodeLivenessMax-tsd} range system upsert /System{/tsd-tse} range default upsert /System{tse-/Max} range system -upsert /Table/{SystemConfigSpan/Start-4} range system -upsert /Table/{4-5} range system -upsert /Table/{5-6} range system -upsert /Table/{6-7} range system -upsert /Table/{8-9} range system -upsert /Table/1{1-2} range system -upsert /Table/1{2-3} range system -upsert /Table/1{3-4} range system -upsert /Table/1{4-5} range system -upsert /Table/1{5-6} range system +upsert /Table/{SystemConfigSpan/Start-4} database system (host) +upsert /Table/{4-5} database system (host) +upsert /Table/{5-6} database system (host) +upsert /Table/{6-7} database system (host) +upsert /Table/{8-9} database system (host) +upsert /Table/1{1-2} database system (host) +upsert /Table/1{2-3} database system (host) +upsert /Table/1{3-4} database system (host) +upsert /Table/1{4-5} database system (host) +upsert /Table/1{5-6} database system (host) upsert /Table/1{6-7} range system upsert /Table/1{7-8} range system upsert /Table/1{8-9} range system -upsert /Table/{19-20} range system -upsert /Table/2{0-1} range system -upsert /Table/2{1-2} range system +upsert /Table/{19-20} database system (host) +upsert /Table/2{0-1} database system (host) +upsert /Table/2{1-2} database system (host) upsert /Table/2{2-3} range system -upsert /Table/2{3-4} range system -upsert /Table/2{4-5} range system -upsert /Table/2{5-6} ttl_seconds=600 num_replicas=5 -upsert /Table/2{6-7} range system -upsert /Table/2{7-8} ttl_seconds=600 num_replicas=5 -upsert /Table/2{8-9} range system +upsert /Table/2{3-4} database system (host) +upsert /Table/2{4-5} database system (host) +upsert /Table/2{5-6} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +upsert /Table/2{6-7} database system (host) +upsert /Table/2{7-8} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +upsert /Table/2{8-9} database system (host) upsert /{Table/29-NamespaceTable/30} range system -upsert /NamespaceTable/{30-Max} range system -upsert /{NamespaceTable/Max-Table/32} range system -upsert /Table/3{2-3} range system -upsert /Table/3{3-4} range system -upsert /Table/3{4-5} range system -upsert /Table/3{5-6} range system -upsert /Table/3{6-7} range system -upsert /Table/3{7-8} range system +upsert /NamespaceTable/{30-Max} database system (host) +upsert /{NamespaceTable/Max-Table/32} database system (host) +upsert /Table/3{2-3} database system (host) +upsert /Table/3{3-4} database system (host) +upsert /Table/3{4-5} database system (host) +upsert /Table/3{5-6} database system (host) +upsert /Table/3{6-7} database system (host) +upsert /Table/3{7-8} database system (host) upsert /Table/3{8-9} range system -upsert /Table/{39-40} range system -upsert /Table/4{0-1} range system -upsert /Table/4{1-2} range system -upsert /Table/4{2-3} range system -upsert /Table/4{3-4} range system -upsert /Table/4{4-5} range system -upsert /Table/4{5-6} ttl_seconds=7200 num_replicas=5 -upsert /Table/4{6-7} range system -upsert /Table/4{7-8} range system +upsert /Table/{39-40} database system (host) +upsert /Table/4{0-1} database system (host) +upsert /Table/4{1-2} database system (host) +upsert /Table/4{2-3} database system (host) +upsert /Table/4{3-4} database system (host) +upsert /Table/4{4-5} database system (host) +upsert /Table/4{5-6} ttl_seconds=7200 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +upsert /Table/4{6-7} database system (host) +upsert /Table/4{7-8} database system (host) exec-sql CREATE DATABASE db; @@ -93,25 +93,25 @@ ALTER DATABASE system CONFIGURE ZONE USING gc.ttlseconds = 100; mutations ---- delete /Table/{SystemConfigSpan/Start-4} -upsert /Table/{SystemConfigSpan/Start-4} ttl_seconds=100 num_replicas=5 +upsert /Table/{SystemConfigSpan/Start-4} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/{4-5} -upsert /Table/{4-5} ttl_seconds=100 num_replicas=5 +upsert /Table/{4-5} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/{5-6} -upsert /Table/{5-6} ttl_seconds=100 num_replicas=5 +upsert /Table/{5-6} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/{6-7} -upsert /Table/{6-7} ttl_seconds=100 num_replicas=5 +upsert /Table/{6-7} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/{8-9} -upsert /Table/{8-9} ttl_seconds=100 num_replicas=5 +upsert /Table/{8-9} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/1{1-2} -upsert /Table/1{1-2} ttl_seconds=100 num_replicas=5 +upsert /Table/1{1-2} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/1{2-3} -upsert /Table/1{2-3} ttl_seconds=100 num_replicas=5 +upsert /Table/1{2-3} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/1{3-4} -upsert /Table/1{3-4} ttl_seconds=100 num_replicas=5 +upsert /Table/1{3-4} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/1{4-5} -upsert /Table/1{4-5} ttl_seconds=100 num_replicas=5 +upsert /Table/1{4-5} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/1{5-6} -upsert /Table/1{5-6} ttl_seconds=100 num_replicas=5 +upsert /Table/1{5-6} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/1{6-7} upsert /Table/1{6-7} ttl_seconds=100 num_replicas=5 delete /Table/1{7-8} @@ -119,101 +119,101 @@ upsert /Table/1{7-8} ttl_seconds=100 num_replicas=5 delete /Table/1{8-9} upsert /Table/1{8-9} ttl_seconds=100 num_replicas=5 delete /Table/{19-20} -upsert /Table/{19-20} ttl_seconds=100 num_replicas=5 +upsert /Table/{19-20} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/2{0-1} -upsert /Table/2{0-1} ttl_seconds=100 num_replicas=5 +upsert /Table/2{0-1} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/2{1-2} -upsert /Table/2{1-2} ttl_seconds=100 num_replicas=5 +upsert /Table/2{1-2} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/2{2-3} upsert /Table/2{2-3} ttl_seconds=100 num_replicas=5 delete /Table/2{3-4} -upsert /Table/2{3-4} ttl_seconds=100 num_replicas=5 +upsert /Table/2{3-4} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/2{4-5} -upsert /Table/2{4-5} ttl_seconds=100 num_replicas=5 +upsert /Table/2{4-5} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/2{6-7} -upsert /Table/2{6-7} ttl_seconds=100 num_replicas=5 +upsert /Table/2{6-7} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/2{8-9} -upsert /Table/2{8-9} ttl_seconds=100 num_replicas=5 +upsert /Table/2{8-9} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /{Table/29-NamespaceTable/30} upsert /{Table/29-NamespaceTable/30} ttl_seconds=100 num_replicas=5 delete /NamespaceTable/{30-Max} -upsert /NamespaceTable/{30-Max} ttl_seconds=100 num_replicas=5 +upsert /NamespaceTable/{30-Max} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /{NamespaceTable/Max-Table/32} -upsert /{NamespaceTable/Max-Table/32} ttl_seconds=100 num_replicas=5 +upsert /{NamespaceTable/Max-Table/32} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/3{2-3} -upsert /Table/3{2-3} ttl_seconds=100 num_replicas=5 +upsert /Table/3{2-3} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/3{3-4} -upsert /Table/3{3-4} ttl_seconds=100 num_replicas=5 +upsert /Table/3{3-4} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/3{4-5} -upsert /Table/3{4-5} ttl_seconds=100 num_replicas=5 +upsert /Table/3{4-5} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/3{5-6} -upsert /Table/3{5-6} ttl_seconds=100 num_replicas=5 +upsert /Table/3{5-6} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/3{6-7} -upsert /Table/3{6-7} ttl_seconds=100 num_replicas=5 +upsert /Table/3{6-7} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/3{7-8} -upsert /Table/3{7-8} ttl_seconds=100 num_replicas=5 +upsert /Table/3{7-8} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/3{8-9} upsert /Table/3{8-9} ttl_seconds=100 num_replicas=5 delete /Table/{39-40} -upsert /Table/{39-40} ttl_seconds=100 num_replicas=5 +upsert /Table/{39-40} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/4{0-1} -upsert /Table/4{0-1} ttl_seconds=100 num_replicas=5 +upsert /Table/4{0-1} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/4{1-2} -upsert /Table/4{1-2} ttl_seconds=100 num_replicas=5 +upsert /Table/4{1-2} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/4{2-3} -upsert /Table/4{2-3} ttl_seconds=100 num_replicas=5 +upsert /Table/4{2-3} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/4{3-4} -upsert /Table/4{3-4} ttl_seconds=100 num_replicas=5 +upsert /Table/4{3-4} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/4{4-5} -upsert /Table/4{4-5} ttl_seconds=100 num_replicas=5 +upsert /Table/4{4-5} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/4{6-7} -upsert /Table/4{6-7} ttl_seconds=100 num_replicas=5 +upsert /Table/4{6-7} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true delete /Table/4{7-8} -upsert /Table/4{7-8} ttl_seconds=100 num_replicas=5 +upsert /Table/4{7-8} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true state offset=5 limit=42 ---- ... -/Table/{SystemConfigSpan/Start-4} ttl_seconds=100 num_replicas=5 -/Table/{4-5} ttl_seconds=100 num_replicas=5 -/Table/{5-6} ttl_seconds=100 num_replicas=5 -/Table/{6-7} ttl_seconds=100 num_replicas=5 -/Table/{8-9} ttl_seconds=100 num_replicas=5 -/Table/1{1-2} ttl_seconds=100 num_replicas=5 -/Table/1{2-3} ttl_seconds=100 num_replicas=5 -/Table/1{3-4} ttl_seconds=100 num_replicas=5 -/Table/1{4-5} ttl_seconds=100 num_replicas=5 -/Table/1{5-6} ttl_seconds=100 num_replicas=5 +/Table/{SystemConfigSpan/Start-4} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/{4-5} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/{5-6} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/{6-7} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/{8-9} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/1{1-2} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/1{2-3} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/1{3-4} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/1{4-5} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/1{5-6} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true /Table/1{6-7} ttl_seconds=100 num_replicas=5 /Table/1{7-8} ttl_seconds=100 num_replicas=5 /Table/1{8-9} ttl_seconds=100 num_replicas=5 -/Table/{19-20} ttl_seconds=100 num_replicas=5 -/Table/2{0-1} ttl_seconds=100 num_replicas=5 -/Table/2{1-2} ttl_seconds=100 num_replicas=5 +/Table/{19-20} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/2{0-1} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/2{1-2} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true /Table/2{2-3} ttl_seconds=100 num_replicas=5 -/Table/2{3-4} ttl_seconds=100 num_replicas=5 -/Table/2{4-5} ttl_seconds=100 num_replicas=5 -/Table/2{5-6} ttl_seconds=600 num_replicas=5 -/Table/2{6-7} ttl_seconds=100 num_replicas=5 -/Table/2{7-8} ttl_seconds=600 num_replicas=5 -/Table/2{8-9} ttl_seconds=100 num_replicas=5 +/Table/2{3-4} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/2{4-5} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/2{5-6} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/2{6-7} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/2{7-8} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/2{8-9} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true /{Table/29-NamespaceTable/30} ttl_seconds=100 num_replicas=5 -/NamespaceTable/{30-Max} ttl_seconds=100 num_replicas=5 -/{NamespaceTable/Max-Table/32} ttl_seconds=100 num_replicas=5 -/Table/3{2-3} ttl_seconds=100 num_replicas=5 -/Table/3{3-4} ttl_seconds=100 num_replicas=5 -/Table/3{4-5} ttl_seconds=100 num_replicas=5 -/Table/3{5-6} ttl_seconds=100 num_replicas=5 -/Table/3{6-7} ttl_seconds=100 num_replicas=5 -/Table/3{7-8} ttl_seconds=100 num_replicas=5 +/NamespaceTable/{30-Max} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/{NamespaceTable/Max-Table/32} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/3{2-3} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/3{3-4} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/3{4-5} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/3{5-6} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/3{6-7} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/3{7-8} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true /Table/3{8-9} ttl_seconds=100 num_replicas=5 -/Table/{39-40} ttl_seconds=100 num_replicas=5 -/Table/4{0-1} ttl_seconds=100 num_replicas=5 -/Table/4{1-2} ttl_seconds=100 num_replicas=5 -/Table/4{2-3} ttl_seconds=100 num_replicas=5 -/Table/4{3-4} ttl_seconds=100 num_replicas=5 -/Table/4{4-5} ttl_seconds=100 num_replicas=5 -/Table/4{5-6} ttl_seconds=7200 num_replicas=5 -/Table/4{6-7} ttl_seconds=100 num_replicas=5 -/Table/4{7-8} ttl_seconds=100 num_replicas=5 +/Table/{39-40} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/4{0-1} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/4{1-2} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/4{2-3} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/4{3-4} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/4{4-5} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/4{5-6} ttl_seconds=7200 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/4{6-7} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/4{7-8} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true ... diff --git a/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/indexes b/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/indexes index 513185592128..9d62739e1561 100644 --- a/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/indexes +++ b/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/indexes @@ -104,4 +104,4 @@ delete /Table/5{6/3-7} state offset=46 ---- ... -/Table/4{7-8} range system +/Table/4{7-8} database system (host) diff --git a/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/multitenant/basic b/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/multitenant/basic index 1c60fa191853..483c446caa33 100644 --- a/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/multitenant/basic +++ b/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/multitenant/basic @@ -32,78 +32,78 @@ reconcile tenant=10 mutations tenant=10 ---- delete /Tenant/10{-"\x00"} -upsert /Tenant/10{-/Table/4} range default -upsert /Tenant/10/Table/{4-5} range default -upsert /Tenant/10/Table/{5-6} range default -upsert /Tenant/10/Table/{6-7} range default -upsert /Tenant/10/Table/{7-8} range default -upsert /Tenant/10/Table/1{1-2} range default -upsert /Tenant/10/Table/1{2-3} range default -upsert /Tenant/10/Table/1{3-4} range default -upsert /Tenant/10/Table/1{4-5} range default -upsert /Tenant/10/Table/1{5-6} range default -upsert /Tenant/10/Table/{19-20} range default -upsert /Tenant/10/Table/2{0-1} range default -upsert /Tenant/10/Table/2{1-2} range default -upsert /Tenant/10/Table/2{3-4} range default -upsert /Tenant/10/Table/2{4-5} range default -upsert /Tenant/10/Table/2{5-6} range default -upsert /Tenant/10/Table/2{6-7} range default -upsert /Tenant/10/Table/2{7-8} range default -upsert /Tenant/10/Table/2{8-9} range default -upsert /Tenant/10/NamespaceTable/{30-Max} range default -upsert /Tenant/10/{NamespaceTable/Max-Table/32} range default -upsert /Tenant/10/Table/3{2-3} range default -upsert /Tenant/10/Table/3{3-4} range default -upsert /Tenant/10/Table/3{4-5} range default -upsert /Tenant/10/Table/3{5-6} range default -upsert /Tenant/10/Table/3{6-7} range default -upsert /Tenant/10/Table/3{7-8} range default -upsert /Tenant/10/Table/{39-40} range default -upsert /Tenant/10/Table/4{0-1} range default -upsert /Tenant/10/Table/4{1-2} range default -upsert /Tenant/10/Table/4{2-3} range default -upsert /Tenant/10/Table/4{3-4} range default -upsert /Tenant/10/Table/4{4-5} range default -upsert /Tenant/10/Table/4{6-7} range default +upsert /Tenant/10{-/Table/4} database system (tenant) +upsert /Tenant/10/Table/{4-5} database system (tenant) +upsert /Tenant/10/Table/{5-6} database system (tenant) +upsert /Tenant/10/Table/{6-7} database system (tenant) +upsert /Tenant/10/Table/{7-8} database system (tenant) +upsert /Tenant/10/Table/1{1-2} database system (tenant) +upsert /Tenant/10/Table/1{2-3} database system (tenant) +upsert /Tenant/10/Table/1{3-4} database system (tenant) +upsert /Tenant/10/Table/1{4-5} database system (tenant) +upsert /Tenant/10/Table/1{5-6} database system (tenant) +upsert /Tenant/10/Table/{19-20} database system (tenant) +upsert /Tenant/10/Table/2{0-1} database system (tenant) +upsert /Tenant/10/Table/2{1-2} database system (tenant) +upsert /Tenant/10/Table/2{3-4} database system (tenant) +upsert /Tenant/10/Table/2{4-5} database system (tenant) +upsert /Tenant/10/Table/2{5-6} database system (tenant) +upsert /Tenant/10/Table/2{6-7} database system (tenant) +upsert /Tenant/10/Table/2{7-8} database system (tenant) +upsert /Tenant/10/Table/2{8-9} database system (tenant) +upsert /Tenant/10/NamespaceTable/{30-Max} database system (tenant) +upsert /Tenant/10/{NamespaceTable/Max-Table/32} database system (tenant) +upsert /Tenant/10/Table/3{2-3} database system (tenant) +upsert /Tenant/10/Table/3{3-4} database system (tenant) +upsert /Tenant/10/Table/3{4-5} database system (tenant) +upsert /Tenant/10/Table/3{5-6} database system (tenant) +upsert /Tenant/10/Table/3{6-7} database system (tenant) +upsert /Tenant/10/Table/3{7-8} database system (tenant) +upsert /Tenant/10/Table/{39-40} database system (tenant) +upsert /Tenant/10/Table/4{0-1} database system (tenant) +upsert /Tenant/10/Table/4{1-2} database system (tenant) +upsert /Tenant/10/Table/4{2-3} database system (tenant) +upsert /Tenant/10/Table/4{3-4} database system (tenant) +upsert /Tenant/10/Table/4{4-5} database system (tenant) +upsert /Tenant/10/Table/4{6-7} database system (tenant) state offset=47 ---- ... -/Tenant/10{-/Table/4} range default -/Tenant/10/Table/{4-5} range default -/Tenant/10/Table/{5-6} range default -/Tenant/10/Table/{6-7} range default -/Tenant/10/Table/{7-8} range default -/Tenant/10/Table/1{1-2} range default -/Tenant/10/Table/1{2-3} range default -/Tenant/10/Table/1{3-4} range default -/Tenant/10/Table/1{4-5} range default -/Tenant/10/Table/1{5-6} range default -/Tenant/10/Table/{19-20} range default -/Tenant/10/Table/2{0-1} range default -/Tenant/10/Table/2{1-2} range default -/Tenant/10/Table/2{3-4} range default -/Tenant/10/Table/2{4-5} range default -/Tenant/10/Table/2{5-6} range default -/Tenant/10/Table/2{6-7} range default -/Tenant/10/Table/2{7-8} range default -/Tenant/10/Table/2{8-9} range default -/Tenant/10/NamespaceTable/{30-Max} range default -/Tenant/10/{NamespaceTable/Max-Table/32} range default -/Tenant/10/Table/3{2-3} range default -/Tenant/10/Table/3{3-4} range default -/Tenant/10/Table/3{4-5} range default -/Tenant/10/Table/3{5-6} range default -/Tenant/10/Table/3{6-7} range default -/Tenant/10/Table/3{7-8} range default -/Tenant/10/Table/{39-40} range default -/Tenant/10/Table/4{0-1} range default -/Tenant/10/Table/4{1-2} range default -/Tenant/10/Table/4{2-3} range default -/Tenant/10/Table/4{3-4} range default -/Tenant/10/Table/4{4-5} range default -/Tenant/10/Table/4{6-7} range default +/Tenant/10{-/Table/4} database system (tenant) +/Tenant/10/Table/{4-5} database system (tenant) +/Tenant/10/Table/{5-6} database system (tenant) +/Tenant/10/Table/{6-7} database system (tenant) +/Tenant/10/Table/{7-8} database system (tenant) +/Tenant/10/Table/1{1-2} database system (tenant) +/Tenant/10/Table/1{2-3} database system (tenant) +/Tenant/10/Table/1{3-4} database system (tenant) +/Tenant/10/Table/1{4-5} database system (tenant) +/Tenant/10/Table/1{5-6} database system (tenant) +/Tenant/10/Table/{19-20} database system (tenant) +/Tenant/10/Table/2{0-1} database system (tenant) +/Tenant/10/Table/2{1-2} database system (tenant) +/Tenant/10/Table/2{3-4} database system (tenant) +/Tenant/10/Table/2{4-5} database system (tenant) +/Tenant/10/Table/2{5-6} database system (tenant) +/Tenant/10/Table/2{6-7} database system (tenant) +/Tenant/10/Table/2{7-8} database system (tenant) +/Tenant/10/Table/2{8-9} database system (tenant) +/Tenant/10/NamespaceTable/{30-Max} database system (tenant) +/Tenant/10/{NamespaceTable/Max-Table/32} database system (tenant) +/Tenant/10/Table/3{2-3} database system (tenant) +/Tenant/10/Table/3{3-4} database system (tenant) +/Tenant/10/Table/3{4-5} database system (tenant) +/Tenant/10/Table/3{5-6} database system (tenant) +/Tenant/10/Table/3{6-7} database system (tenant) +/Tenant/10/Table/3{7-8} database system (tenant) +/Tenant/10/Table/{39-40} database system (tenant) +/Tenant/10/Table/4{0-1} database system (tenant) +/Tenant/10/Table/4{1-2} database system (tenant) +/Tenant/10/Table/4{2-3} database system (tenant) +/Tenant/10/Table/4{3-4} database system (tenant) +/Tenant/10/Table/4{4-5} database system (tenant) +/Tenant/10/Table/4{6-7} database system (tenant) /Tenant/11{-"\x00"} range default exec-sql tenant=10 diff --git a/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/named_zones b/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/named_zones index bec82de1514d..33e9ebbdb04a 100644 --- a/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/named_zones +++ b/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/named_zones @@ -123,7 +123,7 @@ state limit=5 state offset=46 ---- ... -/Table/4{7-8} range system +/Table/4{7-8} database system (host) /Table/5{6-7} ttl_seconds=50 # Make sure future descendants observe the same. @@ -138,7 +138,7 @@ upsert /Table/5{7-8} ttl_seconds=50 state offset=46 ---- ... -/Table/4{7-8} range system +/Table/4{7-8} database system (host) /Table/5{6-7} ttl_seconds=50 /Table/5{7-8} ttl_seconds=50 diff --git a/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/full_translate b/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/full_translate index 73eaf701863c..b3042d25855b 100644 --- a/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/full_translate +++ b/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/full_translate @@ -25,46 +25,46 @@ full-translate /System/{NodeLivenessMax-tsd} range system /System{/tsd-tse} range default /System{tse-/Max} range system -/Table/{SystemConfigSpan/Start-4} range system -/Table/{4-5} range system -/Table/{5-6} range system -/Table/{6-7} range system -/Table/{8-9} range system -/Table/1{1-2} range system -/Table/1{2-3} range system -/Table/1{3-4} range system -/Table/1{4-5} range system -/Table/1{5-6} range system +/Table/{SystemConfigSpan/Start-4} database system (host) +/Table/{4-5} database system (host) +/Table/{5-6} database system (host) +/Table/{6-7} database system (host) +/Table/{8-9} database system (host) +/Table/1{1-2} database system (host) +/Table/1{2-3} database system (host) +/Table/1{3-4} database system (host) +/Table/1{4-5} database system (host) +/Table/1{5-6} database system (host) /Table/1{6-7} range system /Table/1{7-8} range system /Table/1{8-9} range system -/Table/{19-20} range system -/Table/2{0-1} range system -/Table/2{1-2} range system +/Table/{19-20} database system (host) +/Table/2{0-1} database system (host) +/Table/2{1-2} database system (host) /Table/2{2-3} range system -/Table/2{3-4} range system -/Table/2{4-5} range system -/Table/2{5-6} ttl_seconds=600 num_replicas=5 -/Table/2{6-7} range system -/Table/2{7-8} ttl_seconds=600 num_replicas=5 -/Table/2{8-9} range system +/Table/2{3-4} database system (host) +/Table/2{4-5} database system (host) +/Table/2{5-6} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/2{6-7} database system (host) +/Table/2{7-8} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/2{8-9} database system (host) /{Table/29-NamespaceTable/30} range system -/NamespaceTable/{30-Max} range system -/{NamespaceTable/Max-Table/32} range system -/Table/3{2-3} range system -/Table/3{3-4} range system -/Table/3{4-5} range system -/Table/3{5-6} range system -/Table/3{6-7} range system -/Table/3{7-8} range system +/NamespaceTable/{30-Max} database system (host) +/{NamespaceTable/Max-Table/32} database system (host) +/Table/3{2-3} database system (host) +/Table/3{3-4} database system (host) +/Table/3{4-5} database system (host) +/Table/3{5-6} database system (host) +/Table/3{6-7} database system (host) +/Table/3{7-8} database system (host) /Table/3{8-9} range system -/Table/{39-40} range system -/Table/4{0-1} range system -/Table/4{1-2} range system -/Table/4{2-3} range system -/Table/4{3-4} range system -/Table/4{4-5} range system -/Table/4{5-6} ttl_seconds=7200 num_replicas=5 -/Table/4{6-7} range system -/Table/4{7-8} range system +/Table/{39-40} database system (host) +/Table/4{0-1} database system (host) +/Table/4{1-2} database system (host) +/Table/4{2-3} database system (host) +/Table/4{3-4} database system (host) +/Table/4{4-5} database system (host) +/Table/4{5-6} ttl_seconds=7200 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/4{6-7} database system (host) +/Table/4{7-8} database system (host) /Table/{59-60} range default diff --git a/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/full_translate_named_zones_deleted b/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/full_translate_named_zones_deleted index ff7fea1c70af..3973371f49fa 100644 --- a/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/full_translate_named_zones_deleted +++ b/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/full_translate_named_zones_deleted @@ -41,45 +41,45 @@ full-translate /System/{NodeLivenessMax-tsd} range default /System{/tsd-tse} range default /System{tse-/Max} range default -/Table/{SystemConfigSpan/Start-4} range system -/Table/{4-5} range system -/Table/{5-6} range system -/Table/{6-7} range system -/Table/{8-9} range system -/Table/1{1-2} range system -/Table/1{2-3} range system -/Table/1{3-4} range system -/Table/1{4-5} range system -/Table/1{5-6} range system +/Table/{SystemConfigSpan/Start-4} database system (host) +/Table/{4-5} database system (host) +/Table/{5-6} database system (host) +/Table/{6-7} database system (host) +/Table/{8-9} database system (host) +/Table/1{1-2} database system (host) +/Table/1{2-3} database system (host) +/Table/1{3-4} database system (host) +/Table/1{4-5} database system (host) +/Table/1{5-6} database system (host) /Table/1{6-7} range system /Table/1{7-8} range system /Table/1{8-9} range system -/Table/{19-20} range system -/Table/2{0-1} range system -/Table/2{1-2} range system +/Table/{19-20} database system (host) +/Table/2{0-1} database system (host) +/Table/2{1-2} database system (host) /Table/2{2-3} range system -/Table/2{3-4} range system -/Table/2{4-5} range system -/Table/2{5-6} ttl_seconds=600 num_replicas=5 -/Table/2{6-7} range system -/Table/2{7-8} ttl_seconds=600 num_replicas=5 -/Table/2{8-9} range system +/Table/2{3-4} database system (host) +/Table/2{4-5} database system (host) +/Table/2{5-6} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/2{6-7} database system (host) +/Table/2{7-8} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/2{8-9} database system (host) /{Table/29-NamespaceTable/30} range system -/NamespaceTable/{30-Max} range system -/{NamespaceTable/Max-Table/32} range system -/Table/3{2-3} range system -/Table/3{3-4} range system -/Table/3{4-5} range system -/Table/3{5-6} range system -/Table/3{6-7} range system -/Table/3{7-8} range system +/NamespaceTable/{30-Max} database system (host) +/{NamespaceTable/Max-Table/32} database system (host) +/Table/3{2-3} database system (host) +/Table/3{3-4} database system (host) +/Table/3{4-5} database system (host) +/Table/3{5-6} database system (host) +/Table/3{6-7} database system (host) +/Table/3{7-8} database system (host) /Table/3{8-9} range system -/Table/{39-40} range system -/Table/4{0-1} range system -/Table/4{1-2} range system -/Table/4{2-3} range system -/Table/4{3-4} range system -/Table/4{4-5} range system -/Table/4{5-6} ttl_seconds=7200 num_replicas=5 -/Table/4{6-7} range system -/Table/4{7-8} range system +/Table/{39-40} database system (host) +/Table/4{0-1} database system (host) +/Table/4{1-2} database system (host) +/Table/4{2-3} database system (host) +/Table/4{3-4} database system (host) +/Table/4{4-5} database system (host) +/Table/4{5-6} ttl_seconds=7200 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/4{6-7} database system (host) +/Table/4{7-8} database system (host) diff --git a/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/system_database b/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/system_database index 0522dd09cf23..7f89eba1cd17 100644 --- a/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/system_database +++ b/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/system_database @@ -1,50 +1,51 @@ # Translating the system database itself should surface entries for all system -# tables (including pseudo table IDs). +# tables (including pseudo table IDs). Pseudo table ID keyspans show up as +# "range system" since rangefeeds/ignore_strict_gc are unset. translate database=system ---- -/Table/{SystemConfigSpan/Start-4} range system -/Table/{4-5} range system -/Table/{5-6} range system -/Table/{6-7} range system -/Table/{8-9} range system -/Table/1{1-2} range system -/Table/1{2-3} range system -/Table/1{3-4} range system -/Table/1{4-5} range system -/Table/1{5-6} range system +/Table/{SystemConfigSpan/Start-4} database system (host) +/Table/{4-5} database system (host) +/Table/{5-6} database system (host) +/Table/{6-7} database system (host) +/Table/{8-9} database system (host) +/Table/1{1-2} database system (host) +/Table/1{2-3} database system (host) +/Table/1{3-4} database system (host) +/Table/1{4-5} database system (host) +/Table/1{5-6} database system (host) /Table/1{6-7} range system /Table/1{7-8} range system /Table/1{8-9} range system -/Table/{19-20} range system -/Table/2{0-1} range system -/Table/2{1-2} range system +/Table/{19-20} database system (host) +/Table/2{0-1} database system (host) +/Table/2{1-2} database system (host) /Table/2{2-3} range system -/Table/2{3-4} range system -/Table/2{4-5} range system -/Table/2{5-6} ttl_seconds=600 num_replicas=5 -/Table/2{6-7} range system -/Table/2{7-8} ttl_seconds=600 num_replicas=5 -/Table/2{8-9} range system +/Table/2{3-4} database system (host) +/Table/2{4-5} database system (host) +/Table/2{5-6} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/2{6-7} database system (host) +/Table/2{7-8} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/2{8-9} database system (host) /{Table/29-NamespaceTable/30} range system -/NamespaceTable/{30-Max} range system -/{NamespaceTable/Max-Table/32} range system -/Table/3{2-3} range system -/Table/3{3-4} range system -/Table/3{4-5} range system -/Table/3{5-6} range system -/Table/3{6-7} range system -/Table/3{7-8} range system +/NamespaceTable/{30-Max} database system (host) +/{NamespaceTable/Max-Table/32} database system (host) +/Table/3{2-3} database system (host) +/Table/3{3-4} database system (host) +/Table/3{4-5} database system (host) +/Table/3{5-6} database system (host) +/Table/3{6-7} database system (host) +/Table/3{7-8} database system (host) /Table/3{8-9} range system -/Table/{39-40} range system -/Table/4{0-1} range system -/Table/4{1-2} range system -/Table/4{2-3} range system -/Table/4{3-4} range system -/Table/4{4-5} range system -/Table/4{5-6} ttl_seconds=7200 num_replicas=5 -/Table/4{6-7} range system -/Table/4{7-8} range system +/Table/{39-40} database system (host) +/Table/4{0-1} database system (host) +/Table/4{1-2} database system (host) +/Table/4{2-3} database system (host) +/Table/4{3-4} database system (host) +/Table/4{4-5} database system (host) +/Table/4{5-6} ttl_seconds=7200 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true +/Table/4{6-7} database system (host) +/Table/4{7-8} database system (host) # Alter zone config fields on the database to ensure the effects cascade. exec-sql @@ -53,48 +54,48 @@ ALTER DATABASE system CONFIGURE ZONE USING num_replicas = 7 translate database=system ---- -/Table/{SystemConfigSpan/Start-4} num_replicas=7 -/Table/{4-5} num_replicas=7 -/Table/{5-6} num_replicas=7 -/Table/{6-7} num_replicas=7 -/Table/{8-9} num_replicas=7 -/Table/1{1-2} num_replicas=7 -/Table/1{2-3} num_replicas=7 -/Table/1{3-4} num_replicas=7 -/Table/1{4-5} num_replicas=7 -/Table/1{5-6} num_replicas=7 +/Table/{SystemConfigSpan/Start-4} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/{4-5} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/{5-6} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/{6-7} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/{8-9} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/1{1-2} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/1{2-3} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/1{3-4} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/1{4-5} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/1{5-6} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true /Table/1{6-7} num_replicas=7 /Table/1{7-8} num_replicas=7 /Table/1{8-9} num_replicas=7 -/Table/{19-20} num_replicas=7 -/Table/2{0-1} num_replicas=7 -/Table/2{1-2} num_replicas=7 +/Table/{19-20} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{0-1} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{1-2} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true /Table/2{2-3} num_replicas=7 -/Table/2{3-4} num_replicas=7 -/Table/2{4-5} num_replicas=7 -/Table/2{5-6} ttl_seconds=600 num_replicas=7 -/Table/2{6-7} num_replicas=7 -/Table/2{7-8} ttl_seconds=600 num_replicas=7 -/Table/2{8-9} num_replicas=7 +/Table/2{3-4} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{4-5} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{5-6} ttl_seconds=600 ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{6-7} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{7-8} ttl_seconds=600 ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{8-9} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true /{Table/29-NamespaceTable/30} num_replicas=7 -/NamespaceTable/{30-Max} num_replicas=7 -/{NamespaceTable/Max-Table/32} num_replicas=7 -/Table/3{2-3} num_replicas=7 -/Table/3{3-4} num_replicas=7 -/Table/3{4-5} num_replicas=7 -/Table/3{5-6} num_replicas=7 -/Table/3{6-7} num_replicas=7 -/Table/3{7-8} num_replicas=7 +/NamespaceTable/{30-Max} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/{NamespaceTable/Max-Table/32} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/3{2-3} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/3{3-4} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/3{4-5} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/3{5-6} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/3{6-7} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/3{7-8} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true /Table/3{8-9} num_replicas=7 -/Table/{39-40} num_replicas=7 -/Table/4{0-1} num_replicas=7 -/Table/4{1-2} num_replicas=7 -/Table/4{2-3} num_replicas=7 -/Table/4{3-4} num_replicas=7 -/Table/4{4-5} num_replicas=7 -/Table/4{5-6} ttl_seconds=7200 num_replicas=7 -/Table/4{6-7} num_replicas=7 -/Table/4{7-8} num_replicas=7 +/Table/{39-40} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{0-1} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{1-2} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{2-3} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{3-4} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{4-5} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{5-6} ttl_seconds=7200 ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{6-7} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{7-8} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true # Alter a named range that maps to a pseudo table ID, ensuring that its effects # are independent. @@ -109,45 +110,45 @@ full-translate /System/{NodeLivenessMax-tsd} range system /System{/tsd-tse} range default /System{tse-/Max} range system -/Table/{SystemConfigSpan/Start-4} num_replicas=7 -/Table/{4-5} num_replicas=7 -/Table/{5-6} num_replicas=7 -/Table/{6-7} num_replicas=7 -/Table/{8-9} num_replicas=7 -/Table/1{1-2} num_replicas=7 -/Table/1{2-3} num_replicas=7 -/Table/1{3-4} num_replicas=7 -/Table/1{4-5} num_replicas=7 -/Table/1{5-6} num_replicas=7 +/Table/{SystemConfigSpan/Start-4} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/{4-5} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/{5-6} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/{6-7} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/{8-9} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/1{1-2} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/1{2-3} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/1{3-4} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/1{4-5} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/1{5-6} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true /Table/1{6-7} num_replicas=7 /Table/1{7-8} num_replicas=7 /Table/1{8-9} num_replicas=7 -/Table/{19-20} num_replicas=7 -/Table/2{0-1} num_replicas=7 -/Table/2{1-2} num_replicas=7 +/Table/{19-20} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{0-1} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{1-2} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true /Table/2{2-3} num_replicas=7 -/Table/2{3-4} num_replicas=7 -/Table/2{4-5} num_replicas=7 -/Table/2{5-6} ttl_seconds=600 num_replicas=7 -/Table/2{6-7} num_replicas=7 -/Table/2{7-8} ttl_seconds=600 num_replicas=7 -/Table/2{8-9} num_replicas=7 +/Table/2{3-4} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{4-5} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{5-6} ttl_seconds=600 ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{6-7} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{7-8} ttl_seconds=600 ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/2{8-9} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true /{Table/29-NamespaceTable/30} num_replicas=7 -/NamespaceTable/{30-Max} num_replicas=7 -/{NamespaceTable/Max-Table/32} num_replicas=7 -/Table/3{2-3} num_replicas=7 -/Table/3{3-4} num_replicas=7 -/Table/3{4-5} num_replicas=7 -/Table/3{5-6} num_replicas=7 -/Table/3{6-7} num_replicas=7 -/Table/3{7-8} num_replicas=7 +/NamespaceTable/{30-Max} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/{NamespaceTable/Max-Table/32} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/3{2-3} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/3{3-4} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/3{4-5} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/3{5-6} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/3{6-7} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/3{7-8} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true /Table/3{8-9} num_replicas=7 -/Table/{39-40} num_replicas=7 -/Table/4{0-1} num_replicas=7 -/Table/4{1-2} num_replicas=7 -/Table/4{2-3} num_replicas=7 -/Table/4{3-4} num_replicas=7 -/Table/4{4-5} num_replicas=7 -/Table/4{5-6} ttl_seconds=7200 num_replicas=7 -/Table/4{6-7} num_replicas=7 -/Table/4{7-8} num_replicas=7 +/Table/{39-40} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{0-1} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{1-2} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{2-3} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{3-4} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{4-5} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{5-6} ttl_seconds=7200 ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{6-7} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true +/Table/4{7-8} ignore_strict_gc=true num_replicas=7 rangefeed_enabled=true diff --git a/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/tenant/full_translate b/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/tenant/full_translate index 7a9f11d2bb69..4ed55d1f5b00 100644 --- a/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/tenant/full_translate +++ b/pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/testdata/tenant/full_translate @@ -14,77 +14,77 @@ CREATE TABLE db.t(); # - The user created table full-translate ---- -/Tenant/10{-/Table/4} range default -/Tenant/10/Table/{4-5} range default -/Tenant/10/Table/{5-6} range default -/Tenant/10/Table/{6-7} range default -/Tenant/10/Table/{7-8} range default -/Tenant/10/Table/1{1-2} range default -/Tenant/10/Table/1{2-3} range default -/Tenant/10/Table/1{3-4} range default -/Tenant/10/Table/1{4-5} range default -/Tenant/10/Table/1{5-6} range default -/Tenant/10/Table/{19-20} range default -/Tenant/10/Table/2{0-1} range default -/Tenant/10/Table/2{1-2} range default -/Tenant/10/Table/2{3-4} range default -/Tenant/10/Table/2{4-5} range default -/Tenant/10/Table/2{5-6} range default -/Tenant/10/Table/2{6-7} range default -/Tenant/10/Table/2{7-8} range default -/Tenant/10/Table/2{8-9} range default -/Tenant/10/NamespaceTable/{30-Max} range default -/Tenant/10/{NamespaceTable/Max-Table/32} range default -/Tenant/10/Table/3{2-3} range default -/Tenant/10/Table/3{3-4} range default -/Tenant/10/Table/3{4-5} range default -/Tenant/10/Table/3{5-6} range default -/Tenant/10/Table/3{6-7} range default -/Tenant/10/Table/3{7-8} range default -/Tenant/10/Table/{39-40} range default -/Tenant/10/Table/4{0-1} range default -/Tenant/10/Table/4{1-2} range default -/Tenant/10/Table/4{2-3} range default -/Tenant/10/Table/4{3-4} range default -/Tenant/10/Table/4{4-5} range default -/Tenant/10/Table/4{6-7} range default +/Tenant/10{-/Table/4} database system (tenant) +/Tenant/10/Table/{4-5} database system (tenant) +/Tenant/10/Table/{5-6} database system (tenant) +/Tenant/10/Table/{6-7} database system (tenant) +/Tenant/10/Table/{7-8} database system (tenant) +/Tenant/10/Table/1{1-2} database system (tenant) +/Tenant/10/Table/1{2-3} database system (tenant) +/Tenant/10/Table/1{3-4} database system (tenant) +/Tenant/10/Table/1{4-5} database system (tenant) +/Tenant/10/Table/1{5-6} database system (tenant) +/Tenant/10/Table/{19-20} database system (tenant) +/Tenant/10/Table/2{0-1} database system (tenant) +/Tenant/10/Table/2{1-2} database system (tenant) +/Tenant/10/Table/2{3-4} database system (tenant) +/Tenant/10/Table/2{4-5} database system (tenant) +/Tenant/10/Table/2{5-6} database system (tenant) +/Tenant/10/Table/2{6-7} database system (tenant) +/Tenant/10/Table/2{7-8} database system (tenant) +/Tenant/10/Table/2{8-9} database system (tenant) +/Tenant/10/NamespaceTable/{30-Max} database system (tenant) +/Tenant/10/{NamespaceTable/Max-Table/32} database system (tenant) +/Tenant/10/Table/3{2-3} database system (tenant) +/Tenant/10/Table/3{3-4} database system (tenant) +/Tenant/10/Table/3{4-5} database system (tenant) +/Tenant/10/Table/3{5-6} database system (tenant) +/Tenant/10/Table/3{6-7} database system (tenant) +/Tenant/10/Table/3{7-8} database system (tenant) +/Tenant/10/Table/{39-40} database system (tenant) +/Tenant/10/Table/4{0-1} database system (tenant) +/Tenant/10/Table/4{1-2} database system (tenant) +/Tenant/10/Table/4{2-3} database system (tenant) +/Tenant/10/Table/4{3-4} database system (tenant) +/Tenant/10/Table/4{4-5} database system (tenant) +/Tenant/10/Table/4{6-7} database system (tenant) /Tenant/10/Table/{59-60} range default # We should expect the same for RANGE DEFAULT. translate named-zone=default ---- -/Tenant/10{-/Table/4} range default -/Tenant/10/Table/{4-5} range default -/Tenant/10/Table/{5-6} range default -/Tenant/10/Table/{6-7} range default -/Tenant/10/Table/{7-8} range default -/Tenant/10/Table/1{1-2} range default -/Tenant/10/Table/1{2-3} range default -/Tenant/10/Table/1{3-4} range default -/Tenant/10/Table/1{4-5} range default -/Tenant/10/Table/1{5-6} range default -/Tenant/10/Table/{19-20} range default -/Tenant/10/Table/2{0-1} range default -/Tenant/10/Table/2{1-2} range default -/Tenant/10/Table/2{3-4} range default -/Tenant/10/Table/2{4-5} range default -/Tenant/10/Table/2{5-6} range default -/Tenant/10/Table/2{6-7} range default -/Tenant/10/Table/2{7-8} range default -/Tenant/10/Table/2{8-9} range default -/Tenant/10/NamespaceTable/{30-Max} range default -/Tenant/10/{NamespaceTable/Max-Table/32} range default -/Tenant/10/Table/3{2-3} range default -/Tenant/10/Table/3{3-4} range default -/Tenant/10/Table/3{4-5} range default -/Tenant/10/Table/3{5-6} range default -/Tenant/10/Table/3{6-7} range default -/Tenant/10/Table/3{7-8} range default -/Tenant/10/Table/{39-40} range default -/Tenant/10/Table/4{0-1} range default -/Tenant/10/Table/4{1-2} range default -/Tenant/10/Table/4{2-3} range default -/Tenant/10/Table/4{3-4} range default -/Tenant/10/Table/4{4-5} range default -/Tenant/10/Table/4{6-7} range default +/Tenant/10{-/Table/4} database system (tenant) +/Tenant/10/Table/{4-5} database system (tenant) +/Tenant/10/Table/{5-6} database system (tenant) +/Tenant/10/Table/{6-7} database system (tenant) +/Tenant/10/Table/{7-8} database system (tenant) +/Tenant/10/Table/1{1-2} database system (tenant) +/Tenant/10/Table/1{2-3} database system (tenant) +/Tenant/10/Table/1{3-4} database system (tenant) +/Tenant/10/Table/1{4-5} database system (tenant) +/Tenant/10/Table/1{5-6} database system (tenant) +/Tenant/10/Table/{19-20} database system (tenant) +/Tenant/10/Table/2{0-1} database system (tenant) +/Tenant/10/Table/2{1-2} database system (tenant) +/Tenant/10/Table/2{3-4} database system (tenant) +/Tenant/10/Table/2{4-5} database system (tenant) +/Tenant/10/Table/2{5-6} database system (tenant) +/Tenant/10/Table/2{6-7} database system (tenant) +/Tenant/10/Table/2{7-8} database system (tenant) +/Tenant/10/Table/2{8-9} database system (tenant) +/Tenant/10/NamespaceTable/{30-Max} database system (tenant) +/Tenant/10/{NamespaceTable/Max-Table/32} database system (tenant) +/Tenant/10/Table/3{2-3} database system (tenant) +/Tenant/10/Table/3{3-4} database system (tenant) +/Tenant/10/Table/3{4-5} database system (tenant) +/Tenant/10/Table/3{5-6} database system (tenant) +/Tenant/10/Table/3{6-7} database system (tenant) +/Tenant/10/Table/3{7-8} database system (tenant) +/Tenant/10/Table/{39-40} database system (tenant) +/Tenant/10/Table/4{0-1} database system (tenant) +/Tenant/10/Table/4{1-2} database system (tenant) +/Tenant/10/Table/4{2-3} database system (tenant) +/Tenant/10/Table/4{3-4} database system (tenant) +/Tenant/10/Table/4{4-5} database system (tenant) +/Tenant/10/Table/4{6-7} database system (tenant) /Tenant/10/Table/{59-60} range default diff --git a/pkg/kv/kvserver/replica.go b/pkg/kv/kvserver/replica.go index 141a838aff6c..1b76958d5e24 100644 --- a/pkg/kv/kvserver/replica.go +++ b/pkg/kv/kvserver/replica.go @@ -415,8 +415,14 @@ type Replica struct { // lease extension that were in flight at the time of the transfer cannot be // used, if they eventually apply. minLeaseProposedTS hlc.ClockTimestamp + // The span config for this replica. conf roachpb.SpanConfig + // spanConfigExplicitlySet tracks whether a span config was explicitly set + // on this replica (as opposed to it having initialized with the default + // span config). + spanConfigExplicitlySet bool + // proposalBuf buffers Raft commands as they are passed to the Raft // replication subsystem. The buffer is populated by requests after // evaluation and is consumed by the Raft processing thread. Once @@ -593,11 +599,6 @@ type Replica struct { // size drops below its current conf.MaxRangeBytes or if the // conf.MaxRangeBytes increases to surpass the current value. largestPreviousMaxRangeSizeBytes int64 - // spanConfigExplicitlySet tracks whether a span config was explicitly set - // on this replica (as opposed to it having initialized with the default - // span config). It's used to reason about - // largestPreviousMaxRangeSizeBytes. - spanConfigExplicitlySet bool // failureToGossipSystemConfig is set to true when the leaseholder of the // range containing the system config span fails to gossip due to an @@ -959,13 +960,14 @@ func (r *Replica) GetRangeInfo(ctx context.Context) roachpb.RangeInfo { // should be used to determine the validity of commands. The returned timestamp // may be newer than the replica's true GC threshold if strict enforcement // is enabled and the TTL has passed. If this is an admin command or this range -// contains data outside of the user keyspace, we return the true GC threshold. +// opts out of strict GC enforcement (typically data outside the user keyspace), +// we return the true GC threshold. func (r *Replica) getImpliedGCThresholdRLocked( st kvserverpb.LeaseStatus, isAdmin bool, ) hlc.Timestamp { // The GC threshold is the oldest value we can return here. if isAdmin || !StrictGCEnforcement.Get(&r.store.ClusterSettings().SV) || - r.isSystemRangeRLocked() { + r.shouldIgnoreStrictGCEnforcementRLocked() { return *r.mu.state.GCThreshold } @@ -993,17 +995,22 @@ func (r *Replica) getImpliedGCThresholdRLocked( return threshold } -// isSystemRange returns true if r's key range precedes the start of user -// structured data (SQL keys) for the range's tenant keyspace. -func (r *Replica) isSystemRange() bool { +func (r *Replica) isRangefeedEnabled() (ret bool) { r.mu.RLock() defer r.mu.RUnlock() - return r.isSystemRangeRLocked() + + if !r.mu.spanConfigExplicitlySet { + return true + } + return r.mu.conf.RangefeedEnabled } -func (r *Replica) isSystemRangeRLocked() bool { - rem, _, err := keys.DecodeTenantPrefix(r.mu.state.Desc.StartKey.AsRawKey()) - return err == nil && roachpb.Key(rem).Compare(r.store.systemRangeStartUpperBound) < 0 +func (r *Replica) shouldIgnoreStrictGCEnforcementRLocked() (ret bool) { + if !r.mu.spanConfigExplicitlySet { + return true + } + + return r.mu.conf.GCPolicy.IgnoreStrictEnforcement } // maxReplicaIDOfAny returns the maximum ReplicaID of any replica, including diff --git a/pkg/kv/kvserver/replica_rangefeed.go b/pkg/kv/kvserver/replica_rangefeed.go index 61f3b1cb5310..6a345f1adfe1 100644 --- a/pkg/kv/kvserver/replica_rangefeed.go +++ b/pkg/kv/kvserver/replica_rangefeed.go @@ -39,6 +39,9 @@ import ( ) // RangefeedEnabled is a cluster setting that enables rangefeed requests. +// Certain ranges have span configs that specifically enable rangefeeds (system +// ranges and ranges covering tables in the system database); this setting +// covers everything else. var RangefeedEnabled = settings.RegisterBoolSetting( settings.TenantWritable, "kv.rangefeed.enabled", @@ -150,7 +153,7 @@ func (r *Replica) rangeFeedWithRangeID( args *roachpb.RangeFeedRequest, stream roachpb.Internal_RangeFeedServer, ) *roachpb.Error { - if !r.isSystemRange() && !RangefeedEnabled.Get(&r.store.cfg.Settings.SV) { + if !r.isRangefeedEnabled() && !RangefeedEnabled.Get(&r.store.cfg.Settings.SV) { return roachpb.NewErrorf("rangefeeds require the kv.rangefeed.enabled setting. See %s", docs.URL(`change-data-capture.html#enable-rangefeeds-to-reduce-latency`)) } diff --git a/pkg/kv/kvserver/replica_write.go b/pkg/kv/kvserver/replica_write.go index 723a3c7eca68..2e4667e60fd0 100644 --- a/pkg/kv/kvserver/replica_write.go +++ b/pkg/kv/kvserver/replica_write.go @@ -728,7 +728,7 @@ func (r *Replica) newBatchedEngine( panic("expected consistent iterators") } var opLogger *storage.OpLoggerBatch - if r.isSystemRange() || RangefeedEnabled.Get(&r.store.cfg.Settings.SV) { + if r.isRangefeedEnabled() || RangefeedEnabled.Get(&r.store.cfg.Settings.SV) { // TODO(nvanbenschoten): once we get rid of the RangefeedEnabled // cluster setting we'll need a way to turn this on when any // replica (not just the leaseholder) wants it and off when no diff --git a/pkg/kv/kvserver/store.go b/pkg/kv/kvserver/store.go index f5c08fd46459..b7be7a855dd5 100644 --- a/pkg/kv/kvserver/store.go +++ b/pkg/kv/kvserver/store.go @@ -726,11 +726,6 @@ type Store struct { protectedtsCache protectedts.Cache ctSender *sidetransport.Sender - // systemRangeStartUpperBound is a precomputed value used by a replica to - // determine if its key range overlaps the system range. - // TODO(postamar): stop special-casing the system range - systemRangeStartUpperBound roachpb.Key - // gossipRangeCountdown and leaseRangeCountdown are countdowns of // changes to range and leaseholder counts, after which the store // descriptor will be re-gossiped earlier than the normal periodic @@ -1146,9 +1141,6 @@ func NewStore( nodeDesc: nodeDesc, metrics: newStoreMetrics(cfg.HistogramWindowInterval), ctSender: cfg.ClosedTimestampSender, - systemRangeStartUpperBound: keys.SystemSQLCodec.TablePrefix( - keys.MinUserDescriptorID(keys.DeprecatedSystemIDChecker()), - ), } if cfg.RPCContext != nil { s.allocator = MakeAllocator( @@ -2315,7 +2307,13 @@ func (s *Store) systemGossipUpdate(sysCfg *config.SystemConfig) { } conf = s.cfg.DefaultSpanConfig } - repl.SetSpanConfig(conf) + + if s.cfg.SpanConfigsDisabled || + !spanconfigstore.EnabledSetting.Get(&s.ClusterSettings().SV) || + !s.cfg.Settings.Version.IsActive(ctx, clusterversion.EnableSpanConfigStore) { + repl.SetSpanConfig(conf) + } + if shouldQueue { s.splitQueue.Async(ctx, "gossip update", true /* wait */, func(ctx context.Context, h queueHelper) { h.MaybeAdd(ctx, repl, now) diff --git a/pkg/roachpb/span_config.go b/pkg/roachpb/span_config.go index 38cc852c919d..89c9665b90be 100644 --- a/pkg/roachpb/span_config.go +++ b/pkg/roachpb/span_config.go @@ -111,14 +111,6 @@ func TestingDefaultSpanConfig() SpanConfig { return SpanConfig{ RangeMinBytes: 128 << 20, // 128 MB RangeMaxBytes: 512 << 20, // 512 MB - // Use 25 hours instead of the previous 24 to make users successful by - // default. Users desiring to take incremental backups every 24h may - // incorrectly assume that the previous default 24h was sufficient to do - // that. But the equation for incremental backups is: - // GC TTLSeconds >= (desired backup interval) + (time to perform incremental backup) - // We think most new users' incremental backups will complete within an - // hour, and larger clusters will have more experienced operators and will - // understand how to change these settings if needed. GCPolicy: GCPolicy{ TTLSeconds: 25 * 60 * 60, }, @@ -128,20 +120,20 @@ func TestingDefaultSpanConfig() SpanConfig { // TestingSystemSpanConfig exports the system span config for testing purposes. func TestingSystemSpanConfig() SpanConfig { - return SpanConfig{ - RangeMinBytes: 128 << 20, // 128 MB - RangeMaxBytes: 512 << 20, // 512 MB - // Use 25 hours instead of the previous 24 to make users successful by - // default. Users desiring to take incremental backups every 24h may - // incorrectly assume that the previous default 24h was sufficient to do - // that. But the equation for incremental backups is: - // GC TTLSeconds >= (desired backup interval) + (time to perform incremental backup) - // We think most new users' incremental backups will complete within an - // hour, and larger clusters will have more experienced operators and will - // understand how to change these settings if needed. - GCPolicy: GCPolicy{ - TTLSeconds: 25 * 60 * 60, - }, - NumReplicas: 5, + config := TestingDefaultSpanConfig() + config.NumReplicas = 5 + return config +} + +// TestingDatabaseSystemSpanConfig exports the span config expected to be +// installed on system database for testing purposes. The provided bool switches +// between what's expected on the host vs. any secondary tenant. +func TestingDatabaseSystemSpanConfig(host bool) SpanConfig { + config := TestingSystemSpanConfig() + if !host { + config = TestingDefaultSpanConfig() } + config.RangefeedEnabled = true + config.GCPolicy.IgnoreStrictEnforcement = true + return config } diff --git a/pkg/roachpb/span_config.proto b/pkg/roachpb/span_config.proto index 762a01887fae..0e2ddd275461 100644 --- a/pkg/roachpb/span_config.proto +++ b/pkg/roachpb/span_config.proto @@ -19,7 +19,6 @@ import "gogoproto/gogo.proto"; // use these messages instead of duplicating everything. // GCPolicy dictates the garbage collection policy to apply over a given span. -// It parallels the definition found in zonepb/zone.proto. message GCPolicy { option (gogoproto.equal) = true; option (gogoproto.populate) = true; @@ -28,6 +27,11 @@ message GCPolicy { // before garbage collection. A value <= 0 means older versions are never // GC-ed. int32 ttl_seconds = 1 [(gogoproto.customname) = "TTLSeconds"]; + + // IgnoreStrictEnforcement is used to selectively opt out of strict GC TTL + // enforcement (where requests served at timestamps below the TTL are made to + // fail, even if the data exists). + bool ignore_strict_enforcement = 2; } // Constraint constrains the stores that a replica can be stored on. It @@ -140,6 +144,10 @@ message SpanConfig { // preferred option to least. The first preference that an existing replica of // a range matches will take priority for the lease. repeated LeasePreference lease_preferences = 9 [(gogoproto.nullable) = false]; + + // RangefeedEnabled determines whether rangefeeds are enabled over the + // specific range. + bool rangefeed_enabled = 10; } // SpanConfigEntry ties a span to its corresponding config. diff --git a/pkg/server/server.go b/pkg/server/server.go index ee22ed01fb62..dbec63be465c 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -649,6 +649,24 @@ func NewServer(cfg Config, stopper *stop.Stopper) (*Server, error) { if spanConfigKnobs != nil && spanConfigKnobs.StoreKVSubscriberOverride != nil { storeCfg.SpanConfigSubscriber = spanConfigKnobs.StoreKVSubscriberOverride } else { + // We use the span configs infra to control whether rangefeeds are + // enabled on a given range. At the moment this only applies to + // system tables (on both host and secondary tenants). We need to + // consider two things: + // - The sql-side reconciliation process runs asynchronously. When + // the config for a given range is requested, we might not yet have + // it, thus falling back to the static config below. + // - Various internal subsystems rely on rangefeeds to function. + // + // Consequently, we configure our static fallback config to actually + // allow rangefeeds. As the sql-side reconciliation process kicks + // off, it'll install the actual configs that we'll later consult. + // For system table ranges we install configs that allow for + // rangefeed. Until then, we simply allow rangefeeds when a more + // targeted config is not found. + fallbackConf := storeCfg.DefaultSpanConfig + fallbackConf.RangefeedEnabled = true + spanConfig.subscriber = spanconfigkvsubscriber.New( stopper, db, @@ -656,7 +674,7 @@ func NewServer(cfg Config, stopper *stop.Stopper) (*Server, error) { rangeFeedFactory, keys.SpanConfigurationsTableID, 1<<20, /* 1 MB */ - storeCfg.DefaultSpanConfig, + fallbackConf, spanConfigKnobs, ) storeCfg.SpanConfigSubscriber = spanConfig.subscriber diff --git a/pkg/spanconfig/spanconfigsqltranslator/sqltranslator.go b/pkg/spanconfig/spanconfigsqltranslator/sqltranslator.go index f53b38ad7bac..0a95423896ef 100644 --- a/pkg/spanconfig/spanconfigsqltranslator/sqltranslator.go +++ b/pkg/spanconfig/spanconfigsqltranslator/sqltranslator.go @@ -203,7 +203,6 @@ func (s *SQLTranslator) generateSpanConfigurationsForNamedZone( return nil, err } spanConfig := zoneConfig.AsSpanConfig() - var entries []roachpb.SpanConfigEntry for _, span := range spans { entries = append(entries, roachpb.SpanConfigEntry{ @@ -230,9 +229,18 @@ func (s *SQLTranslator) generateSpanConfigurationsForTable( return nil, err } + isSystemID := s.execCfg.SystemIDChecker.IsSystemID(uint32(desc.GetID())) tableStartKey := s.codec.TablePrefix(uint32(desc.GetID())) tableEndKey := tableStartKey.PrefixEnd() tableSpanConfig := zone.AsSpanConfig() + if isSystemID { + // We enable rangefeeds for system tables; various internal subsystems + // (leveraging system tables) rely on rangefeeds to function. + tableSpanConfig.RangefeedEnabled = true + // We exclude system tables from strict GC enforcement, it's only really + // applicable to user tables. + tableSpanConfig.GCPolicy.IgnoreStrictEnforcement = true + } entries := make([]roachpb.SpanConfigEntry, 0) if desc.GetID() == keys.DescriptorTableID { @@ -335,6 +343,10 @@ func (s *SQLTranslator) generateSpanConfigurationsForTable( // Add an entry for the subzone. subzoneSpanConfig := zone.Subzones[zone.SubzoneSpans[i].SubzoneIndex].Config.AsSpanConfig() + if isSystemID { + subzoneSpanConfig.RangefeedEnabled = true + subzoneSpanConfig.GCPolicy.IgnoreStrictEnforcement = true + } entries = append(entries, roachpb.SpanConfigEntry{ Span: roachpb.Span{Key: span.Key, EndKey: span.EndKey}, @@ -511,16 +523,15 @@ func (s *SQLTranslator) maybeGeneratePseudoTableEntries( // emulate. As for what config to apply over said range -- we do as // the system config span does, applying the config for the system // database. + zone, err := sql.GetHydratedZoneConfigForDatabase(ctx, txn, s.codec, keys.SystemDatabaseID) + if err != nil { + return nil, err + } + tableSpanConfig := zone.AsSpanConfig() var entries []roachpb.SpanConfigEntry for _, pseudoTableID := range keys.PseudoTableIDs { - zone, err := sql.GetHydratedZoneConfigForDatabase(ctx, txn, s.codec, keys.SystemDatabaseID) - if err != nil { - return nil, err - } - tableStartKey := s.codec.TablePrefix(pseudoTableID) tableEndKey := tableStartKey.PrefixEnd() - tableSpanConfig := zone.AsSpanConfig() entries = append(entries, roachpb.SpanConfigEntry{ Span: roachpb.Span{ Key: tableStartKey, diff --git a/pkg/spanconfig/spanconfigtestutils/utils.go b/pkg/spanconfig/spanconfigtestutils/utils.go index 4afe6d7c5a2a..e5a60e1e06f7 100644 --- a/pkg/spanconfig/spanconfigtestutils/utils.go +++ b/pkg/spanconfig/spanconfigtestutils/utils.go @@ -197,8 +197,10 @@ func PrintSpanConfigEntry(entry roachpb.SpanConfigEntry) string { } // PrintSpanConfigDiffedAgainstDefaults is a helper function that diffs the given -// config against RANGE {DEFAULT, SYSTEM} and returns a string for the -// mismatched fields. If there are none, "range {default,system}" is returned. +// config against RANGE {DEFAULT, SYSTEM} and the config for the system database +// (as expected on both kinds of tenants), and returns a string for the +// mismatched fields. If it matches one of the standard templates, "range +// {default,system}" or "database system ({host,tenant})" is returned. func PrintSpanConfigDiffedAgainstDefaults(conf roachpb.SpanConfig) string { if conf.Equal(roachpb.TestingDefaultSpanConfig()) { return "range default" @@ -206,6 +208,12 @@ func PrintSpanConfigDiffedAgainstDefaults(conf roachpb.SpanConfig) string { if conf.Equal(roachpb.TestingSystemSpanConfig()) { return "range system" } + if conf.Equal(roachpb.TestingDatabaseSystemSpanConfig(true /* host */)) { + return "database system (host)" + } + if conf.Equal(roachpb.TestingDatabaseSystemSpanConfig(false /* host */)) { + return "database system (tenant)" + } defaultConf := roachpb.TestingDefaultSpanConfig() var diffs []string @@ -218,6 +226,9 @@ func PrintSpanConfigDiffedAgainstDefaults(conf roachpb.SpanConfig) string { if conf.GCPolicy.TTLSeconds != defaultConf.GCPolicy.TTLSeconds { diffs = append(diffs, fmt.Sprintf("ttl_seconds=%d", conf.GCPolicy.TTLSeconds)) } + if conf.GCPolicy.IgnoreStrictEnforcement != defaultConf.GCPolicy.IgnoreStrictEnforcement { + diffs = append(diffs, fmt.Sprintf("ignore_strict_gc=%t", conf.GCPolicy.IgnoreStrictEnforcement)) + } if conf.GlobalReads != defaultConf.GlobalReads { diffs = append(diffs, fmt.Sprintf("global_reads=%v", conf.GlobalReads)) } @@ -227,6 +238,9 @@ func PrintSpanConfigDiffedAgainstDefaults(conf roachpb.SpanConfig) string { if conf.NumVoters != defaultConf.NumVoters { diffs = append(diffs, fmt.Sprintf("num_voters=%d", conf.NumVoters)) } + if conf.RangefeedEnabled != defaultConf.RangefeedEnabled { + diffs = append(diffs, fmt.Sprintf("rangefeed_enabled=%t", conf.RangefeedEnabled)) + } if !reflect.DeepEqual(conf.Constraints, defaultConf.Constraints) { diffs = append(diffs, fmt.Sprintf("constraints=%v", conf.Constraints)) }