-
由 Xin Zhang 提交于
Originally, the reader kept copies of subtransaction information in two places. First, it copied SharedLocalSnapshotSlot to share between writer and reader. Second, reader kept another copy in subxbuf for better performance. Due to lazy xid, subtransaction information can change in the writer asynchronously with respect to the reader. This caused reader's subtransaction information out of date. This fix removes those copies of subtransaction information in the reader and adds a reference to the writer's PGPROC to SharedLocalSnapshotSlot. Reader should refer to subtransaction information through writer's PGPROC and pg_subtrans. Also added is a lwlock per shared snapshot slot. The lock protects shared snapshot information between a writer and readers belonging to the same session. Fixes github issues #2269 and #2284. Signed-off-by: NAsim R P <apraveen@pivotal.io>
b52ca70f