Skip to content

Commit

Permalink
systemschema: use ExcludeDataFromBackup on some tables
Browse files Browse the repository at this point in the history
Certain tables are updated frequently and contain data that should never
be backed up or restored. Allowing backups on them is not desired, since
that results in protected timestamps being applied on the table, which
prevents GC of old data.

This commit excludes the lease, replication_constraint_stats,
replication_stats, and tenant_usage tables from backups. These are the
tables that explicitly have their gc.ttl configured to a lower value.

Release note: None
  • Loading branch information
rafiss committed Mar 7, 2024
1 parent 3e61bd3 commit 3d87bec
Show file tree
Hide file tree
Showing 27 changed files with 325 additions and 116 deletions.
16 changes: 8 additions & 8 deletions pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/basic
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ upsert /Table/{6-7} database system (host)
upsert /Table/{7-8} database system (host)
upsert /Table/{8-9} database system (host)
upsert /Table/{9-10} database system (host)
upsert /Table/1{1-2} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true
upsert /Table/1{1-2} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true exclude_data_from_backup=true
upsert /Table/1{2-3} database system (host)
upsert /Table/1{3-4} database system (host)
upsert /Table/1{4-5} database system (host)
Expand All @@ -33,9 +33,9 @@ upsert /Table/2{1-2} database system (host)
upsert /Table/2{2-3} 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{5-6} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true exclude_data_from_backup=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{7-8} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true exclude_data_from_backup=true
upsert /Table/2{8-9} database system (host)
upsert /{Table/29-NamespaceTable/30} range system
upsert /NamespaceTable/{30-Max} database system (host)
Expand All @@ -53,7 +53,7 @@ upsert /Table/4{1-2} database system (host)
upsert /Table/4{2-3} ttl_seconds=3600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true
upsert /Table/4{3-4} ttl_seconds=3600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true
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{5-6} ttl_seconds=7200 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true exclude_data_from_backup=true
upsert /Table/4{6-7} database system (host)
upsert /Table/4{7-8} database system (host)
upsert /Table/4{8-9} database system (host)
Expand Down Expand Up @@ -254,7 +254,7 @@ state offset=5 limit=42
/Table/{7-8} 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/{9-10} ttl_seconds=100 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true
/Table/1{1-2} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true
/Table/1{1-2} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true exclude_data_from_backup=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
Expand All @@ -268,9 +268,9 @@ state offset=5 limit=42
/Table/2{2-3} 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{5-6} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true exclude_data_from_backup=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{7-8} ttl_seconds=600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true exclude_data_from_backup=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 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true
Expand All @@ -288,5 +288,5 @@ state offset=5 limit=42
/Table/4{2-3} ttl_seconds=3600 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true
/Table/4{3-4} ttl_seconds=3600 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{5-6} ttl_seconds=7200 ignore_strict_gc=true num_replicas=5 rangefeed_enabled=true exclude_data_from_backup=true
...
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ delete /Table/10{6/3-7}
state offset=46
----
...
/Table/4{5-6} ttl_seconds=7200 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 exclude_data_from_backup=true
/Table/4{6-7} database system (host)
/Table/4{7-8} database system (host)
/Table/4{8-9} database system (host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ 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/{9-10} database system (tenant)
upsert /Tenant/10/Table/1{1-2} database system (tenant)
upsert /Tenant/10/Table/1{1-2} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
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)
Expand All @@ -68,9 +68,9 @@ 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{5-6} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
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{7-8} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
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)
Expand Down Expand Up @@ -130,7 +130,7 @@ state offset=47
/Tenant/10/Table/{6-7} database system (tenant)
/Tenant/10/Table/{7-8} database system (tenant)
/Tenant/10/Table/{9-10} database system (tenant)
/Tenant/10/Table/1{1-2} database system (tenant)
/Tenant/10/Table/1{1-2} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
/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)
Expand All @@ -140,9 +140,9 @@ state offset=47
/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{5-6} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
/Tenant/10/Table/2{6-7} database system (tenant)
/Tenant/10/Table/2{7-8} database system (tenant)
/Tenant/10/Table/2{7-8} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
/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)
Expand Down Expand Up @@ -198,9 +198,9 @@ state offset=81
----
...
/Tenant/10/Table/2{4-5} database system (tenant)
/Tenant/10/Table/2{5-6} database system (tenant)
/Tenant/10/Table/2{5-6} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
/Tenant/10/Table/2{6-7} database system (tenant)
/Tenant/10/Table/2{7-8} database system (tenant)
/Tenant/10/Table/2{7-8} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
/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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ 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/{9-10} database system (tenant)
upsert /Tenant/10/Table/1{1-2} database system (tenant)
upsert /Tenant/10/Table/1{1-2} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
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)
Expand All @@ -84,9 +84,9 @@ 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{5-6} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
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{7-8} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ state offset=47
/Tenant/10/Table/{6-7} database system (tenant)
/Tenant/10/Table/{7-8} database system (tenant)
/Tenant/10/Table/{9-10} database system (tenant)
/Tenant/10/Table/1{1-2} database system (tenant)
/Tenant/10/Table/1{1-2} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
/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)
Expand All @@ -108,9 +108,9 @@ state offset=47
/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{5-6} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
/Tenant/10/Table/2{6-7} database system (tenant)
/Tenant/10/Table/2{7-8} database system (tenant)
/Tenant/10/Table/2{7-8} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
/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)
Expand Down Expand Up @@ -179,9 +179,9 @@ state offset=81
----
...
/Tenant/10/Table/2{4-5} database system (tenant)
/Tenant/10/Table/2{5-6} database system (tenant)
/Tenant/10/Table/2{5-6} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
/Tenant/10/Table/2{6-7} database system (tenant)
/Tenant/10/Table/2{7-8} database system (tenant)
/Tenant/10/Table/2{7-8} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
/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)
Expand Down Expand Up @@ -220,7 +220,7 @@ state offset=81
/Tenant/11/Table/{6-7} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/Table/{7-8} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/Table/{9-10} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/Table/1{1-2} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/Table/1{1-2} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
/Tenant/11/Table/1{2-3} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/Table/1{3-4} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/Table/1{4-5} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
Expand All @@ -230,9 +230,9 @@ state offset=81
/Tenant/11/Table/2{1-2} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/Table/2{3-4} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/Table/2{4-5} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/Table/2{5-6} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/Table/2{5-6} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
/Tenant/11/Table/2{6-7} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/Table/2{7-8} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/Table/2{7-8} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
/Tenant/11/Table/2{8-9} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/NamespaceTable/{30-Max} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
/Tenant/11/{NamespaceTable/Max-Table/32} ttl_seconds=18000 ignore_strict_gc=true rangefeed_enabled=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ upsert /Tenant/11/Table/{5-6} database system (tenant)
upsert /Tenant/11/Table/{6-7} database system (tenant)
upsert /Tenant/11/Table/{7-8} database system (tenant)
upsert /Tenant/11/Table/{9-10} database system (tenant)
upsert /Tenant/11/Table/1{1-2} database system (tenant)
upsert /Tenant/11/Table/1{1-2} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
upsert /Tenant/11/Table/1{2-3} database system (tenant)
upsert /Tenant/11/Table/1{3-4} database system (tenant)
upsert /Tenant/11/Table/1{4-5} database system (tenant)
Expand All @@ -89,9 +89,9 @@ upsert /Tenant/11/Table/2{0-1} database system (tenant)
upsert /Tenant/11/Table/2{1-2} database system (tenant)
upsert /Tenant/11/Table/2{3-4} database system (tenant)
upsert /Tenant/11/Table/2{4-5} database system (tenant)
upsert /Tenant/11/Table/2{5-6} database system (tenant)
upsert /Tenant/11/Table/2{5-6} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
upsert /Tenant/11/Table/2{6-7} database system (tenant)
upsert /Tenant/11/Table/2{7-8} database system (tenant)
upsert /Tenant/11/Table/2{7-8} ignore_strict_gc=true rangefeed_enabled=true exclude_data_from_backup=true
upsert /Tenant/11/Table/2{8-9} database system (tenant)
upsert /Tenant/11/NamespaceTable/{30-Max} database system (tenant)
upsert /Tenant/11/{NamespaceTable/Max-Table/32} database system (tenant)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ state limit=5
state offset=46
----
...
/Table/4{5-6} ttl_seconds=7200 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 exclude_data_from_backup=true
/Table/4{6-7} database system (host)
/Table/4{7-8} database system (host)
/Table/4{8-9} database system (host)
Expand Down Expand Up @@ -157,7 +157,7 @@ upsert /Table/10{7-8} ttl_seconds=50
state offset=46
----
...
/Table/4{5-6} ttl_seconds=7200 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 exclude_data_from_backup=true
/Table/4{6-7} database system (host)
/Table/4{7-8} database system (host)
/Table/4{8-9} database system (host)
Expand Down
Loading

0 comments on commit 3d87bec

Please sign in to comment.