Navigation Menu

Skip to content

Commit

Permalink
Join to the cluster before absorb
Browse files Browse the repository at this point in the history
Conflicts:
	bin/droonga-engine-join
  • Loading branch information
piroor committed Jan 16, 2015
1 parent 3cb9997 commit 36be4f6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/droonga/command/remote.rb
Expand Up @@ -192,14 +192,14 @@ def join_as_replica
log("other_hosts = #{other_hosts}")
return if other_hosts.empty?

@serf.role = NodeMetadata::Role::ABSORB_DESTINATION

# restart self with the fetched catalog.
SafeFileWriter.write(Path.catalog) do |output, file|
output.puts(JSON.pretty_generate(@catalog))
@service_installation.ensure_correct_file_permission(file)
end

absorb_data if should_absorb_data?

log("joining to the cluster: update myself")

CatalogModifier.modify do |modifier, file|
Expand All @@ -209,6 +209,10 @@ def join_as_replica
end

@serf.join(*other_hosts)

absorb_data if should_absorb_data?

@serf.role = nil
end

def replica_hosts
Expand Down

0 comments on commit 36be4f6

Please sign in to comment.