Re: synchronized snapshots

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thom Brown <thom@linux.com>
Cc: Joachim Wieland <joe@mcknight.de>, Marko Tiikkaja <marko.tiikkaja@2ndquadrant.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2011-10-23T02:15:00Z
Lists: pgsql-hackers
Thom Brown <thom@linux.com> writes:
> Can I ask why it doesn't return the same snapshot ID each time?
> Surely it can't change since you can only export the snapshot of a
> serializable or repeatable read transaction?

No, that's incorrect.  You can export from a READ COMMITTED transaction;
indeed, you'd more or less have to, if you want the control transaction
to be able to see what the slaves do.

> A "SELECT
> count(pg_export_snapshot()) FROM generate_series(1,10000000);" would
> quickly bork the pg_snapshots directory which any user can run.

Shrug ... you can create a much more severe DOS problem by making
zillions of tables, if the filesystem doesn't handle lots-o-files
well.

			regards, tom lane