Reviewed: https://review.opendev.org/c/openstack/neutron-vpnaas/+/943359 Committed: https://opendev.org/openstack/neutron-vpnaas/commit/5cf0516b784406ad556b1ba7c2344ac8a91387fb Submitter: "Zuul (22348)" Branch: master
commit 5cf0516b784406ad556b1ba7c2344ac8a91387fb Author: ricolin <r...@vexxhost.com> Date: Wed Mar 5 09:03:40 2025 +0800 Use write connection for get_vpn_services_on_host The OVN IPSEC implementation requires write connection. And it will raise errors when try to bind routers with `Can't upgrade a READER transaction to a WRITER mid-transaction`. This alias both to write transation declear so no above error will raise. Closes-Bug: 2100911 Change-Id: I1f5ddbaae7b9a45382ee1307c13f26d346b03644 ** Changed in: neutron Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/2100911 Title: Neutron VPN agent fail with upgrade a READER transaction to a WRITER mid-transaction Status in neutron: Fix Released Bug description: We appears open DB read transaction in get_vpn_services_on_host from base_ipsec.py but later try to change to write transaction in ovn ipsec implementation (which calls create_router_to_agent_binding from vpn_agentschedulers_db.py) 2025-03-05 00:21:25.398 100 ERROR oslo_service.service [-] Error starting thread.: TypeError: Can't upgrade a READER transaction to a WRITER mid-transaction Traceback (most recent call last): File "/var/lib/openstack/lib/python3.10/site-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming res = self.dispatcher.dispatch(message) File "/var/lib/openstack/lib/python3.10/site-packages/oslo_messaging/rpc/dispatcher.py", line 309, in dispatch return self._do_dispatch(endpoint, method, ctxt, args) File "/var/lib/openstack/lib/python3.10/site-packages/oslo_messaging/rpc/dispatcher.py", line 229, in _do_dispatch result = func(ctxt, **new_args) File "/var/lib/openstack/lib/python3.10/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 998, in wrapper return fn(*args, **kwargs) File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/services/vpn/service_drivers/base_ipsec.py", line 77, in get_vpn_services_on_host vpnservices = self._get_agent_hosting_vpn_services( File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/services/vpn/service_drivers/ovn_ipsec.py", line 104, in _get_agent_hosting_vpn_services self.service_plugin.auto_schedule_routers(context, agent) File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/db/vpn/vpn_agentschedulers_db.py", line 371, in auto_schedule_routers return self.vpn_scheduler.auto_schedule_routers( File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/scheduler/vpn_agent_scheduler.py", line 83, in auto_schedule_routers self._bind_routers(context, plugin, target_routers, vpn_agent) File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/scheduler/vpn_agent_scheduler.py", line 95, in _bind_routers plugin.create_router_to_agent_binding( File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/db/vpn/vpn_agentschedulers_db.py", line 186, in create_router_to_agent_binding with db_api.CONTEXT_WRITER.using(context): File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__ return next(self.gen) File "/var/lib/openstack/lib/python3.10/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 1042, in _transaction_scope with current._produce_block( File "/var/lib/openstack/lib/python3.10/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 693, in _produce_block self._writer() File "/var/lib/openstack/lib/python3.10/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 707, in _writer raise TypeError( To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/2100911/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp