-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathfeature-flags
90 lines (69 loc) · 3.17 KB
/
feature-flags
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
subtest backup-feature-flags
new-server name=s1
----
exec-sql
CREATE DATABASE d;
CREATE TABLE d.t (x INT);
INSERT INTO d.t VALUES (1), (2), (3);
----
# Test running backup when BACKUP feature flag is disabled.
exec-sql
SET CLUSTER SETTING feature.backup.enabled = FALSE;
----
exec-sql
BACKUP INTO 'nodelocal://0/test-root/';
----
pq: feature BACKUP was disabled by the database administrator
# Test running backup when feature flag is enabled.
exec-sql
SET CLUSTER SETTING feature.backup.enabled = TRUE;
----
exec-sql
BACKUP INTO 'nodelocal://0/test-root/';
----
exec-sql
DROP TABLE d.t;
----
# Test running restore when feature flag is disabled.
exec-sql
SET CLUSTER SETTING feature.restore.enabled = FALSE;
----
exec-sql
RESTORE TABLE d.t FROM LATEST IN 'nodelocal://0/test-root/';
----
pq: feature RESTORE was disabled by the database administrator
# Test running restore when feature flag is enabled.
exec-sql
SET CLUSTER SETTING feature.restore.enabled = TRUE;
----
exec-sql
RESTORE TABLE d.t FROM LATEST IN 'nodelocal://0/test-root/';
----
subtest end
# TODO(adityamaru): Delete in 22.2 once the syntax is removed. We don't want
# to start a testserver just for this test.
subtest backup-restore-deprecation-notice
exec-sql
BACKUP TO 'nodelocal://1/deprecated';
----
NOTICE: The `BACKUP TO` syntax will be removed in a future release, please switch over to using `BACKUP INTO` to create a backup collection: https://www.cockroachlabs.com/docs/stable/backup.html#considerations. Backups created using the `BACKUP TO` syntax may not be restoreable in the next major version release.
exec-sql
SHOW BACKUP 'nodelocal://1/deprecated';
----
NOTICE: The `SHOW BACKUP` syntax without the `IN` keyword will be removed in a future release. Please switch over to using `SHOW BACKUP FROM <backup> IN <collection>` to view metadata on a backup collection: https://www.cockroachlabs.com/docs/stable/show-backup.html. Also note that backups created using the `BACKUP TO` syntax may not be showable or restoreable in the next major version release. Use `BACKUP INTO` instead.
exec-sql
BACKUP TO 'nodelocal://1/deprecated/incfrom' INCREMENTAL FROM 'nodelocal://1/deprecated';
----
NOTICE: The `BACKUP TO` syntax will be removed in a future release, please switch over to using `BACKUP INTO` to create a backup collection: https://www.cockroachlabs.com/docs/stable/backup.html#considerations. Backups created using the `BACKUP TO` syntax may not be restoreable in the next major version release.
exec-sql
DROP TABLE d.t;
----
exec-sql
RESTORE TABLE d.t FROM 'nodelocal://1/deprecated';
----
NOTICE: The `RESTORE FROM <backup>` syntax will be removed in a future release, please switch over to using `RESTORE FROM <backup> IN <collection>` to restore a particular backup from a collection: https://www.cockroachlabs.com/docs/stable/restore.html#view-the-backup-subdirectories
exec-sql
RESTORE SYSTEM USERS FROM 'nodelocal://1/deprecated';
----
NOTICE: The `RESTORE FROM <backup>` syntax will be removed in a future release, please switch over to using `RESTORE FROM <backup> IN <collection>` to restore a particular backup from a collection: https://www.cockroachlabs.com/docs/stable/restore.html#view-the-backup-subdirectories
subtest end