From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [OSSTEST PATCH 15/13] Plan reporting: Provide get-last-plan queuedaemon command Date: Thu, 3 Sep 2015 14:05:11 +0100 Message-ID: <1441285511.26292.368.camel@citrix.com> References: <1441208719-31336-1-git-send-email-ian.jackson@eu.citrix.com> <1441280951-8076-1-git-send-email-ian.jackson@eu.citrix.com> <1441280951-8076-2-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZXUDi-0007u1-Q6 for xen-devel@lists.xenproject.org; Thu, 03 Sep 2015 13:06:26 +0000 In-Reply-To: <1441280951-8076-2-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Thu, 2015-09-03 at 12:49 +0100, Ian Jackson wrote: > This allows retrieval, by monitoring clients which are not > participating in the planning queue, of the finished projection, or > the unfinished plan as it was at the time of last restart. > > Signed-off-by: Ian Jackson > --- > README.planner | 11 +++++++++++ > ms-queuedaemon | 8 ++++++++ > 2 files changed, 19 insertions(+) > > diff --git a/README.planner b/README.planner > index c1b2bf6..8231812 100644 > --- a/README.planner > +++ b/README.planner > @@ -224,6 +224,17 @@ ms-queuedaemon commands > > > thought-done | thought-wait > > + > get-last-plan projection|plan > + Retrieve the last fully completed plan (`projection'), > + or the most recent short-term information used for > + actual resource allocation (`plan'). > + > + For monitoring tools, not participants in the resource > + allocation process. Response is as for get-plan: > + > + < OK get-plan BYTES > + PLAN-DATA > + > > Plan is: > Start time_t used for "now" * > diff --git a/ms-queuedaemon b/ms-queuedaemon > index 222b687..97dff85 100755 > --- a/ms-queuedaemon > +++ b/ms-queuedaemon > @@ -292,6 +292,7 @@ proc report-plan {w wo} { > } emsg]} { > log "INTERNAL ERROR showing $w html: $emsg" > } else { > + file copy -force data-$w.pl data-$wo-final.pl IIRC there was code earlier which did smth like "cp data-plan.pl data -projection.pl" during the take over and that if no resources come available during a plan walk then no projection walk would happen. IOW a user needs to do something like try get-last-plan on projection, then if that doesn't work try again with plan. But with that the last projection walk might be out of data WRT a more recently completed plan walk. So I think a client would need to get both and compare the timestamps or something. It might be nicer to arrange for data-plan-final.pl to be copied to data-projection-final.pl at the same time as data-plan.pl becomes data -projection.pl? > log "$w report-plan OK" > } > } > @@ -366,6 +367,13 @@ proc cmd/get-plan {chan desc} { > set plan [return-plan-to-client $chan $w] > } > > +proc cmd/get-last-plan {chan desc w} { > + global walkers > + if {[lsearch -exact $walkers $w] < 0} { error "unknown last-plan > ($w)" } > + if {![file exists data-$w-final.pl]} { error "no last-plan $w" } > + return-plan-data-to-client $w-final > +} > + > proc cmd/book-resources {chan desc bytes} { > read-chan-data $chan $bytes do-book-resources $w > }