On 01/05/17 03:35, Andres Freund wrote: > On 2017-04-30 17:59:21 -0700, Andres Freund wrote: >> ISTM, we need a xip_status array in SnapBuild->running. Then, whenever >> a xl_running_xacts is encountered while builder->running.xcnt > 0, loop >> for i in 0 .. xcnt_space, and end SnapBuildEndTxn() if xip_status[i] but >> the xid is not xl_running_xacts? Does that make sense? > > A hasty implementation, untested besides check-world, of that approach > is attached. I'm going out for dinner now, will subject it to mean > things afterwards. > > Needs more testing, comment and commit message policing. But I think > the idea is sound? >
I agree with adding running, I think that's good thing even for the per transaction tracking and snapshot exports - we could use the newly added field to get rid of the issue we have with 'snapshot too large' when there were many aborted transactions while we waited for running ones to finish. Because so far only tracked committed transactions, any aborted one would show as running inside the exported snapshot so it can grow over maximum number of backends and can't be exported anymore. So +1 for that part. But, I still think we need to restart the tracking after new xl_running_xacts. Reason for that is afaics any of the catalog snapshots that we assigned to transactions at the end of SnapBuildCommitTxn might be corrupted otherwise as they were built before we knew one of the supposedly running txes was actually already committed and that transaction might have done catalog changes. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers