Reimplement concurrency to be per process

Previously, concurrently was implemented per
storage server type as a global setting.

This commit reimplements concurrency to make it
per process (replicator/updater/reaper)

This is intended to allow the end user more
flexibility over how they implement their
swift cluster.
This commit is contained in:
François Charlier 2012-06-04 11:11:16 -07:00 committed by Dan Bode
parent 01ecb029cd
commit 18365a7c43
5 changed files with 26 additions and 8 deletions

@ -14,10 +14,9 @@ define swift::storage::server(
$mount_check = 'false',
$user = 'swift',
$workers = '1',
$concurrency = $::processorcount,
$replicator_concurrency = $concurrency,
$updater_concurrency = $concurrency,
$reaper_concurrency = $concurrency,
$replicator_concurrency = $::processorcount,
$updater_concurrency = $::processorcount,
$reaper_concurrency = $::processorcount,
# this parameters needs to be specified after type and name
$config_file_path = "${type}-server/${name}.conf"
) {

@ -68,7 +68,6 @@ describe 'swift::storage::server' do
:devices => '/tmp/foo',
:user => 'dan',
:mount_check => true,
:concurrency => 5,
:workers => 7,
:pipeline => ['foo']
}.each do |k,v|
@ -94,7 +93,24 @@ describe 'swift::storage::server' do
end.should raise_error(Puppet::Error, /is not an Array/)
end
end
describe "when replicator_concurrency is set" do
let :params do req_params.merge({:replicator_concurrency => 42}) end
it { should contain_file(fragment_file) \
.with_content(/\[#{t}-replicator\]\nconcurrency\s*=\s*42\s*$/m)
}
end
if t != 'account'
describe "when updater_concurrency is set" do
let :params do req_params.merge({:updater_concurrency => 73}) end
it { should contain_file(fragment_file) \
.with_content(/\[#{t}-updater\]\nconcurrency\s*=\s*73\s*$/m)
}
end
else
describe "when reaper_concurrency is set" do
let :params do req_params.merge({:reaper_concurrency => 4682}) end
it { should contain_file(fragment_file) \
.with_content(/\[#{t}-reaper\]\nconcurrency\s*=\s*4682\s*$/m)
}
end
end

@ -6,7 +6,6 @@ mount_check = <%= mount_check %>
user = <%= user %>
log_facility = LOG_LOCAL2
workers = <%= workers %>
concurrency = <%= concurrency %>
[pipeline:main]
pipeline = <%= pipeline.to_a.join(' ') %>
@ -15,7 +14,9 @@ pipeline = <%= pipeline.to_a.join(' ') %>
use = egg:swift#account
[account-replicator]
concurrency = <%= replicator_concurrency %>
[account-auditor]
[account-reaper]
concurrency = <%= reaper_concurrency %>

@ -6,7 +6,6 @@ mount_check = <%= mount_check %>
user = <%= user %>
log_facility = LOG_LOCAL2
workers = <%= workers %>
concurrency = <%= concurrency %>
[pipeline:main]
pipeline = <%= pipeline.to_a.join(' ') %>
@ -15,8 +14,10 @@ pipeline = <%= pipeline.to_a.join(' ') %>
use = egg:swift#container
[container-replicator]
concurrency = <%= replicator_concurrency %>
[container-updater]
concurrency = <%= updater_concurrency %>
[container-auditor]

@ -6,7 +6,6 @@ mount_check = <%= mount_check %>
user = <%= user %>
log_facility = LOG_LOCAL2
workers = <%= workers %>
concurrency = <%= concurrency %>
[pipeline:main]
pipeline = <%= pipeline.to_a.join(' ') %>
@ -15,7 +14,9 @@ pipeline = <%= pipeline.to_a.join(' ') %>
use = egg:swift#object
[object-replicator]
concurrency = <%= replicator_concurrency %>
[object-updater]
concurrency = <%= updater_concurrency %>
[object-auditor]