<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sat, 15 Aug 2015 at 01:01 Brian Stansberry &lt;<a href="mailto:brian.stansberry@redhat.com">brian.stansberry@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Looks good.<br>
<br>
Do we want migration-warnings=-[] in the success case, or just omit it?<br>
I don&#39;t have a strong preference either way.<br></blockquote><div><br></div><div>I have changed it so this will not be displayed. </div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Seeing all the details in the failure case made me nervous about RBAC.<br>
But I think the key there is in the read of the subsystem that goes to<br>
produce the ops. We should test that that fails if the caller is not<br>
able to address some child resource or if the caller is not able to read<br>
some attribute value.<br></blockquote><div><br></div><div>Should this hold up the PR, or is this a task for later?</div><div><br></div><div>Stuart</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If we know the caller can read the entire subsystem then it is safe to<br>
provide details of any failure on the writes, since it is the same data.<br>
<br>
Once everything is clear we should work out a way to have shared code so<br>
this stuff has a higher guarantee of consistency across subsystems.<br>
<br>
On 8/14/15 1:32 AM, Stuart Douglas wrote:<br>
&gt; I have a PR that builds on Brian&#39;s work for the web migrate op:<br>
&gt; <a href="https://github.com/wildfly/wildfly/pull/7931" rel="noreferrer" target="_blank">https://github.com/wildfly/wildfly/pull/7931</a><br>
&gt;<br>
&gt; Output is:<br>
&gt;<br>
&gt; Standard EAP config (no warnings or errors):<br>
&gt;<br>
&gt; [standalone@localhost:9999 /] /subsystem=web:migrate<br>
&gt; {<br>
&gt;      &quot;outcome&quot; =&gt; &quot;success&quot;,<br>
&gt;      &quot;result&quot; =&gt; {&quot;migration-warnings&quot; =&gt; []}<br>
&gt; }<br>
&gt;<br>
&gt; Success with a warning (in this case due to an invalid protocol<br>
&gt; attribute on a connector):<br>
&gt;<br>
&gt; [standalone@localhost:9999 /] /subsystem=web:migrate<br>
&gt; {<br>
&gt;      &quot;outcome&quot; =&gt; &quot;success&quot;,<br>
&gt;      &quot;result&quot; =&gt; {&quot;migration-warnings&quot; =&gt; [&quot;WFLYWEB0002: Could not<br>
&gt; migrate resource {<br>
&gt;      \&quot;protocol\&quot; =&gt; \&quot;INVALID\&quot;,<br>
&gt;      \&quot;scheme\&quot; =&gt; \&quot;http\&quot;,<br>
&gt;      \&quot;socket-binding\&quot; =&gt; \&quot;ajp\&quot;,<br>
&gt;      \&quot;enable-lookups\&quot; =&gt; undefined,<br>
&gt;      \&quot;proxy-binding\&quot; =&gt; undefined,<br>
&gt;      \&quot;proxy-name\&quot; =&gt; undefined,<br>
&gt;      \&quot;proxy-port\&quot; =&gt; undefined,<br>
&gt;      \&quot;redirect-binding\&quot; =&gt; undefined,<br>
&gt;      \&quot;redirect-port\&quot; =&gt; undefined,<br>
&gt;      \&quot;secure\&quot; =&gt; undefined,<br>
&gt;      \&quot;max-post-size\&quot; =&gt; undefined,<br>
&gt;      \&quot;max-save-post-size\&quot; =&gt; undefined,<br>
&gt;      \&quot;enabled\&quot; =&gt; undefined,<br>
&gt;      \&quot;executor\&quot; =&gt; undefined,<br>
&gt;      \&quot;max-connections\&quot; =&gt; undefined,<br>
&gt;      \&quot;virtual-server\&quot; =&gt; undefined,<br>
&gt;      \&quot;name\&quot; =&gt; \&quot;ajp\&quot;,<br>
&gt;      \&quot;operation\&quot; =&gt; \&quot;add\&quot;,<br>
&gt;      \&quot;address\&quot; =&gt; [<br>
&gt;          (\&quot;subsystem\&quot; =&gt; \&quot;web\&quot;),<br>
&gt;          (\&quot;connector\&quot; =&gt; \&quot;ajp\&quot;)<br>
&gt;      ]<br>
&gt; }&quot;]}<br>
&gt; }<br>
&gt;<br>
&gt; Failed OP:<br>
&gt;<br>
&gt; [standalone@localhost:9999 /] /subsystem=web:migrate<br>
&gt; {<br>
&gt;      &quot;outcome&quot; =&gt; &quot;failed&quot;,<br>
&gt;      &quot;result&quot; =&gt; {<br>
&gt;          &quot;migration-warnings&quot; =&gt; [],<br>
&gt;          &quot;migration-error&quot; =&gt; {<br>
&gt;              &quot;operation&quot; =&gt; {<br>
&gt;                  &quot;operation&quot; =&gt; &quot;add&quot;,<br>
&gt;                  &quot;address&quot; =&gt; [<br>
&gt;                      (&quot;subsystem&quot; =&gt; &quot;undertow&quot;),<br>
&gt;                      (&quot;server&quot; =&gt; &quot;default-server&quot;),<br>
&gt;                      (&quot;ajp-listener&quot; =&gt; &quot;ajp&quot;)<br>
&gt;                  ],<br>
&gt;                  &quot;socket-binding&quot; =&gt; &quot;ajp&quot;,<br>
&gt;                  &quot;secure&quot; =&gt; undefined,<br>
&gt;                  &quot;redirect-socket&quot; =&gt; undefined,<br>
&gt;                  &quot;enabled&quot; =&gt; undefined,<br>
&gt;                  &quot;resolve-peer-address&quot; =&gt; undefined,<br>
&gt;                  &quot;max-post-size&quot; =&gt; undefined,<br>
&gt;                  &quot;max-connections&quot; =&gt; &quot;sadfadsfasdgasdfg&quot;,<br>
&gt;                  &quot;operation-headers&quot; =&gt; {<br>
&gt;                      &quot;caller-type&quot; =&gt; &quot;user&quot;,<br>
&gt;                      &quot;access-mechanism&quot; =&gt; &quot;NATIVE&quot;<br>
&gt;                  },<br>
&gt;                  &quot;worker&quot; =&gt; undefined,<br>
&gt;                  &quot;buffer-pool&quot; =&gt; undefined,<br>
&gt;                  &quot;disallowed-methods&quot; =&gt; undefined,<br>
&gt;                  &quot;max-header-size&quot; =&gt; undefined,<br>
&gt;                  &quot;buffer-pipelined-data&quot; =&gt; undefined,<br>
&gt;                  &quot;max-parameters&quot; =&gt; undefined,<br>
&gt;                  &quot;max-headers&quot; =&gt; undefined,<br>
&gt;                  &quot;max-cookies&quot; =&gt; undefined,<br>
&gt;                  &quot;allow-encoded-slash&quot; =&gt; undefined,<br>
&gt;                  &quot;decode-url&quot; =&gt; undefined,<br>
&gt;                  &quot;url-charset&quot; =&gt; undefined,<br>
&gt;                  &quot;always-set-keep-alive&quot; =&gt; undefined,<br>
&gt;                  &quot;max-buffered-request-size&quot; =&gt; undefined,<br>
&gt;                  &quot;record-request-start-time&quot; =&gt; undefined,<br>
&gt;                  &quot;allow-equals-in-cookie-value&quot; =&gt; undefined,<br>
&gt;                  &quot;no-request-timeout&quot; =&gt; undefined,<br>
&gt;                  &quot;request-parse-timeout&quot; =&gt; undefined,<br>
&gt;                  &quot;tcp-backlog&quot; =&gt; undefined,<br>
&gt;                  &quot;receive-buffer&quot; =&gt; undefined,<br>
&gt;                  &quot;send-buffer&quot; =&gt; undefined,<br>
&gt;                  &quot;tcp-keep-alive&quot; =&gt; undefined,<br>
&gt;                  &quot;read-timeout&quot; =&gt; undefined,<br>
&gt;                  &quot;write-timeout&quot; =&gt; undefined<br>
&gt;              },<br>
&gt;              &quot;result&quot; =&gt; {<br>
&gt;                  &quot;outcome&quot; =&gt; &quot;failed&quot;,<br>
&gt;                  &quot;failure-description&quot; =&gt; &quot;WFLYCTL0097: Wrong type for<br>
&gt; max-connections. Expected [INT] but was STRING&quot;,<br>
&gt;                  &quot;rolled-back&quot; =&gt; true<br>
&gt;              }<br>
&gt;          }<br>
&gt;      },<br>
&gt;      &quot;rolled-back&quot; =&gt; true<br>
&gt; }<br>
&gt;<br>
&gt; Stuart<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Fri, 14 Aug 2015 at 11:03 Brian Stansberry<br>
&gt; &lt;<a href="mailto:brian.stansberry@redhat.com" target="_blank">brian.stansberry@redhat.com</a> &lt;mailto:<a href="mailto:brian.stansberry@redhat.com" target="_blank">brian.stansberry@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     On 8/13/15 10:03 AM, Brian Stansberry wrote:<br>
&gt;      &gt; On 8/13/15 3:11 AM, Stuart Douglas wrote:<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; On Thu, 13 Aug 2015 at 16:27 Ladislav Thon &lt;<a href="mailto:lthon@redhat.com" target="_blank">lthon@redhat.com</a><br>
&gt;     &lt;mailto:<a href="mailto:lthon@redhat.com" target="_blank">lthon@redhat.com</a>&gt;<br>
&gt;      &gt;&gt; &lt;mailto:<a href="mailto:lthon@redhat.com" target="_blank">lthon@redhat.com</a> &lt;mailto:<a href="mailto:lthon@redhat.com" target="_blank">lthon@redhat.com</a>&gt;&gt;&gt; wrote:<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;       &gt; The approach I took was to add the warnings to the<br>
&gt;     describe-migration<br>
&gt;      &gt;&gt;       &gt; op, and when running the migrate op make the<br>
&gt;     describe-migration<br>
&gt;      &gt;&gt;       &gt; operation the first step in the composite, so the output<br>
&gt;     looks like<br>
&gt;      &gt;&gt;       &gt; this: <a href="http://pastebin.com/B01KNAHX" rel="noreferrer" target="_blank">http://pastebin.com/B01KNAHX</a><br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;      The fact that it&#39;s a composite operation makes the output a<br>
&gt;     bit cryptic<br>
&gt;      &gt;&gt;      (step-X?), but otherwise I think it&#39;s actually good.<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;      I guess that only handling the warnings in<br>
&gt;     :describe-migration makes the<br>
&gt;      &gt;&gt;      implementation easier (not sure?) and printing<br>
&gt;     :describe-migration as a<br>
&gt;      &gt;&gt;      part of :migrate makes sense too, precisely because it<br>
&gt;     shows the steps<br>
&gt;      &gt;&gt;      that are performed.<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;      So my only objection would be those cryptic &quot;step-X&quot; names,<br>
&gt;     but I guess<br>
&gt;      &gt;&gt;      that we can live with that (if all :migrate operations took<br>
&gt;     the same<br>
&gt;      &gt;&gt;      approach; inconsistency wouldn&#39;t really help here).<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; That is because this is implemented as a composite operation, AFAIK<br>
&gt;      &gt;&gt; there is lots of special handing for composite ops, so I don&#39;t<br>
&gt;     think we<br>
&gt;      &gt;&gt; want to be implementing our own one with different output just<br>
&gt;     for this<br>
&gt;      &gt;&gt; case.<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; I could be wrong though, this is not really my area, Brian will<br>
&gt;     know more.<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;<br>
&gt;      &gt; In the success case, I don&#39;t see the point of outputting &quot;step-2&quot; =&gt;<br>
&gt;      &gt; {&quot;outcome&quot; =&gt; &quot;success&quot;}, &quot;step-3&quot; =&gt; {&quot;outcome&quot; =&gt; &quot;success&quot;}, etc.<br>
&gt;      &gt;<br>
&gt;      &gt; In the failure case though, having an intelligible<br>
&gt;     failure-description<br>
&gt;      &gt; is important. And the composite op handler may be getting in your<br>
&gt;     way there<br>
&gt;      &gt;<br>
&gt;      &gt; Instead of writing more text, I&#39;ll write some code to illustrate some<br>
&gt;      &gt; thoughts and post back later.<br>
&gt;      &gt;<br>
&gt;<br>
&gt;     Here&#39;s what I was thinking.<br>
&gt;<br>
&gt;     [1] is a change to break out the step registration stuff<br>
&gt;     CompositeOperationHandler does into a utility method, with a couple<br>
&gt;     other variants added that are better suited for use by other OSHs.<br>
&gt;<br>
&gt;     Basically, it lets you pass in a Map of ops and a holder map of response<br>
&gt;     nodes, and it will add the steps and populate the response node map.<br>
&gt;     (You can optionally pre-populate the response node map. There&#39;s also a<br>
&gt;     variant that uses lists instead of maps in case that&#39;s more convenient.)<br>
&gt;<br>
&gt;     Using that, the response nodes for the added ops don&#39;t have to directly<br>
&gt;     appear in the overall operation response. Instead the migrate op handler<br>
&gt;     can hold a ref to them and in its ResultHandler use them to format an<br>
&gt;     understandable response.<br>
&gt;<br>
&gt;     The top two commits in [2] are an example tweak to the current<br>
&gt;     WebMigrationOp in master to illustrate use of this.<br>
&gt;<br>
&gt;     [1] <a href="https://github.com/wildfly/wildfly-core/pull/956" rel="noreferrer" target="_blank">https://github.com/wildfly/wildfly-core/pull/956</a><br>
&gt;<br>
&gt;     [2] <a href="https://github.com/bstansberry/wildfly/tree/help-migrate-multistep" rel="noreferrer" target="_blank">https://github.com/bstansberry/wildfly/tree/help-migrate-multistep</a><br>
&gt;<br>
&gt;      &gt;&gt; Stuart<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;      LT<br>
&gt;      &gt;&gt;      _______________________________________________<br>
&gt;      &gt;&gt;      wildfly-dev mailing list<br>
&gt;      &gt;&gt; <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
&gt;     &lt;mailto:<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a>&gt;&gt;<br>
&gt;      &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; _______________________________________________<br>
&gt;      &gt;&gt; wildfly-dev mailing list<br>
&gt;      &gt;&gt; <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a>&gt;<br>
&gt;      &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
&gt;      &gt;&gt;<br>
&gt;      &gt;<br>
&gt;      &gt;<br>
&gt;<br>
&gt;<br>
&gt;     --<br>
&gt;     Brian Stansberry<br>
&gt;     Senior Principal Software Engineer<br>
&gt;     JBoss by Red Hat<br>
&gt;     _______________________________________________<br>
&gt;     wildfly-dev mailing list<br>
&gt;     <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a>&gt;<br>
&gt;     <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
&gt;<br>
<br>
<br>
--<br>
Brian Stansberry<br>
Senior Principal Software Engineer<br>
JBoss by Red Hat<br>
</blockquote></div></div>