Ad Widget

Collapse

Upgrade to Zabbix 7.0 stuck on updating the 'sessions' table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jgodoy
    Junior Member
    • Jun 2024
    • 2

    #1

    Upgrade to Zabbix 7.0 stuck on updating the 'sessions' table

    Hi all,

    I'm trying to upgrade from Zabbix 6.2 to 7.0 (database is PostgreSQL 14), and the upgrade process gets stuck at 32% of database upgrade.
    Upon checking the long-running query, it turns out to be the following:

    Code:
    update sessions set secret=sessionid
    The total number of rows in the 'sessions' table is over 17M:

    zabbix=# select count(*) from sessions;
    count
    ----------
    17338665
    (1 row)
    The great majority of these rows (about 16M) are for a single user (userid=15):

    Code:
    zabbix=# select count(*) as count, userid from sessions group by userid;
    count | userid
    ----------+--------
    4 | 1
    550155 | 2
    2 | 3
    10 | 6
    2 | 7
    13 | 11
    4 | 12
    6 | 13
    6 | 14
    16788145 | 15
    2 | 19
    7 | 27
    82 | 28
    1 | 47
    4 | 50
    77 | 57
    1 | 72
    3 | 78
    1 | 84
    5 | 85
    3 | 86
    10 | 87
    7 | 89
    2 | 93
    2 | 95
    4 | 97
    15 | 98
    10 | 100
    5 | 101
    4 | 102
    5 | 103
    2 | 104
    4 | 105
    3 | 106
    6 | 145
    2 | 158
    1 | 169
    1 | 170
    3 | 171
    2 | 174
    8 | 175
    7 | 178
    2 | 179
    13 | 184
    3 | 185
    1 | 186
    2 | 193
    2 | 194
    1 | 200
    1 | 202
    2 | 203
    2 | 208
    (52 rows)​
    This is a "grafana" user that is continually logging in.

    So my question is: is it safe to truncate this table prior to upgrading?
    I suspect the if I delete this user from Zabbix it will take even much longer (this will perform a "delete cascade" on 'sessions').

    Does anyone know what other approach could I try?

    Thank you!
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    #2
    I would try (after backups of course) deleting those sessions.

    Also fix the tool that creates massive amounts of (probably) API sessions without logging out.

    Markku

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #3
      Just remove that crap.. nothing happens from it.

      Comment

      Working...