add index on juju.relationscopes

Bug #1676297 reported by Junien Fridrick
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Ian Booth

Bug Description

Hi,

I was looking into our jujud/mongodb resources issues at the end of last week when I spotted a bunch of similar COLLSCANs, that sometimes got run ~1000 times / min, for example :

Mar 24 04:19:13 juju-4da59b22-9710-4e69-840a-be49ee864a97-machine-2 mongod.37017[10287]: [conn9272] command juju.relationscopes command: find { find: "relationscopes", filter: { key: { $regex: "^r#5#spark/3#provider#" }, departing: { $ne: true }, model-uuid: "282da984-55ea-4c54-832d-dc1f57c4afcb" }, skip: 0 } planSummary: COLLSCAN keysExamined:0 docsExamined:8717 cursorExhausted:1 keyUpdates:0 writeConflicts:0 numYields:68 nreturned:1 reslen:387 locks:{ Global: { acquireCount: { r: 138 } }, Database: { acquireCount: { r: 69 }, acquireWaitCount: { r: 2 }, timeAcquiringMicros: { r: 20436 } }, Collection: { acquireCount: { r: 69 } } } protocol:op_query 109ms

I spoke to axw, and he said that "those queries happen when workers in juju start watching relations". We ended up adding the following index :

db.relationscopes.createIndex({"key": 1, "departing": 1, "model-uuid": 1})

I'm filing this bug to make sure we don't forget making juju add this index automatically.

Thanks !

Tags: canonical-is
Junien Fridrick (axino)
tags: added: canonical-is
Changed in juju:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.2-beta3
Ian Booth (wallyworld)
Changed in juju:
assignee: nobody → Ian Booth (wallyworld)
status: Triaged → In Progress
Revision history for this message
Anastasia (anastasia-macmood) wrote :

PR against develop (2.2): https://github.com/juju/juju/pull/7249

Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
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.