On 2 January 2017 at 09:48, Simon Riggs <si...@2ndquadrant.com> wrote:

> I'm willing to assist in a project to allow changing wal_level online
> in this release. Please let's follow that path.

wal_level looks like one of the easier ones to change without a server restart

There are actions to take in either direction, up or down. My initial
thoughts on the pseudocode would be...

reset wal_level so all new transactions see that value
/* actions after setting new value */
if (old_wal_level  < new_wal_level) /* going up */
   get list of running transactions (perhaps only those using no-WAL-opt)
else /* coming down */
{
 if (old_wal_level == logical)
  disconnect logical replication and disallow logical slots
 if (new_wal_level == minimal)
  disconnect streaming replication and disallow physical slots
}
wait for a checkpoint (fast checkpoint if no other transactions actions active)
if (list)
   wait for list of running xacts to complete
wait for a checkpoint (fast checkpoint if no other transactions actions active)
XLogReportParameters()

So it looks easier to go up than down, which is good since that is the
important direction.

-- 
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, 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

Reply via email to