Skip to content

Commit

Permalink
backupccl: rename server with cluster in dd driver
Browse files Browse the repository at this point in the history
Previously, whenever the dd driver worked with a test cluster, it was always
called a server instead of a cluster. This is confusing, given all the other
ways crdb uses the word "server". To clear the air, this patch replaces all
uses of the word "server" with "cluster", where appropriate.

Epic: none

Release note: None
  • Loading branch information
msbutler committed Dec 5, 2022
1 parent 1a2f224 commit 5102486
Show file tree
Hide file tree
Showing 58 changed files with 215 additions and 215 deletions.
154 changes: 77 additions & 77 deletions pkg/ccl/backupccl/datadriven_test.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
new-server name=s1 allow-implicit-access
new-cluster name=s1 allow-implicit-access
----

# Create test schedules.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
new-server name=s1 allow-implicit-access
new-cluster name=s1 allow-implicit-access
----

# Test that dropping the full backup causes a graceful failure on ALTER.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
new-server name=s1 allow-implicit-access
new-cluster name=s1 allow-implicit-access
----

# Create test schedules.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
new-server name=s1 allow-implicit-access
new-cluster name=s1 allow-implicit-access
----

# Create test schedules.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# and type descriptors in the DROP state.
subtest dropped-database-descriptors

new-server name=s1
new-cluster name=s1
----

exec-sql
Expand Down Expand Up @@ -105,7 +105,7 @@ subtest end
# Test backup/restore interaction with dropped schema and type in a database.
subtest dropped-schema-descriptors

new-server name=s2
new-cluster name=s2
----

exec-sql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# and type descriptors in the DROP state.
subtest dropped-database-descriptors

new-server name=s1
new-cluster name=s1
----

exec-sql
Expand Down Expand Up @@ -58,7 +58,7 @@ subtest end
# Test backup/restore interaction with dropped schema and type in a database.
subtest dropped-schema-descriptors

new-server name=s2
new-cluster name=s2
----

exec-sql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
new-server name=s1
new-cluster name=s1
----

exec-sql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Test permissions checks for non-admin users running BACKUP.
new-server name=s1
new-cluster name=s1
----

exec-sql
Expand Down Expand Up @@ -42,7 +42,7 @@ BACKUP TABLE d.t INTO 'nodelocal://0/test-nonroot-table';
# Start a new cluster with the same IO dir.
# nodelocal IO is a form of implicit access (since it is accessed as the node,
# so we require the allow-implicit-access flag.
new-server name=s2 allow-implicit-access
new-cluster name=s2 allow-implicit-access
----

exec-sql
Expand Down Expand Up @@ -121,18 +121,18 @@ GRANT USAGE ON TYPE d2.greeting TO testuser;
----

# testuser should now have all the required privileges.
exec-sql server=s2 user=testuser
exec-sql cluster=s2 user=testuser
BACKUP DATABASE d2 INTO 'nodelocal://0/d2';
----
NOTICE: The existing privileges are being deprecated in favour of a fine-grained privilege model explained here <link>. In a future release, to run BACKUP DATABASE, user testuser will exclusively require the BACKUP privilege on database d2.

exec-sql server=s2 user=testuser
exec-sql cluster=s2 user=testuser
BACKUP TABLE d2.t INTO 'nodelocal://0/d2-table';
----
NOTICE: The existing privileges are being deprecated in favour of a fine-grained privilege model explained here <link>. In a future release, to run BACKUP TABLE, user testuser will exclusively require the BACKUP privilege on tables: t.

# Test that implicit access is disallowed when the testing knob is not set.
new-server name=s3 share-io-dir=s1
new-cluster name=s3 share-io-dir=s1
----

exec-sql
Expand All @@ -142,7 +142,7 @@ CREATE USER testuser;
GRANT CONNECT ON DATABASE d TO testuser;
----

exec-sql server=s3 user=testuser
exec-sql cluster=s3 user=testuser
SHOW BACKUP 'http://COCKROACH_TEST_HTTP_SERVER/'
----
pq: only users with the admin role or the EXTERNALIOIMPLICITACCESS system privilege are allowed to access the specified http URI
Expand All @@ -153,14 +153,14 @@ BACKUP DATABASE d INTO 'nodelocal://0/test3'
pq: only users with the admin role or the EXTERNALIOIMPLICITACCESS system privilege are allowed to access the specified nodelocal URI

