Skip to content
Browse files

Merge branch 'master' into ds-110

  • Loading branch information...
2 parents a25efe9 + 562f1da commit b4fb9349999defa046d3525530eb96f53cdfab84 @stuhood stuhood committed Mar 26, 2012
Showing with 14 additions and 4 deletions.
  1. +5 −1 lib/gizzard/commands.rb
  2. +3 −2 lib/gizzard/nameserver.rb
  3. +6 −1 lib/gizzmo.rb
View
6 lib/gizzard/commands.rb
@@ -238,7 +238,11 @@ def down(id, depth = 0)
class ReloadCommand < Command
def run
if global_options.force || ask
- manager.reload_config
+ if command_options.fast
+ manager.reload_updated_forwardings
+ else
+ manager.reload_config
+ end
else
STDERR.puts "aborted"
end
View
5 lib/gizzard/nameserver.rb
@@ -85,7 +85,8 @@ def canonical_shard_id_map(base_prefix = "shard", table_id = nil, enum = nil)
class Nameserver
DEFAULT_PORT = 7920
DEFAULT_RETRIES = 10
- MAX_ATTEMPT_SECS = 10
+ MIN_ATTEMPT_SECS = 10
+ MAX_ATTEMPT_SECS = 30
PARALLELISM = 10
attr_reader :hosts, :logfile, :dryrun, :framed
@@ -240,7 +241,7 @@ def with_retry
STDERR.puts "\nException: #{e.class}: #{e.description rescue "(no description)"}"
STDERR.puts "Retrying #{times} more time#{'s' if times > 1}..." if times > 0
times -= 1
- sleep_time = MAX_ATTEMPT_SECS / [times, 1].max
+ sleep_time = [MIN_ATTEMPT_SECS, MAX_ATTEMPT_SECS / [times, 1].max].max
(times < 0) ? raise : (sleep(sleep_time); retry)
end
View
7 lib/gizzmo.rb
@@ -288,10 +288,15 @@ def add_template_opts(subcommand_options, opts)
opts.banner = "Usage: #{zero} info SHARD_ID [MORE SHARD_IDS...]"
separators(opts, DOC_STRINGS["info"])
end,
+
'reload' => OptionParser.new do |opts|
- opts.banner = "Usage: #{zero} reload"
+ opts.banner = "Usage: #{zero} reload [--fast]"
separators(opts, DOC_STRINGS["reload"])
+ opts.on("--fast", "Reload only the entries that have been updated since the last reload.") do
+ subcommand_options.fast = true
+ end
end,
+
'drill' => OptionParser.new do |opts|
opts.banner = "Usage: #{zero} drill SIGNATURE"
separators(opts, DOC_STRINGS["drill"])

0 comments on commit b4fb934

Please sign in to comment.
Something went wrong with that request. Please try again.