Inconsistent logging of successful database reconnection across internal server processes

XMLWordPrintable

      During testing, it was observed that internal server processes in Zabbix behave inconsistently when reconnecting to the database after a failover.

      When a database node switch occurs, some internal processes produce the following sequence of logs:

      1. PGRES_FATAL_ERROR (from the old database connection)
      2. successful reconnection to another database node
      3. "database connection re-established"

      At the same time, other internal processes show a different behavior:

      1. PGRES_FATAL_ERROR is logged
      2. reconnection to another database node happens successfully
      3. no "database connection re-established" log is produced

      As a result, from an user perspective, it may look like some processes failed or did not recover correctly, even though they continue working normally.

      Steps to reproduce:

      1. Configure a Zabbix Server with database failover (e.g. PostgreSQL primary/replica).
      2. Start the server and ensure all internal processes are running.
      3. Trigger a database node switch.
      4. Observe server logs during and after the failover.

      Result:

      • Some internal processes log "database connection re-established" after reconnection.
      • Other processes reconnect successfully but do not log this message.
      • All processes may log PGRES_FATAL_ERROR originating from the previous database node.

      Expected: Logging of successful database reconnection should be consistent across all internal server processes. If a process logs a database connection error related to a lost connection and then successfully reconnects to another database node, the successful reconnection should be logged in

            Assignee:
            Zabbix Development Team
            Reporter:
            Deniss Ponomarenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 0.5h
                0.5h