[ZBX-24514] ZBX-23685 makes impossible to stop the Server node running under PCS (Corosync/Pacemaker) with RO database Created: 2024 May 21  Updated: 2024 Oct 09  Resolved: 2024 Aug 13

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 6.0.29, 6.4.14, 7.0.0rc1
Fix Version/s: 6.0.33rc1, 6.4.18rc1, 7.0.2rc1, 7.2.0alpha1

Type: Problem report Priority: Critical
Reporter: Edgar Akhmetshin Assignee: Vladislavs Sokurenko
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 6h
Original Estimate: Not Specified

Issue Links:
Causes
caused by ZBX-23685 HA manager stops and Zabbix server is... Closed
Duplicate
Team: Team A
Sprint: Prev.Sprint, S24-W28/29
Story Points: 0.5

 Description   

Steps to reproduce:

  1. Configure 2 nodes Server cluster with PCS(Corosync/Pacemaker) with external database cluster which has RW/RO roles.
  2. Enable Native HA to have ability to stop on RO database, while Native HA will not be used at all.
  3. Make local to the node DC database Read Only.

Result:
After ZBX-23685 HA manager keeps running endlessly preventing from switchover, Server is not stopped and PCS (Pacemaker/Corosync) is not triggered.

Expected:
Behaviour should be configurable (what to do on RO database: stop or continue attempts) and mostly outside of the Native HA configuration, since currently Native HA cannot do VirtualIP, database quorum consistency checks, own quorum, and the only useful feature for complex cluster was an ability to stop the service on RO database. Also Server cannot provide any of the status pages, like do other tools, so interoperability of the PCS/haproxy is limited or requires custom scripting.



 Comments   
Comment by Edgar Akhmetshin [ 2024 May 29 ]

Using Docker:

git clone https://github.com/zabbix/zabbix-docker.git
cd zabbix-docker
git checkout 6.0
git pull
git clean -fdx
git reset --hard
docker-compose -f docker-compose_v3_alpine_pgsql_latest.yaml up -d
docker exec -ti zabbix-docker-postgres-server-1 psql -U zabbix -d zabbix

Put in RO mode database:

zabbix=#  ALTER SYSTEM SET default_transaction_read_only TO on;
zabbix=#  SELECT pg_reload_conf();
zabbix=#  SHOW default_transaction_read_only;

Check the logs:

docker logs -f zabbix-docker-zabbix-server-1;
WARNING:  there is no transaction in progress
   240:20240529:190500.256 database is read-only: waiting for 10 seconds
   246:20240529:190500.326 [Z3009] query failed due to read-only transaction: [0] PGRES_FATAL_ERROR:ERROR:  cannot execute INSERT in a read-only transaction

WARNING:  there is no transaction in progress
   246:20240529:190500.346 database is read-only: waiting for 10 seconds
   228:20240529:190500.844 [Z3005] query failed: [0] PGRES_FATAL_ERROR:ERROR:  cannot execute SELECT FOR UPDATE in a read-only transaction
 [select ha_nodeid,name,status,lastaccess,address,port,ha_sessionid from ha_node order by ha_nodeid for update]
   228:20240529:190501.845 [Z3005] query failed: [0] PGRES_FATAL_ERROR:ERROR:  cannot execute SELECT FOR UPDATE in a read-only transaction
 [select ha_nodeid,name,status,lastaccess,address,port,ha_sessionid from ha_node order by ha_nodeid for update]
   228:20240529:190502.839 [Z3005] query failed: [0] PGRES_FATAL_ERROR:ERROR:  cannot execute SELECT FOR UPDATE in a read-only transaction
 [select ha_nodeid,name,status,lastaccess,address,port,ha_sessionid from ha_node order by ha_nodeid for update]
   228:20240529:190503.835 [Z3005] query failed: [0] PGRES_FATAL_ERROR:ERROR:  cannot execute SELECT FOR UPDATE in a read-only transaction
 [select ha_nodeid,name,status,lastaccess,address,port,ha_sessionid from ha_node order by ha_nodeid for update]
   244:20240529:190504.276 [Z3009] query failed due to read-only transaction: [0] PGRES_FATAL_ERROR:ERROR:  cannot execute INSERT in a read-only transaction

Same behaviour with NodeAddress and HANodeName set or not.

Comment by Vladislavs Sokurenko [ 2024 Jul 08 ]

Fixed in:

Comment by Martins Valkovskis [ 2024 Aug 13 ]

Updated documentation:

Generated at Wed Apr 30 06:43:23 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.