Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Fixed #317: regression in restart #345

Merged
merged 1 commit into from
Jan 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions deploy/lib/Help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,15 @@ def self.initcpf

def self.restart
<<-DOC.strip_heredoc
Usage: ml {env} restart [group] [options]
Usage: ml {env} restart [{groupname}|cluster] [options]

General options:
-v, [--verbose] # Verbose output

Restart the MarkLogic process in the given environment on each host in the
specified group. If no group is specified, restart the MarkLogic process
on each host in the group to which the target host belongs.
on each host in the group to which the target host belongs. Use 'cluster'
to restart all hosts within the cluster to which the target belongs.
DOC
end

Expand Down
10 changes: 6 additions & 4 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,16 @@ def execute_query(query, properties = {})
def restart
group = ARGV.shift
# Exclude any argument passed from command line.
if group.index("-") == 0
if group && group.index("-") == 0
group = nil
end

if group
logger.info "Restarting MarkLogic Server group #{group} on #{@hostname}"
if group && group == "cluster"
logger.info "Restarting MarkLogic Server cluster of #{@hostname}"
elsif group
logger.info "Restarting MarkLogic Server group #{group}"
else
logger.info "Restarting MarkLogic Server on #{@hostname}"
logger.info "Restarting MarkLogic Server group of #{@hostname}"
end
logger.debug "this: #{self}"
setup = File.read ServerConfig.expand_path("#{@@path}/lib/xquery/setup.xqy")
Expand Down
5 changes: 5 additions & 0 deletions deploy/lib/xquery/setup.xqy
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,11 @@ declare function setup:do-restart($group-name as xs:string?) as item()*
xdmp:group()
else
try { xdmp:group($group-name) } catch($ignore) {}
let $group-name :=
if ($group-id) then
xdmp:group-name($group-id)
else
$group-name
let $host-ids :=
if ($group-id) then
xdmp:group-hosts($group-id)
Expand Down