Skip to content

Commit

Permalink
Merge branch 'master' into CHEF-1781
Browse files Browse the repository at this point in the history
  • Loading branch information
joewilliams committed Oct 20, 2010
2 parents e75432e + b78f5ba commit 973d8a6
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING
Expand Up @@ -13,4 +13,4 @@ Opscode Open Source Ticket Tracking System:

How to contribute to Chef:

* http://wiki.opscode.com/display/opscode/Contributing
* http://wiki.opscode.com/display/chef/How+to+Contribute
2 changes: 1 addition & 1 deletion chef-server-api/lib/chef-server-api/version.rb
@@ -1,3 +1,3 @@
module ChefServerApi
VERSION = '0.9.10.rc.3'
VERSION = '0.9.10'
end
2 changes: 1 addition & 1 deletion chef-server-webui/lib/chef-server-webui/version.rb
@@ -1,3 +1,3 @@
module ChefServerWebui
VERSION = '0.9.10.rc.3'
VERSION = '0.9.10'
end
2 changes: 1 addition & 1 deletion chef-server/lib/chef-server/version.rb
Expand Up @@ -17,5 +17,5 @@
#

module ChefServer
VERSION = '0.9.10.rc.3'
VERSION = '0.9.10'
end
2 changes: 1 addition & 1 deletion chef-solr/lib/chef/solr/version.rb
@@ -1,5 +1,5 @@
class Chef
class Solr
VERSION = '0.9.10.rc.3'
VERSION = '0.9.10'
end
end
2 changes: 1 addition & 1 deletion chef/lib/chef/version.rb
Expand Up @@ -17,5 +17,5 @@

class Chef
CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__)))
VERSION = '0.9.10.rc.3'
VERSION = '0.9.10'
end
32 changes: 25 additions & 7 deletions features/support/couchdb_replicate.rb
Expand Up @@ -77,13 +77,31 @@ def replicate_dbs(replication_specs, delete_source_dbs = false)
rescue RestClient::ResourceNotFound => e
end

begin
# Other tasks may have created the database in the mean time, so we're going to
# ignore errors of re-creating the target database.
Chef::Log.debug("Creating #{target_db}")
RestClient.put(target_db, nil)
rescue RestClient::PreconditionFailed => e
Chef::Log.debug("In creating #{target_db}, got #{e}; ignoring it, as something else might have created it")
# Sometimes Couch returns a '412 Precondition Failed' when creating a database,
# via a PUT to its URL, as the DELETE from the previous step has not yet finished.
# This condition disappears if you try again. So here we try up to 10 times if
# PreconditionFailed occurs. See
# http://tickets.opscode.com/browse/CHEF-1788 and
# http://tickets.opscode.com/browse/CHEF-1764.
#
# According to https://issues.apache.org/jira/browse/COUCHDB-449, setting the
# 'X-Couch-Full-Commit: true' header on the DELETE should work around this issue,
# but it does not.
db_created = nil
max_tries = 10
num_tries = 1
while !db_created && num_tries <= max_tries
begin
Chef::Log.debug("Creating #{target_db}")
RestClient.put(target_db, nil)
db_created = true
rescue RestClient::PreconditionFailed => e
Chef::Log.error("In creating #{target_db} try #{num_tries}/#{max_tries}, got #{e}; try again")
if num_tries <= max_tries
sleep 0.25
end
end
num_tries += 1
end

Chef::Log.debug("Replicating #{source_db} to #{target_db} using bulk (batch) method")
Expand Down

0 comments on commit 973d8a6

Please sign in to comment.