-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathcluster_settings
164 lines (116 loc) · 4.63 KB
/
cluster_settings
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
statement ok
SET CLUSTER SETTING sql.log.slow_query.latency_threshold = '1ms'
statement error pq: invalid value for sql.log.slow_query.latency_threshold: cannot be set to a negative duration
SET CLUSTER SETTING sql.log.slow_query.latency_threshold = '-1ms'
statement error pq: invalid cluster setting argument type
SET CLUSTER SETTING sql.log.slow_query.latency_threshold = '1'
statement error pq: invalid cluster setting argument type
SET CLUSTER SETTING sql.log.slow_query.latency_threshold = '-1'
statement error pq: could not parse "true" as type interval: interval
SET CLUSTER SETTING sql.log.slow_query.latency_threshold = 'true'
statement error pq: invalid cluster setting argument type
SET CLUSTER SETTING sql.log.slow_query.latency_threshold = true
statement error buffer message size must be at least 16 kB
SET CLUSTER SETTING sql.conn.max_read_buffer_message_size = '1b'
statement ok
SET CLUSTER SETTING sql.conn.max_read_buffer_message_size = '64MB'
# Test permissions for modifying cluster settings.
user testuser
statement error only users with the MODIFYCLUSTERSETTING privilege are allowed to set cluster setting 'sql.defaults.default_int_size'
SET CLUSTER SETTING sql.defaults.default_int_size = 4
statement error only users with either MODIFYCLUSTERSETTING or VIEWCLUSTERSETTING privileges are allowed to show cluster setting 'sql.defaults.default_int_size'
SHOW CLUSTER SETTING sql.defaults.default_int_size
statement error only users with either MODIFYCLUSTERSETTING or VIEWCLUSTERSETTING privileges are allowed to SHOW CLUSTER SETTINGS
SHOW CLUSTER SETTINGS
statement error only users with either MODIFYCLUSTERSETTING or VIEWCLUSTERSETTING privileges are allowed to SHOW CLUSTER SETTINGS
SHOW ALL CLUSTER SETTINGS
user root
statement ok
ALTER USER testuser MODIFYCLUSTERSETTING
user testuser
statement ok
SET CLUSTER SETTING sql.defaults.default_int_size = 4
query I
SHOW CLUSTER SETTING sql.defaults.default_int_size
----
4
query TT
SELECT variable, value FROM [SHOW CLUSTER SETTINGS]
WHERE variable IN ('sql.defaults.default_int_size')
----
sql.defaults.default_int_size 4
query TT
SELECT variable, value FROM [SHOW ALL CLUSTER SETTINGS]
WHERE variable IN ('sql.defaults.default_int_size')
----
sql.defaults.default_int_size 4
user root
statement ok
ALTER USER testuser NOMODIFYCLUSTERSETTING
user testuser
statement error only users with the MODIFYCLUSTERSETTING privilege are allowed to set cluster setting 'sql.defaults.default_int_size'
SET CLUSTER SETTING sql.defaults.default_int_size = 4
user root
statement ok
ALTER USER testuser NOMODIFYCLUSTERSETTING
statement ok
ALTER USER testuser VIEWCLUSTERSETTING
user testuser
statement error only users with the MODIFYCLUSTERSETTING privilege are allowed to set cluster setting 'sql.defaults.default_int_size'
SET CLUSTER SETTING sql.defaults.default_int_size = 4
query I
SHOW CLUSTER SETTING sql.defaults.default_int_size
----
4
query TT
SELECT variable, value FROM [SHOW CLUSTER SETTINGS]
WHERE variable IN ('sql.defaults.default_int_size')
----
sql.defaults.default_int_size 4
query TT
SELECT variable, value FROM [SHOW ALL CLUSTER SETTINGS]
WHERE variable IN ('sql.defaults.default_int_size')
----
sql.defaults.default_int_size 4
user root
statement ok
ALTER USER testuser NOVIEWCLUSTERSETTING
user testuser
statement error only users with the MODIFYCLUSTERSETTING privilege are allowed to set cluster setting 'sql.defaults.default_int_size'
SET CLUSTER SETTING sql.defaults.default_int_size = 4
statement error only users with either MODIFYCLUSTERSETTING or VIEWCLUSTERSETTING privileges are allowed to SHOW CLUSTER SETTINGS
SHOW CLUSTER SETTINGS
statement error only users with either MODIFYCLUSTERSETTING or VIEWCLUSTERSETTING privileges are allowed to SHOW CLUSTER SETTINGS
SHOW ALL CLUSTER SETTINGS
user root
statement ok
GRANT admin TO testuser
user testuser
query TT rowsort
SELECT variable, value FROM [SHOW CLUSTER SETTINGS]
WHERE variable IN ( 'sql.defaults.default_int_size')
----
sql.defaults.default_int_size 4
query TT rowsort
SELECT variable, value FROM [SHOW ALL CLUSTER SETTINGS]
WHERE variable IN ('sql.defaults.default_int_size')
----
sql.defaults.default_int_size 4
query B
SHOW CLUSTER SETTING sql.defaults.stub_catalog_tables.enabled
----
true
skipif config 3node-tenant
statement ok
SET CLUSTER SETTING kv.snapshot_rebalance.max_rate = '10Mib'
skipif config 3node-tenant
query T
SHOW CLUSTER SETTING kv.snapshot_rebalance.max_rate
----
10 MiB
onlyif config 3node-tenant
statement error unknown cluster setting
SET CLUSTER SETTING kv.snapshot_rebalance.max_rate = '10Mib'
onlyif config 3node-tenant
statement error unknown setting
SHOW CLUSTER SETTING kv.snapshot_rebalance.max_rate