Project

General

Profile

Actions

Bug #22879

closed

Too many "Policy Update Started" in event logs

Added by Nicolas CHARLES 11 months ago. Updated 11 months ago.

Status:
Released
Priority:
N/A
Category:
Web - Maintenance
Target version:
Severity:
Minor - inconvenience | misleading | easy workaround
UX impact:
I dislike using that feature
User visibility:
Operational - other Techniques | Rudder settings | Plugins
Effort required:
Priority:
89
Name check:
To do
Fix check:
Checked
Regression:
No

Description

On large instance, wa can be overwhelmed by the Policy Update Startedeventlog, especially with "alreadyPending="true"" details
The alreadyPending=true don't bring meaningful information there, and ought to be a simple log in debug in the webapp logs

As a result, it's nearly impossible to search in eventlog, and index is really huge.

Workaround: removing existing useless AutomaticStart event log

1/ delete the useless event logs:

delete from eventlog where eventtype = 'AutomaticStartDeployement' and data::text like '<entry><addPending %';

2/ reclam space and clean-up index. Be careful, a full vaccuum locks the table, which means that during the clean-up, no new event-log can be added. You should do that with rudder stopped if you event log table is big*.

vaccuum full eventlog;
  • to get metrics regarding tables size in Rudder, you can execute that SQL query:
WITH RECURSIVE pg_inherit(inhrelid, inhparent) AS
    (select inhrelid, inhparent
    FROM pg_inherits
    UNION
    SELECT child.inhrelid, parent.inhparent
    FROM pg_inherit child, pg_inherits parent
    WHERE child.inhparent = parent.inhrelid),
pg_inherit_short AS (SELECT * FROM pg_inherit WHERE inhparent NOT IN (SELECT inhrelid FROM pg_inherit))
SELECT table_schema
    , TABLE_NAME
    , row_estimate
    , pg_size_pretty(total_bytes) AS total
    , pg_size_pretty(index_bytes) AS INDEX
    , pg_size_pretty(toast_bytes) AS toast
    , pg_size_pretty(table_bytes) AS TABLE
  FROM (
    SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes
    FROM (
         SELECT c.oid
              , nspname AS table_schema
              , relname AS TABLE_NAME
              , SUM(c.reltuples) OVER (partition BY parent) AS row_estimate
              , SUM(pg_total_relation_size(c.oid)) OVER (partition BY parent) AS total_bytes
              , SUM(pg_indexes_size(c.oid)) OVER (partition BY parent) AS index_bytes
              , SUM(pg_total_relation_size(reltoastrelid)) OVER (partition BY parent) AS toast_bytes
              , parent
          FROM (
                SELECT pg_class.oid
                    , reltuples
                    , relname
                    , relnamespace
                    , pg_class.reltoastrelid
                    , COALESCE(inhparent, pg_class.oid) parent
                FROM pg_class
                    LEFT JOIN pg_inherit_short ON inhrelid = oid
                WHERE relkind IN ('r', 'p')
             ) c
             LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
  ) a
  WHERE oid = parent
) a
ORDER BY total_bytes DESC;

Files

clipboard-202306291457-mn14d.png (174 KB) clipboard-202306291457-mn14d.png François ARMAND, 2023-06-29 14:57

Related issues 1 (0 open1 closed)

Related to Rudder - Bug #23074: Generation not queued when one already startedReleasedVincent MEMBRÉActions
Actions

Also available in: Atom PDF