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:
The total number of rows in the 'sessions' table is over 17M:
The great majority of these rows (about 16M) are for a single user (userid=15):
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!
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
zabbix=# select count(*) from sessions;
count
----------
17338665
(1 row)
count
----------
17338665
(1 row)
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)
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!
nothing happens from it.
Comment