# Test that http access is disallowed by disable http even if allow-non-admin is on.
new-server name=s4 allow-implicit-access disable-http
new-cluster name=s4 allow-implicit-access disable-http
----

exec-sql server=s4
exec-sql cluster=s4
CREATE USER testuser
----

exec-sql server=s4 user=testuser
exec-sql cluster=s4 user=testuser
SHOW BACKUP 'http://COCKROACH_TEST_HTTP_SERVER/'
----
pq: make storage: external http access disabled
2 changes: 1 addition & 1 deletion pkg/ccl/backupccl/testdata/backup-restore/column-families
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# disabled to run within tenant because ALTER SPLIT cmd is not supported within tenant

new-server name=s1 disable-tenant localities=us-east-1,us-west-1,us-west-2,eu-central-1
new-cluster name=s1 disable-tenant localities=us-east-1,us-west-1,us-west-2,eu-central-1
----

exec-sql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
new-server name=s1
new-cluster name=s1
----

exec-sql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# disabled to run within a tenant because they cannot set zone configs
# https://github.com/cockroachdb/cockroach/issues/49854?version=v22.2

new-server name=s1 disable-tenant
new-cluster name=s1 disable-tenant
----

exec-sql
Expand All @@ -26,7 +26,7 @@ exec-sql
BACKUP INTO 'nodelocal://0/conflicting-descriptors';
----

new-server name=s2 share-io-dir=s1 disable-tenant
new-cluster name=s2 share-io-dir=s1 disable-tenant
----

# Create 4 dummy system tables that will have conflicting IDs with the database,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# These tests validate the DROP SCHEDULE command for dropping the incremental scheduled
# backup when the full scheduled backup is dropped.

new-server name=s1
new-cluster name=s1
----

exec-sql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
new-server name=s1
new-cluster name=s1
----

exec-sql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
new-server name=s1
new-cluster name=s1
----

subtest basic-backup-nodelocal
Expand Down Expand Up @@ -99,7 +99,7 @@ subtest end

subtest basic-restore-nodelocal

new-server name=s2 share-io-dir=s1
new-cluster name=s2 share-io-dir=s1
----

# Cluster restore.
Expand Down Expand Up @@ -157,7 +157,7 @@ subtest end

subtest incremental-location-backup-restore-nodelocal

switch-server name=s1
switch-cluster name=s1
----

exec-sql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
new-server name=s1
new-cluster name=s1
----

subtest backup-restore-privileges
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
new-server name=s1
new-cluster name=s1
----

subtest basic-backup-userfile
Expand Down Expand Up @@ -136,7 +136,7 @@ subtest end

subtest incremental-location-backup-restore-userfile

switch-server name=s1
switch-cluster name=s1
----

exec-sql
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/backupccl/testdata/backup-restore/feature-flags
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ subtest backup-feature-flags

# disabled for tenants as they can't enable/disable backup and restore features

new-server name=s1 disable-tenant
new-cluster name=s1 disable-tenant
----

exec-sql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
subtest backup_file_table

new-server name=s1
new-cluster name=s1
----

exec-sql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## -check that the ImportStartTime is set on the descriptor
## -check that it's removed after cancellation / success

new-server name=s1
new-cluster name=s1
----

exec-sql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@
# - revision history cluster backups
# - revision history table/database backups which includes an incremental backup between t1 and t2

new-server name=s1 allow-implicit-access disable-tenant
new-cluster name=s1 allow-implicit-access disable-tenant
----

# Link 4 backup chains:
# 1. A corrupt database backup chain with revision history
link-backup server=s1 src-path=restore_importing_tables,database dest-path=database
link-backup cluster=s1 src-path=restore_importing_tables,database dest-path=database
----

# 2. A clean database backup chain with revision history which includes two
# backups that observe the offline descriptors.
link-backup server=s1 src-path=restore_importing_tables,database_double_inc dest-path=database_double_inc
link-backup cluster=s1 src-path=restore_importing_tables,database_double_inc dest-path=database_double_inc
----

