@@ -88,15 +88,15 @@ user testuser
88
88
query TT async,rowsort readReq
89
89
SELECT * FROM t
90
90
----
91
- a val1
92
- b _updated
93
- c _updated
94
- l _updated
95
- m _updated
96
- p _updated
97
- s _updated
98
- t _updated
99
- z val9
91
+ a val1
92
+ b val2
93
+ c val3
94
+ l val4
95
+ m val5
96
+ p val6
97
+ s val7
98
+ t val8
99
+ z val9
100
100
101
101
user root
102
102
@@ -110,34 +110,39 @@ testuser SELECT * FROM t executing
110
110
query TTTTTTTBB colnames,retry,rowsort
111
111
SELECT database_name, schema_name, table_name, lock_key_pretty, lock_strength, durability, isolation_level, granted, contended FROM crdb_internal.cluster_locks WHERE range_id=$r1 AND txn_id='$txn1'
112
112
----
113
- database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
114
- test public t /Table/106/1/"b"/0 Intent Replicated SERIALIZABLE true true
115
- test public t /Table/106/1/"c"/0 Intent Replicated SERIALIZABLE true false
113
+ database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
114
+ test public t /Table/106/1/"b"/0 Exclusive Unreplicated SERIALIZABLE true true
115
+ test public t /Table/106/1/"c"/0 Exclusive Unreplicated SERIALIZABLE true false
116
116
117
117
query TTTTTTTBB colnames
118
118
SELECT database_name, schema_name, table_name, lock_key_pretty, lock_strength, durability, isolation_level, granted, contended FROM crdb_internal.cluster_locks WHERE range_id=$r1 AND txn_id='$txn2'
119
119
----
120
- database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
121
- test public t /Table/106/1/"b"/0 None Replicated SERIALIZABLE false true
120
+ database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
121
+ test public t /Table/106/1/"b"/0 None Unreplicated SERIALIZABLE false true
122
122
123
123
# since SQL incorporates limits which disables parallel batches, the select from txn2 will not reach subsequent ranges.
124
124
125
- query TTTTTTTBB colnames
125
+ query TTTTTTTBB colnames,rowsort
126
126
SELECT database_name, schema_name, table_name, lock_key_pretty, lock_strength, durability, isolation_level, granted, contended FROM crdb_internal.cluster_locks WHERE range_id=$r2 AND txn_id='$txn1'
127
127
----
128
- database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
128
+ database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
129
+ test public t /Table/106/1/"l"/0 Exclusive Unreplicated SERIALIZABLE true false
130
+ test public t /Table/106/1/"m"/0 Exclusive Unreplicated SERIALIZABLE true false
131
+ test public t /Table/106/1/"p"/0 Exclusive Unreplicated SERIALIZABLE true false
129
132
130
- query TTTTTTTBB colnames
133
+ query TTTTTTTBB colnames,rowsort
131
134
SELECT database_name, schema_name, table_name, lock_key_pretty, lock_strength, durability, isolation_level, granted, contended FROM crdb_internal.cluster_locks WHERE range_id=$r2 AND txn_id='$txn2'
132
135
----
133
136
database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
134
137
135
- query TTTTTTTBB colnames
138
+ query TTTTTTTBB colnames,rowsort
136
139
SELECT database_name, schema_name, table_name, lock_key_pretty, lock_strength, durability, isolation_level, granted, contended FROM crdb_internal.cluster_locks WHERE range_id=$r3 AND txn_id='$txn1'
137
140
----
138
- database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
141
+ database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
142
+ test public t /Table/106/1/"s"/0 Exclusive Unreplicated SERIALIZABLE true false
143
+ test public t /Table/106/1/"t"/0 Exclusive Unreplicated SERIALIZABLE true false
139
144
140
- query TTTTTTTBB colnames
145
+ query TTTTTTTBB colnames,rowsort
141
146
SELECT database_name, schema_name, table_name, lock_key_pretty, lock_strength, durability, isolation_level, granted, contended FROM crdb_internal.cluster_locks WHERE range_id=$r3 AND txn_id='$txn2'
142
147
----
143
148
database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
@@ -148,45 +153,60 @@ user testuser2
148
153
query TTTTTTTBB colnames,rowsort
149
154
SELECT database_name, schema_name, table_name, lock_key_pretty, lock_strength, durability, isolation_level, granted, contended FROM crdb_internal.cluster_locks WHERE range_id=$r1 AND txn_id='$txn1'
150
155
----
151
- database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
152
- test public t · Intent Replicated SERIALIZABLE true true
153
- test public t · Intent Replicated SERIALIZABLE true false
156
+ database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
157
+ test public t · Exclusive Unreplicated SERIALIZABLE true true
158
+ test public t · Exclusive Unreplicated SERIALIZABLE true false
154
159
155
160
user root
156
161
157
162
query TTTTTTTBB colnames,retry,rowsort
158
163
SELECT database_name, schema_name, table_name, lock_key_pretty, lock_strength, durability, isolation_level, granted, contended FROM crdb_internal.cluster_locks WHERE database_name='test'
159
164
----
160
- database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
161
- test public t /Table/106/1/"b"/0 Intent Replicated SERIALIZABLE true true
162
- test public t /Table/106/1/"b"/0 None Replicated SERIALIZABLE false true
163
- test public t /Table/106/1/"c"/0 Intent Replicated SERIALIZABLE true false
165
+ database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
166
+ test public t /Table/106/1/"b"/0 Exclusive Unreplicated SERIALIZABLE true true
167
+ test public t /Table/106/1/"b"/0 None Unreplicated SERIALIZABLE false true
168
+ test public t /Table/106/1/"c"/0 Exclusive Unreplicated SERIALIZABLE true false
169
+ test public t /Table/106/1/"l"/0 Exclusive Unreplicated SERIALIZABLE true false
170
+ test public t /Table/106/1/"m"/0 Exclusive Unreplicated SERIALIZABLE true false
171
+ test public t /Table/106/1/"p"/0 Exclusive Unreplicated SERIALIZABLE true false
172
+ test public t /Table/106/1/"s"/0 Exclusive Unreplicated SERIALIZABLE true false
173
+ test public t /Table/106/1/"t"/0 Exclusive Unreplicated SERIALIZABLE true false
164
174
165
175
query TTTTTTTBB colnames,retry,rowsort
166
176
SELECT database_name, schema_name, table_name, lock_key_pretty, lock_strength, durability, isolation_level, granted, contended FROM crdb_internal.cluster_locks WHERE table_id='t'::regclass::oid::int
167
177
----
168
- database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
169
- test public t /Table/106/1/"b"/0 Intent Replicated SERIALIZABLE true true
170
- test public t /Table/106/1/"b"/0 None Replicated SERIALIZABLE false true
171
- test public t /Table/106/1/"c"/0 Intent Replicated SERIALIZABLE true false
178
+ database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
179
+ test public t /Table/106/1/"b"/0 Exclusive Unreplicated SERIALIZABLE true true
180
+ test public t /Table/106/1/"b"/0 None Unreplicated SERIALIZABLE false true
181
+ test public t /Table/106/1/"c"/0 Exclusive Unreplicated SERIALIZABLE true false
182
+ test public t /Table/106/1/"l"/0 Exclusive Unreplicated SERIALIZABLE true false
183
+ test public t /Table/106/1/"m"/0 Exclusive Unreplicated SERIALIZABLE true false
184
+ test public t /Table/106/1/"p"/0 Exclusive Unreplicated SERIALIZABLE true false
185
+ test public t /Table/106/1/"s"/0 Exclusive Unreplicated SERIALIZABLE true false
186
+ test public t /Table/106/1/"t"/0 Exclusive Unreplicated SERIALIZABLE true false
172
187
173
188
query TTTTTTTBB colnames,retry,rowsort
174
189
SELECT database_name, schema_name, table_name, lock_key_pretty, lock_strength, durability, isolation_level, granted, contended FROM crdb_internal.cluster_locks WHERE contended=true AND lock_key_pretty LIKE '/Table/106%'
175
190
----
176
- database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
177
- test public t /Table/106/1/"b"/0 Intent Replicated SERIALIZABLE true true
178
- test public t /Table/106/1/"b"/0 None Replicated SERIALIZABLE false true
191
+ database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
192
+ test public t /Table/106/1/"b"/0 Exclusive Unreplicated SERIALIZABLE true true
193
+ test public t /Table/106/1/"b"/0 None Unreplicated SERIALIZABLE false true
179
194
180
- query TTTTTTTBB colnames,retry
195
+ query TTTTTTTBB colnames,retry,rowsort
181
196
SELECT database_name, schema_name, table_name, lock_key_pretty, lock_strength, durability, isolation_level, granted, contended FROM crdb_internal.cluster_locks WHERE contended=false AND lock_key_pretty LIKE '/Table/106%'
182
197
----
183
- database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
184
- test public t /Table/106/1/"c"/0 Intent Replicated SERIALIZABLE true false
198
+ database_name schema_name table_name lock_key_pretty lock_strength durability isolation_level granted contended
199
+ test public t /Table/106/1/"c"/0 Exclusive Unreplicated SERIALIZABLE true false
200
+ test public t /Table/106/1/"l"/0 Exclusive Unreplicated SERIALIZABLE true false
201
+ test public t /Table/106/1/"m"/0 Exclusive Unreplicated SERIALIZABLE true false
202
+ test public t /Table/106/1/"p"/0 Exclusive Unreplicated SERIALIZABLE true false
203
+ test public t /Table/106/1/"s"/0 Exclusive Unreplicated SERIALIZABLE true false
204
+ test public t /Table/106/1/"t"/0 Exclusive Unreplicated SERIALIZABLE true false
185
205
186
206
query I
187
207
SELECT count(*) FROM crdb_internal.cluster_locks WHERE table_name = 't'
188
208
----
189
- 3
209
+ 8
190
210
191
211
statement ok
192
212
COMMIT
0 commit comments