forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2e44770
committed
pgrowlocks: Use GetActiveSnapshot() rather than SnapshotNow.
Per discussion, it's desirable to eliminate all remaining uses ofSnapshotNow, because it has unpleasant semantics: race conditionscan result in seeing multiple versions of a concurrently updatedrow, or none at all. By using GetActiveSnapshot() here, callerswill see exactly those rows that would have been visible if theinvoking query had scanned the table using, for example, a SELECTstatement.This is slightly different from the old behavior, because commitsthat happen concurrently with the scan will not affect the results.In REPEATABLE READ or SERIALIZABLE modes, where transactionsnapshots are used, commits that have happened since the start ofthe transaction will also not affect the results. It is hopedthat this minor incompatibility will be thought an improvement,or at least no worse than what we did before.1 parentf40a318 commit2e44770
1 file changed
+2
-1
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
| 38 | + | |
38 | 39 |
| |
39 | 40 |
| |
40 | 41 |
| |
| |||
106 | 107 |
| |
107 | 108 |
| |
108 | 109 |
| |
109 |
| - | |
| 110 | + | |
110 | 111 |
| |
111 | 112 |
| |
112 | 113 |
| |
|
0 commit comments
Comments
(0)