# 3. A clean data database backup chain without revision history
link-backup server=s1 src-path=restore_importing_tables,database_no_hist dest-path=database_no_hist
link-backup cluster=s1 src-path=restore_importing_tables,database_no_hist dest-path=database_no_hist
----

# 4. A clean cluster backup chain with revision history
link-backup server=s1 src-path=restore_importing_tables,cluster dest-path=cluster
link-backup cluster=s1 src-path=restore_importing_tables,cluster dest-path=cluster
----

# Note that we're purposely skipping the reintroduction of foo, foofoo, goodfoo in the
Expand Down Expand Up @@ -212,7 +212,7 @@ SELECT count(*) FROM d.goodfoo;


# Check the cluster level restore
new-server name=s2 share-io-dir=s1 allow-implicit-access disable-tenant
new-cluster name=s2 share-io-dir=s1 allow-implicit-access disable-tenant
----

exec-sql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# disabled to run within tenant as they don't have access to the
# storage.mvcc.range_tombstones.enabled cluster setting
new-server name=s1 disable-tenant
new-cluster name=s1 disable-tenant
----

###########
Expand Down
12 changes: 6 additions & 6 deletions pkg/ccl/backupccl/testdata/backup-restore/in-progress-imports
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# On an unfinalized cluster: a backed up import should not get restored


new-server name=s1
new-cluster name=s1
----


Expand Down Expand Up @@ -182,7 +182,7 @@ d foofoo table 3 incremental


# Ensure all the RESTOREs contain foo (no data) and foofoo (1 row) as of system time t0
new-server name=s2 share-io-dir=s1 allow-implicit-access
new-cluster name=s2 share-io-dir=s1 allow-implicit-access
----


Expand Down Expand Up @@ -246,7 +246,7 @@ SELECT * FROM d.foofoo;


# Ensure the imported data exists as of latest time
new-server name=s3 share-io-dir=s1 allow-implicit-access
new-cluster name=s3 share-io-dir=s1 allow-implicit-access
----


Expand Down Expand Up @@ -334,7 +334,7 @@ SELECT * FROM d.foofoo;
# More investigation required.


new-server name=s4 share-io-dir=s1 allow-implicit-access beforeVersion=Start22_2 disable-tenant
new-cluster name=s4 share-io-dir=s1 allow-implicit-access beforeVersion=Start22_2 disable-tenant
----

exec-sql
Expand Down Expand Up @@ -508,7 +508,7 @@ d foo table 2 incremental
d foofoo table 3 incremental


upgrade-server version=Start22_2
upgrade-cluster version=Start22_2
----

exec-sql
Expand All @@ -532,7 +532,7 @@ d foofoo table 3 incremental


# Restore the backups taken from a mixed version chain
new-server name=s5 share-io-dir=s1 allow-implicit-access disable-tenant
new-cluster name=s5 share-io-dir=s1 allow-implicit-access disable-tenant
----


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# offline tables.


new-server name=s1
new-cluster name=s1
----

exec-sql
Expand Down Expand Up @@ -116,7 +116,7 @@ b2 baz table 3 incremental

# Ensure the restored cluster contains nothing from the in-progress restoring database as of system
# time t0
new-server name=s2 share-io-dir=s1 allow-implicit-access
new-cluster name=s2 share-io-dir=s1 allow-implicit-access
----


Expand All @@ -131,7 +131,7 @@ SELECT database_name FROM [SHOW DATABASES] WHERE database_name = 'b2';


# Ensure restored cluster contains the restored database as of latest time
new-server name=s3 share-io-dir=s1 allow-implicit-access
new-cluster name=s3 share-io-dir=s1 allow-implicit-access
----


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
new-server name=s1
new-cluster name=s1
----

# Test that a backup job does not read its own lock file on resumption,
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/backupccl/testdata/backup-restore/max-row-size
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
new-server name=m1
new-cluster name=m1
----

exec-sql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# disabled to run within tenant because multiregion primitives are not supported within tenant

new-server name=s1 allow-implicit-access disable-tenant localities=us-east-1,us-west-1
new-cluster name=s1 allow-implicit-access disable-tenant localities=us-east-1,us-west-1
----

exec-sql
Expand Down
Loading

0 comments on commit 5102486

Please sign in to comment.