On Thu, Feb 9, 2017 at 1:47 AM, Beena Emerson <memissemer...@gmail.com> wrote: >> Won't it be simple if you consider -1 as a value to just load library? >> For *_interval = -1, it will neither load nor dump. >> > +1 > That is what I thought was the behaviour we decided upon for -1.
Right. I can't see why you'd want to be able to separately control those two things. If you're not dumping, you don't want to load; if you're not loading, you don't want to dump. I think what should happen is that there should be only one worker. If the GUC is -1, it never gets registered. Otherwise, it starts at database startup time and runs until shutdown. At startup time, it loads buffers until we run out of free buffers or until all saved buffers are loaded, whichever happens first. Buffers should be sorted by relfilenode (in any order) and block number (in increasing order). Once it finishes loading buffers, it repeatedly sleeps for the amount of time indicated by the GUC (or indefinitely if the GUC is 0), dumping after each sleep and at shutdown. Shutting down one worker to start up another doesn't seem to make sense. If for some reason you want the code for those in separate functions, you can call one function and then call the other. Putting them in completely separate processes doesn't buy anything. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers