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

Missing ordering in multiple SQL requests


    • Sprint 67 (Aug 2020), Sprint 68 (Sep 2020), Sprint 69 (Oct 2020), Sprint 70 (Nov 2020), Sprint 71 (Dec 2020), Sprint 72 (Jan 2021), Sprint 73 (Feb 2021), Sprint 74 (Mar 2021), Sprint 75 (Apr 2021), Sprint 76 (May 2021), Sprint 77 (Jun 2021), Sprint 78 (Jul 2021), Sprint 79 (Aug 2021)
    • 1.5

      In many cases data set ordering is random because there is no ordering set in SQL requests. This mostly causes problems on PostgreSQL DB as sort order is not consistent there if ordering clause is not used in SQL queries.

      Steps to reproduce for Graph prototype widget:

      1. Create graph prototype (on hostA) with two items (one item prototype from hostA and one item from hostB).
      2. Create dashboard with graph prototype widget and select previously created graph prototype as data source for a widget (also make sure that widget is set to dynamic mode).
      3. Observe that sometimes widget name was hostB prefix due to the lack of sorting in graph API.

      It seems that error is caused by the lack of the ordering (ORDER BY sortorder) in the graphs_items selection SQL (CGraphGeneral::addRelatedObjects). Later ids are used to perform host.get API request where hosts are ordered by hostid field. In the end first host is used to create widget prefix. This causes invalid behavior where random host name is used as prefix.

      Steps to reproduce Tags sorting in widget Problem by severity:

      1. Create widget Problems by severity
      2. Add tags as:
        ['name' => 'Service', 'operator' => 'Contains', 'value' => 'abc'],
        ['name' => 'Alpha', 'operator' => 'Contains', 'value' => ''],
        ['name' => 'Delta', 'operator' => 'Equals', 'value' => 'd']
      3. Save widget and dashboard
      4. Check tags order
      5. Save widget and dashboard again and check tags order
      6. Observe that tags order is different each time.


      The same can happen in places:

      Discovery rule -> Overrides -> Operations ordering (the order in which the operations were added should be left here)

      Discovery rule -> Overrides -> Operations Trigger prototype -> Tags

      Tags sorting in widget Graph in Problems tab

      Interfaces sorting in item form is different from sorting on host.

        1. after.txt
          57 kB
        2. before.txt
          57 kB

            gcalenko Gregory Chalenko
            natalja.zabbix Natalja Romancaka
            Team C
            0 Vote for this issue
            9 Start watching this issue