powa-team/powa

I disabled POWA but there is still a warning in the logs every 5min

rostamiani opened this issue · 10 comments

I was using POWA last year and it was perfect. But it's replaces by other tools right now. But there is a warnings in postgres logs every 5 minutes!
I had installed POWA as a remote server. I tried to disable POWA by setting frequency to -1 for all databases in powa_servers table but the warning still exists!
Where should I look for?

This is the warning:

WARNING:  powa_take_snapshot(0): function "pg_track_settings_snapshot_rds" failed
:
                      state  : 23502
                      message: null value in column "ts" violates not-null constraint
                      detail : Failing row contains (0, null, session_preload_libraries, 0, 489813, null, t).
                      hint   : 
                      context: SQL statement "WITH rds AS (
                SELECT * FROM public.pg_track_settings_rds_src(_srvid)
            ),
            dropped AS (
                SELECT s.ts, l.setdatabase, l.setrole, l.name
                FROM public.pg_track_db_role_settings_list l
                LEFT JOIN rds s ON (
                    s.setdatabase = l.setdatabase
                    AND s.setrole = l.setrole
                    AND s.name = l.name
                )
                WHERE l.srvid = _srvid
                    AND s.setdatabase IS NULL
                    AND s.setrole IS NULL
                    AND s.name IS NULL
            ),
            mark_dropped AS (
                INSERT INTO public.pg_track_db_role_settings_history
rjuju commented

Hi,

Did you reload the powa-collector? I don't think it will automatically check for updated config. You can do so with the reload button in the UI, or sending a SIGHUP to the powa-collector daemon. You could also alternatively stop the powa-collector daemon if you don't use powa at all anymore.

Also, is powa in the shared_preload_library of your remote server(s)?

wierd!
Powa collector is stopped for 9 month!

$ systemctl status powa-collector.service 
● powa-collector.service - PoWA collector service.
     Loaded: loaded (/etc/systemd/system/powa-collector.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2021-06-27 11:31:30 +0430; 9 months 1 days ago
   Main PID: 1043 (code=exited, status=1/FAILURE)

Warning: some journal files were not opened due to insufficient permissions.
rjuju commented

And is powa in the shared_preload_library of your remote server(s)?

@rjuju
Yes, It's there
Is this makes the problem?

rjuju commented

It's not a problem, but it means that the remote server is also acting as a local repository since it will automatically start a bgworker for local snapshot collection.

Having powa in shared_preload_library is only needed if you want a local setup. You can remove it, but it needs a restart. Alternatively you could configure powa.retention setting to -1 (only a reload is required), which will disable local collection until it's removed from shared_preload_libraries.

I have a powa database with powa extension on local. I don't know what it means but dropping powa extension from powa db caused this error:

ERROR:  function public.powa_take_snapshot() does not exist at character 8

Something is getting powa statics. maybe somewhere else. some other powa collector?
Am I right?
How can I find it?

rjuju commented

As I said the function is executed by the bgworker. The bgworker is C code that's loaded with shared_preload_library, so dropping the extension doesn't prevent the bgworker from trying to do it's job, it just makes it fail directly.

You need to either remove powa from shared_preload_libraries and restart your instance, or configure powa.frequency to -1 and reload the conf.

Where should I config retension?
I already set frequency in powa_servers table to -1 but this didn't disabled powa. Should I ser retention in this table to -1 too?

rjuju commented

powa_servers table is only for the remote mode. This one is for the local mode, so it has to be configured on the remote server, in the postgresql.conf, or ALTER SYSTEM, depending on what you usually use.

rjuju commented

@rostamiani did this solve your problem?