forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2367503
committed
Fix snapshot used in logical replication index lookup
The function calls GetLatestSnapshot() to acquire a fresh snapshot,makes it active, and was meant to pass it to table_tuple_lock(), butinstead called GetLatestSnapshot() again to acquire yet anothersnapshot. It was harmless because the heap AM and all other knowntable AMs ignore the 'snapshot' argument anyway, but let's be tidy.In the long run, this perhaps should be redesigned so that snapshotwas not needed in the first place. The table AM API uses TID +snapshot as the unique identifier for the row version, which isquestionable when the row came from an index scan with a Dirtysnapshot. You might lock a different row version when you use adifferent snapshot in the table_tuple_lock() call (a fresh MVCCsnapshot) than in the index scan (DirtySnapshot). However, in the heapAM and other AMs where the TID alone identifies the row version, itdoesn't matter. So for now, just fix the obvious albeit harmless bug.This has been wrong ever since the table AM API was introduced incommit5db6df0, so backpatch to all supported versions.Discussion:https://www.postgresql.org/message-id/83d243d6-ad8d-4307-8b51-2ee5844f6230@iki.fiBackpatch-through: 131 parent9f87e25 commit2367503
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
253 | 253 |
| |
254 | 254 |
| |
255 | 255 |
| |
256 |
| - | |
| 256 | + | |
257 | 257 |
| |
258 | 258 |
| |
259 | 259 |
| |
|
0 commit comments
Comments
(0)