Juju writes to mongo without an actual change occurring

Bug #1345832 reported by Ian Booth
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Andrew Wilkins
1.20
Fix Released
High
Andrew Wilkins

Bug Description

This issue was first mentioned in bug 1344940.

Juju is constantly writing to Mongo been though there's been no change which would warrant a database update being required. Hence the writes are no-ops but cause I/O starvation and fill txn logs etc.

<snip>
the problem is 1000s of writes without an actual change, ie. the transaction log is full of these

    stateServers:apiHostPorts update {u'$set': {u'apihostports': [[{u'networkscope': u'public', u'addresstype': u'hostname', u'port': 17070, u'value': u'pbdpm.cluster.mallards'}, {u'networkscope': u'local-cloud',\
 u'addresstype': u'ipv4', u'port': 17070, u'value': u'192.168.9.74'}, {u'networkscope': u'local-machine', u'addresstype': u'ipv4', u'port': 17070, u'value': u'127.0.0.1'}, {u'networkscope': u'local-machine', u'ad\
dresstype': u'ipv6', u'port': 17070, u'value': u'::1'}, {u'addresstype': u'ipv6', u'port': 17070, u'value': u'fe80::225:90ff:fe4c:e79e'}]]}}
2014/07/19-15:41:13 applied
    stateServers:apiHostPorts update {u'$set': {u'apihostports': [[{u'networkscope': u'public', u'addresstype': u'hostname', u'port': 17070, u'value': u'pbdpm.cluster.mallards'}, {u'networkscope': u'local-cloud',\
 u'addresstype': u'ipv4', u'port': 17070, u'value': u'192.168.9.74'}, {u'networkscope': u'local-machine', u'addresstype': u'ipv4', u'port': 17070, u'value': u'127.0.0.1'}, {u'networkscope': u'local-machine', u'ad\
dresstype': u'ipv6', u'port': 17070, u'value': u'::1'}, {u'addresstype': u'ipv6', u'port': 17070, u'value': u'fe80::225:90ff:fe4c:e79e'}]]}}

we should not be writing to the database when there is no actual change.

here's a pretty print of the last 100 txns in the transaction collection.

http://paste.ubuntu.com/7820254/

<snip>

Andrew Wilkins (axwalk)
Changed in juju-core:
status: Triaged → In Progress
assignee: nobody → Andrew Wilkins (axwalk)
tags: added: cloud-installer landscape
Ian Booth (wallyworld)
Changed in juju-core:
milestone: 1.20.2 → 1.21-alpha1
status: In Progress → Fix Committed
Revision history for this message
Andrew Wilkins (axwalk) wrote :

The change I made doesn't actually fix the issue, because the readonly assertion that I added to prevent races also spams the oplog. There's only one caller at the moment, which I'm pretty sure I can modify to elide no-op calls.

Changed in juju-core:
status: Fix Committed → In Progress
Revision history for this message
Andrew Wilkins (axwalk) wrote :

Another partial fix for master: https://github.com/juju/juju/pull/389/files
There's more work for master, because of some broken host-port sorting code relating to on-going IPv6 work. Cherry picking just these commits should be good enough to fix 1.20 though (I'll confirm and propose shortly).

Andrew Wilkins (axwalk)
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
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.