- Notifications
You must be signed in to change notification settings - Fork28
Commit52667d5
committed
Rethink the locking mechanisms used for CREATE/DROP/RENAME DATABASE.
The former approach used ExclusiveLock on pg_database, which being acluster-wide lock meant only one of these operations could proceed ata time; worse, it also blocked all incoming connections in ReverifyMyDatabase.Now that we have LockSharedObject(), we can use locks of different typesapplied to databases considered as objects. This allows much moreflexible management of the interlocking: two CREATE DATABASEs need notblock each other, and need not block connections except to the templatedatabase being used. Similarly DROP DATABASE doesn't block unrelatedoperations. The locking used in flatfiles.c is also much narrower inscope than before. Per recent proposal.1 parentcb98e6f commit52667d5
File tree
9 files changed
+451
-405
lines changed- doc/src/sgml
- ref
- src/backend
- catalog
- commands
- storage/lmgr
- utils/init
9 files changed
+451
-405
lines changedLines changed: 9 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
166 | 166 |
| |
167 | 167 |
| |
168 | 168 |
| |
| 169 | + | |
169 | 170 |
| |
170 | 171 |
| |
171 | 172 |
| |
| |||
220 | 221 |
| |
221 | 222 |
| |
222 | 223 |
| |
223 |
| - | |
| 224 | + | |
224 | 225 |
| |
225 | 226 |
| |
226 |
| - | |
227 |
| - | |
228 |
| - | |
229 |
| - | |
230 |
| - | |
231 |
| - | |
232 |
| - | |
233 |
| - | |
234 |
| - | |
235 |
| - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
236 | 233 |
| |
237 | 234 |
| |
238 | 235 |
| |
|
Lines changed: 19 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 |
| - | |
| 48 | + | |
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| |||
104 | 104 |
| |
105 | 105 |
| |
106 | 106 |
| |
107 |
| - | |
| 107 | + | |
| 108 | + | |
108 | 109 |
| |
109 | 110 |
| |
110 | 111 |
| |
| |||
169 | 170 |
| |
170 | 171 |
| |
171 | 172 |
| |
172 |
| - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
173 | 178 |
| |
174 | 179 |
| |
175 | 180 |
| |
| |||
220 | 225 |
| |
221 | 226 |
| |
222 | 227 |
| |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
223 | 238 |
| |
224 | 239 |
| |
225 | 240 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
86 | 86 |
| |
87 | 87 |
| |
88 | 88 |
| |
89 |
| - | |
| 89 | + | |
90 | 90 |
| |
91 | 91 |
| |
92 | 92 |
| |
|
Lines changed: 1 addition & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
41 | 40 |
| |
42 | 41 |
| |
43 | 42 |
| |
| |||
911 | 910 |
| |
912 | 911 |
| |
913 | 912 |
| |
914 |
| - | |
915 |
| - | |
916 |
| - | |
917 |
| - | |
918 |
| - | |
919 |
| - | |
920 | 913 |
| |
921 | 914 |
| |
922 | 915 |
| |
|
0 commit comments
Comments
(0)