Re: Issue in PG start

2021-05-09 Thread Adrian Klaver

On 5/8/21 7:32 PM, sivapostg...@yahoo.com wrote:

Yesterday's log file.   Till we shut down the windows the message was:
2021-05-08 19:03:32.151 IST [10376] FATAL:  the database system is 
starting up
2021-05-08 19:03:42.210 IST [7568] FATAL:  the database system is 
starting up



Comments in line below.




Today morning log file, I tried to start the service [ after setting the 
startup type to Manual ] twice

***
2021-05-09 07:43:02.122 IST [16776] LOG:  test message did not get 
through on socket for statistics collector


Something is blocking the socket.
Do you have anti-virus software on this machine?

2021-05-09 07:43:02.122 IST [16776] LOG:  trying another address for the 
statistics collector
2021-05-09 07:43:02.624 IST [16776] LOG:  test message did not get 
through on socket for statistics collector
2021-05-09 07:43:02.624 IST [16776] LOG:  disabling statistics collector 
for lack of working socket
2021-05-09 07:43:02.624 IST [16776] WARNING:  autovacuum not started 
because of misconfiguration

2021-05-09 07:43:02.624 IST [16776] HINT:  Enable the "track_counts" option.


You should take care of this by following the HINT.

2021-05-09 07:43:02.685 IST [17144] LOG:  database system was 
interrupted; last known up at 2021-05-07 18:46:00 IST
2021-05-09 07:43:04.489 IST [17196] FATAL:  the database system is 
starting up


...

2021-05-09 07:45:14.796 IST [17144] LOG:  database system was not 
properly shut down; automatic recovery in progress

2021-05-09 07:45:14.864 IST [17144] LOG:  redo starts at 2/88985C80
2021-05-09 07:45:14.866 IST [17144] LOG:  invalid record length at 
2/889872B8: wanted 24, got 0

2021-05-09 07:45:14.866 IST [17144] LOG:  redo done at 2/88987280
2021-05-09 07:45:14.866 IST [17144] LOG:  last completed transaction was 
at log time 2021-05-07 18:48:44.227574+05:30
2021-05-09 07:45:15.046 IST [16776] LOG:  database system is ready to 
accept connections
2021-05-09 07:50:17.295 IST [17204] ERROR:  canceling statement due to 
user request


So did you or someone else do the above and the below manually or was 
this coming from the system?



2021-05-09 07:50:17.300 IST [16776] LOG:  received fast shutdown request
2021-05-09 07:50:17.322 IST [4408] LOG:  could not receive data from 
client: An existing connection was forcibly closed by the remote host.


Are you connecting to database from outside the machine and if so is 
that from a local network or a remote one?


2021-05-09 07:50:17.412 IST [16776] LOG:  aborting any active transactions
2021-05-09 07:50:17.419 IST [16776] LOG:  background worker "logical 
replication launcher" (PID 17204) exited with exit code 1

2021-05-09 07:50:17.548 IST [11032] LOG:  shutting down
2021-05-09 07:50:17.607 IST [16776] LOG:  database system is shut down
**


See more below.



Log file after a re-start
***
2021-05-09 07:52:40.341 IST [13220] LOG:  test message did not get 
through on socket for statistics collector
2021-05-09 07:52:40.342 IST [13220] LOG:  trying another address for the 
statistics collector
2021-05-09 07:52:40.844 IST [13220] LOG:  test message did not get 
through on socket for statistics collector
2021-05-09 07:52:40.844 IST [13220] LOG:  disabling statistics collector 
for lack of working socket
2021-05-09 07:52:40.845 IST [13220] WARNING:  autovacuum not started 
because of misconfiguration

2021-05-09 07:52:40.845 IST [13220] HINT:  Enable the "track_counts" option.
2021-05-09 07:52:40.904 IST [13860] LOG:  database system was shut down 
at 2021-05-09 07:50:17 IST
2021-05-09 07:52:41.122 IST [13220] LOG:  database system is ready to 
accept connections
2021-05-09 07:55:23.628 IST [11188] LOG:  using stale statistics instead 
of current ones because stats collector is not responding

*

Not sure what happened, it's working now.  Any idea of what happened and 
what should we do to prevent re-occurance ?


It's up but not really working. Both the statistics collector and the 
autovacuum processes are down. They are both important for the operation 
of the database.




Happiness Always
BKR Sivaprakash





--
Adrian Klaver
adrian.kla...@aklaver.com




Setting wal_keep_segments parameter

2021-05-09 Thread rob stan
Hello ,

I want to set wal_keep_segments parameter to a value but what should be the
process I follow? I have archiving process on all clusters is on but when a
sudden process comes to postgres wal files will be bigger than i assume. I
don't know what I should  do. Could you please help me?

Thanks.


Re: Setting wal_keep_segments parameter

2021-05-09 Thread Tom Lane
rob stan  writes:
> I want to set wal_keep_segments parameter to a value but what should be the
> process I follow? I have archiving process on all clusters is on but when a
> sudden process comes to postgres wal files will be bigger than i assume. I
> don't know what I should  do. Could you please help me?

Well, the thing about wal_keep_segments is that there is no guaranteed
safe value.  If you are trying to use it to protect streaming standby
servers then the better modern solution is to have the standbys use
replication slots, so the primary actually knows how much old WAL
they need.  On the other hand, if you're just concerned about archiving
then I don't think you need it at all; the archiving mechanism doesn't
need any help to ensure that WAL doesn't get recycled before it's
archived.

Or in short: I think the correct setting for wal_keep_segments is
zero.  There are generally better ways to do what it does.

regards, tom lane




Re: Postgres upgrade 12 - issues with OIDs

2021-05-09 Thread Venkata B Nagothi
On Sat, 8 May 2021 at 1:47 pm, Laurenz Albe 
wrote:

> On Sat, 2021-05-08 at 13:37 +1000, Venkata B Nagothi wrote:
> > We are thinking to upgrade to PG 11 instead so that we can avoid doing
> ALTER TABLE.. SET WITHOUT OIDs.
> >  Does that makes sense ? Please advise if there are any gotchas !
>
> It makes sense, but it means that you will have to face the same problem
> later.
> However, for upgrading from v11 with little down time you may be able to
> use
> logical replication.


Yes, we will have a lot of time to deal with the OID problem later, good
thing is we will be out of 9.5 with less trouble. Hopefully we will be on a
better replication architecture soon which will make it much easier for us.


>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>
> --

Regards,

Venkata B N
Database Consultant


Re: Issue in PG start

2021-05-09 Thread Laurenz Albe
On Sat, 2021-05-08 at 05:14 +, sivapostg...@yahoo.com wrote:
> Yesterday [07th May] morning when we switched on the computer and 
> subsequently PGAdmin, we got the message following message
> FATAL: the database system is starting up

You will have to wait until startup is completed.

Either you didn't shut down PostgreSQL cleanly, or some server process
crashed.  The log should tell you which of the two happened.

Did you set "checkpoint_timeout" to a high value?  That will make the
startup process potentially take longer to recover.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com