race: concurrent charm deployments corrupts deployments

Bug #1067979 reported by Dave Cheney
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Dimiter Naydenov

Bug Description

lucky(~/src/launchpad.net/juju-core) % juju deploy -n10 mysql &
[1] 4586
lucky(~/src/launchpad.net/juju-core) % juju deploy -n10 mysql mysql-1 &
[2] 4592
lucky(~/src/launchpad.net/juju-core) % error: cannot add charm: cannot add charm "cs:precise/mysql-8": E11000 duplicate key error index: juju.charms.$_id_ dup key: { : "cs:precise/mysql-8" }

[2]+ Exit 1 juju deploy -n10 mysql mysql-1

Related branches

summary: - race: concurrent charm deployments corrupts both deployments
+ race: concurrent charm deployments corrupts deployments
Changed in juju-core:
milestone: 1.9.1 → 1.9.2
Changed in juju-core:
milestone: 1.9.2 → 1.9.3
Changed in juju-core:
milestone: 1.9.3 → 1.9.4
Revision history for this message
Dave Cheney (dave-cheney) wrote :

Still an issue

lucky(~/src/launchpad.net/juju-core) % juju deploy -n7 wordpress &
[1] 12085
lucky(~/src/launchpad.net/juju-core) % juju deploy -n7 wordpress wp-1 &
[2] 12089
lucky(~/src/launchpad.net/juju-core) % error: cannot add charm: cannot add charm "cs:precise/wordpress-9": E11000 duplicate key error index: juju.charms.$_id_ dup key: { : "cs:precise/wordpress-9" }

Changed in juju-core:
milestone: 1.9.4 → none
Revision history for this message
Dave Cheney (dave-cheney) wrote :

This is still an issue at rev 827

lucky(~/src/launchpad.net/juju-core) % juju deploy -n10 mysql a & juju deploy -n10 mysql b &
[1] 3537
[2] 3538
lucky(~/src/launchpad.net/juju-core) % error: cannot add charm: cannot add charm "cs:precise/mysql-14": E11000 duplicate key error index: juju.charms.$_id_ dup key: { : "cs:precise/mysql-14" }

[1]- Exit 1 juju deploy -n10 mysql a

Changed in juju-core:
status: Confirmed → Triaged
Curtis Hovey (sinzui)
tags: added: deploy
Curtis Hovey (sinzui)
tags: added: race-condition
Curtis Hovey (sinzui)
tags: added: test-needed
Revision history for this message
William Reade (fwereade) wrote :

Dimitern, assigning this to you because I suspect you've fixed it. When you get back from holiday, please verify and update as appropriate.

Changed in juju-core:
assignee: nobody → Dimiter Naydenov (dimitern)
Revision history for this message
Dimiter Naydenov (dimitern) wrote :

Nope, it's not fixed - I can reproduce it on latest trunk (r2259) using this script:

#!/bin/bash

juju switch local
juju bootstrap --upload-tools
juju deploy -n7 wordpress &
juju deploy -n7 wordpress wp1 &
juju status

I'm looking into it now.

Changed in juju-core:
status: Triaged → In Progress
milestone: none → 1.17.1
milestone: 1.17.1 → 1.17.2
Revision history for this message
Dimiter Naydenov (dimitern) wrote :

I'm ready to propose the branch with the fix. Running the script above now produces this:

local -> local
[sudo] password for dimitern:
Logging to /home/dimitern/.juju/local/log/cloud-init-output.log on remote host
Fetching tools: wget --no-verbose -O $bin/tools.tar.gz 'http://10.0.3.1:8040/tools/releases/juju-1.17.1.1-saucy-amd64.tgz'
Starting MongoDB server (juju-db-dimitern-local)
Bootstrapping Juju machine agent
Starting Juju machine agent (juju-agent-dimitern-local)
environment: local
machines:
  "0":
    agent-state: pending
    dns-name: localhost
    instance-id: localhost
    series: saucy
services: {}
Added charm "cs:precise/wordpress-21" to the environment.
ERROR charm "cs:precise/wordpress-21" already uploaded

We catch the race before it happens and report it to the user.

Changed in juju-core:
milestone: 1.17.2 → 2.0
milestone: 2.0 → 1.18.0
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 1.18.0 → 1.17.2
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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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