network/subnet resources cannot be read and written separated

Bug #1840638 reported by zhanghao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
zhanghao

Bug Description

openstack environment: 1 controller 1 compute(install mariadb)
neutron.conf
[database]
connection = mysql+pymysql://neutron:***@controller/neutron
slave_connection = mysql+pymysql://neutron: ***@compute/neutron

create network(name=net10)、subnet(name=subnet10)、port(name=port01) in controller node.

sync controller node database to compute node.

update network.name=test_net10、subnet.name=test_subnet10、port.name=test_port01 in compute node database.

neutron port-show PORT_ID name:test_port01
neutron net-show NET_ID name:net10
neutron subnet-show SUBNET_ID name:subnet10

When slave_connection is configured in neutron.conf, executing the 'neutron port-show' command will read the port information from the slave database nodes, but the network/subnet will not be able to read the information from the slave database nodes.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/677166

Changed in neutron:
assignee: nobody → zhanghao (zhanghao2)
status: New → In Progress
Revision history for this message
Swaminathan Vasudevan (swaminathan-vasudevan) wrote :

The Bug description is not detailed enough, or may be I am not understanding it completely.
What do you mean slave_connection in neutron.conf.
How to reproduce this issue?

Changed in neutron:
importance: Undecided → Medium
Revision history for this message
zhanghao (zhanghao2) wrote :

I add the bug description and how to reproduce it.

description: updated
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello Zhanghao:

You are talking about having problems to connect to the slave DB connection, but the reproduction method does not use an slave DB, actually is the same as the primary one.

Regards.

Revision history for this message
zhanghao (zhanghao2) wrote :

Hi Rodolfo:
you are right,The reason is that writer context should be replaced with reader context when showing network or subnet detail, if we want to use slave DB.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/677166
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=4afba466e04fb74c8915f9f1b40686008b2503fb
Submitter: Zuul
Branch: master

commit 4afba466e04fb74c8915f9f1b40686008b2503fb
Author: zhanghao <email address hidden>
Date: Sun Nov 17 20:17:35 2019 -0500

    Make network support read and write separation

    When 'slave_connection' is configured in neutron.conf, executing
    the 'neutron port-show' command will read the port information from
    the slave database nodes, but the network will not be able to read
    the information from the slave database nodes.

    Change-Id: I572cecace1016740584757e5f926d246ead2d9a0
    Closes-Bug: #1840638

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 16.0.0.0b1

This issue was fixed in the openstack/neutron 16.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.