forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4ba84de
committed
Avoid "you don't own a lock of type ExclusiveLock" in GRANT TABLESPACE.
This WARNING appeared because SearchSysCacheLocked1() readcc_relisshared before catcache initialization, when the field is falseunconditionally. On the basis of reading false there, it constructed alocktag as though pg_tablespace weren't relisshared. Only sharedcatalogs could be affected, and only GRANT TABLESPACE was affected inpractice. SearchSysCacheLocked1() callers use one other shared-relationsyscache, DATABASEOID. DATABASEOID is initialized by the end ofCheckMyDatabase(), making the problem unreachable for pg_database.Back-patch to v13 (all supported versions). This has no known impactbefore v16, where ExecGrant_common() first appeared. Earlier branchesavoid trouble by having a separate ExecGrant_Tablespace() that doesn'tuse LOCKTAG_TUPLE. However, leaving this unfixed in v15 could ensnare afuture back-patch of a SearchSysCacheLocked1() call.Reported by Aya Iwata.Discussion:https://postgr.es/m/OS7PR01MB11964507B5548245A7EE54E70EA212@OS7PR01MB11964.jpnprd01.prod.outlook.com1 parent96a81c1 commit4ba84de
File tree
3 files changed
+21
-5
lines changed- src
- backend/utils/cache
- test/regress
- expected
- sql
3 files changed
+21
-5
lines changedLines changed: 10 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
287 | 287 |
| |
288 | 288 |
| |
289 | 289 |
| |
| 290 | + | |
290 | 291 |
| |
291 | 292 |
| |
292 |
| - | |
293 |
| - | |
294 |
| - | |
295 | 293 |
| |
296 | 294 |
| |
297 | 295 |
| |
| |||
343 | 341 |
| |
344 | 342 |
| |
345 | 343 |
| |
346 |
| - | |
347 |
| - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
348 | 353 |
| |
349 | 354 |
| |
350 | 355 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
927 | 927 |
| |
928 | 928 |
| |
929 | 929 |
| |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
930 | 935 |
| |
931 | 936 |
| |
932 | 937 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
396 | 396 |
| |
397 | 397 |
| |
398 | 398 |
| |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
399 | 405 |
| |
400 | 406 |
| |
401 | 407 |
| |
|
0 commit comments
Comments
(0)