Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-10726

Active proxy inefficiently processes ids from proxy_history if the itemids are removed from configuration but values are still in unsent buffer

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 2.4.8
    • Proxy (P), Server (S)
    • Tested on 2.4.7, supposedly affects all other branches. RHEL 6.7

      Steps to visibly reproduce the issue

      1. Setup: Zabbix server, active proxy, agent
      2. Set the agent to be monitored by active proxy. Ideally if that is a test setup where the proxy does not monitor other hosts.
      3. Open two parallel SSH sessions to proxy host where one session continuously displays amount of items still unsent to Zabbix server in the proxy buffer.
      4. Command to display the values.
        while true; do mysql zabbix_proxy -sNe "select max(id)-(select nextid from ids where table_name ='proxy_history' limit 1) from proxy_history";sleep 1; done
        
      5. Import the attached Zabbix agent load test template to server.
      6. Link the template to the host monitored by proxy.
      7. Reload the proxy configuration cache by running
        zabbix_proxy -R config_cache_reload
      8. Watch the items unsent to Zabbix server. Normally there should be 0 items but occasionally some values may appear in the list.
      9. Stop communication between proxy and server by e.g. closing the firewall port (or optionally stopping Zabbix server).
      10. Watch as the amount of unsent items on the proxy rapidly increases.
      11. Let it collect the data for around 5 minutes so that there is some data to process.
      12. Meanwhile Unlink and clear the template from the monitored test agent.
      13. Link some other small template, e.g. Template App OS Linux
      14. Wait until Zabbix server reloads configuration cache (by default in 60 seconds).
      15. Re-enable the communication between proxy and server.
      16. Watch as the amount of unsent items on the proxy rapidly decreases while the items are still in the proxy configuration cache. It attempts to clear the buffer by sending 1000 item ids multiple times per second even if the items do not exist on the server anymore.
      17. It is visible in the proxy log with DebugLevel=4 that it sends full chunks of collected data.
      18. Reload the proxy configuration cache by running zabbix_proxy -R config_cache_reload . At this moment proxy learns from the server that there are no more load test items in its cache.
      19. Watch as the amount of unsent items on the proxy decreases only by 1000 ids every second because the proxy scans 1000 ids but sends only the values of the items that still remain in the configuration cache for from those 1000 ids.
      20. The actual bug. In case from scanned 1000 ids there will be at least one item removed from the cache, the proxy data sender will send only the values for the items found in the cache and sleep for 1 second thus the buffer may clear very slowly even though there are much more values to send in the buffer.
      21. There is no way to speed up clearing of the backlog without losing the collected history. For this the proxy must be stopped and the following queries must be executed in proxy database:
        truncate table ids;
        truncate table proxy_history;
        
      22. After starting the proxy and configuration cache reload the unsent buffer will be 0 again.

            Unassigned Unassigned
            ingus.vilnis Ingus Vilnis
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: