forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd2088ae
committed
Move RegisterPredicateLockingXid() call to a safer place.
The SSI patch inserted a call of RegisterPredicateLockingXid intoGetNewTransactionId, which was a bad idea on a couple of grounds. First,it's not necessary to hold XidGenLock while manipulating that sharedmemory, and doing so is bad because XidGenLock is a high-contention lockthat should be held for as short a time as possible. (Not to mention thatit adds an entirely unnecessary deadlock hazard, since we must takeSerializableXactHashLock as well.) Second, the specific place where it wasput was between extending CLOG and advancing nextXid, which could result inunpleasant behavior in case of a failure there. Pull the call out toAssignTransactionId, which is much safer and arguably better from amodularity standpoint too.There is more work to do to clean up the failure-before-advancing-nextXidissue, but that is a separate change that will need to be back-patched.So for the moment I just want to make GetNewTransactionId look the same asit did in prior versions.1 parent12b7164 commitd2088ae
2 files changed
+7
-5
lines changedLines changed: 0 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
25 | 24 |
| |
26 | 25 |
| |
27 | 26 |
| |
| |||
162 | 161 |
| |
163 | 162 |
| |
164 | 163 |
| |
165 |
| - | |
166 |
| - | |
167 |
| - | |
168 |
| - | |
169 | 164 |
| |
170 | 165 |
| |
171 | 166 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
454 | 454 |
| |
455 | 455 |
| |
456 | 456 |
| |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
457 | 464 |
| |
458 | 465 |
| |
459 | 466 |
| |
|
0 commit comments
Comments
(0)