<div dir="ltr">Thanks Ben for clarification. So it means one Monitor request can request for only one Table monitoring, correct? </div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 8, 2018 at 10:36 AM, Ben Pfaff <span dir="ltr">&lt;<a href="mailto:blp@ovn.org" target="_blank">blp@ovn.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&lt;monitor-requests&gt; is a JSON object.  A JSON object maps from keys to<br>
values, so we only need one.<br>
<br>
Your specification for &lt;monitor-requests&gt; is wrong because it says that<br>
it is a JSON array.  It is not.<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, Mar 07, 2018 at 09:32:06PM -0800, Anil Jangam wrote:<br>
&gt; Hello Ben,<br>
&gt;<br>
&gt; I have one more observation. I request you to please read it carefully. If<br>
&gt; we go by the current monitor method definition, there can be only<br>
&gt; &lt;monitor-requests&gt;<br>
&gt; in one monitor RPC method. If it is expected to have only one<br>
&gt; &lt;monitor-requests&gt;<br>
&gt; i.e. one table and an array of &lt;monitor-request&gt;, then the current<br>
&gt; specification is good.<br>
&gt;<br>
&gt; o  &quot;method&quot;: &quot;monitor&quot;<br>
&gt;<br>
&gt; o  &quot;params&quot;: [&lt;db-name&gt;, &lt;json-value&gt;, &lt;monitor-requests&gt;]<br>
&gt;<br>
&gt; o  &quot;id&quot;: &lt;nonnull-json-value&gt;<br>
&gt;<br>
&gt;<br>
&gt; However, if it is possible to specify multiple table monitoring in one RPC<br>
&gt; method, IMHO the above syntax would change as below.<br>
&gt;<br>
&gt;<br>
&gt; o  &quot;method&quot;: &quot;monitor&quot;<br>
&gt;<br>
&gt; o  &quot;params&quot;: [&lt;db-name&gt;, &lt;json-value&gt;, &lt;monitor-requests&gt;*]<br>
&gt;<br>
&gt; o  &quot;id&quot;: &lt;nonnull-json-value&gt;<br>
&gt;<br>
&gt;<br>
&gt; For completeness, I am also specifying the syntax for &lt;monitor-requests&gt;.<br>
&gt;<br>
&gt; monitor-requests : [&lt;table-name&gt;, &lt;monitor-request&gt;*]<br>
&gt;<br>
&gt;<br>
&gt; Let me know if this would be correct or if you think otherwise.<br>
&gt;<br>
&gt; /anil.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Mar 7, 2018 at 10:27 AM, Ben Pfaff &lt;<a href="mailto:blp@ovn.org">blp@ovn.org</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Ah, OK, you&#39;re saying that there&#39;s a missing [] around the<br>
&gt; &gt; &lt;monitor-request&gt;.  This goes back to a change that we made to the<br>
&gt; &gt; ovsdb-server protocol a long time ago to allow multiple<br>
&gt; &gt; &lt;monitor-request&gt; objects instead of just a single one.  ovsdb-server<br>
&gt; &gt; still supports this form.  You can see this documented in<br>
&gt; &gt; Documentation/ref/ovsdb-<wbr>server.7.rst:<br>
&gt; &gt;<br>
&gt; &gt;     For backward compatibility, ``ovsdb-server`` currently permits a single<br>
&gt; &gt;     &lt;monitor-request&gt; to be used instead of an array; it is treated as a<br>
&gt; &gt;     single-element array.  Future versions of ``ovsdb-server`` might<br>
&gt; &gt; remove this<br>
&gt; &gt;     compatibility feature.<br>
&gt; &gt;<br>
&gt; &gt; I guess we should change ovsdb-idl.c to use an array now.  Oops.<br>
&gt; &gt;<br>
&gt; &gt; Anyway, that&#39;s easy enough, so I sent a patch:<br>
&gt; &gt;         <a href="https://patchwork.ozlabs.org/patch/882710/" rel="noreferrer" target="_blank">https://patchwork.ozlabs.org/<wbr>patch/882710/</a><br>
&gt; &gt;<br>
&gt; &gt; On Tue, Mar 06, 2018 at 08:38:34PM -0800, Anil Jangam wrote:<br>
&gt; &gt; &gt; Hello Ben,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; The &lt;monitor-requests&gt; object maps the name of the table to be monitored<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; to an array of &lt;monitor-request&gt; objects. Each &lt;monitor-request&gt; is an<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; object with the following members:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;        &quot;columns&quot;: [&lt;column&gt;*]            optional<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;        &quot;select&quot;: &lt;monitor-select&gt;        optional<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; As the &lt;monitor-requests&gt; maps the table name to be monitored to an array<br>
&gt; &gt; &gt; of &lt;monitor-request&gt;, my interpretation of it is as &quot;Table Name &lt;--&gt;<br>
&gt; &gt; Array<br>
&gt; &gt; &gt; of &lt;monitor-request&gt;&quot;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I am giving an example message is given below.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; {<br>
&gt; &gt; &gt;   &quot;id&quot;: &quot;c5c09c07-11c1-449b-8f04-<wbr>016fefe15844&quot;,<br>
&gt; &gt; &gt;   &quot;method&quot;: &quot;monitor&quot;,<br>
&gt; &gt; &gt;   &quot;params&quot;: [<br>
&gt; &gt; &gt;     &quot;hardware_vtep&quot;,<br>
&gt; &gt; &gt;     &quot;91c9eed4-00bb-48e3-b2d9-<wbr>51e0364bbdc2&quot;,<br>
&gt; &gt; &gt;     {<br>
&gt; &gt; &gt;       &quot;Physical_Locator&quot;: [<br>
&gt; &gt; &gt;         {<br>
&gt; &gt; &gt;           &quot;columns&quot;: [<br>
&gt; &gt; &gt;             &quot;dst_ip&quot;,<br>
&gt; &gt; &gt;             &quot;encapsulation_type&quot;,<br>
&gt; &gt; &gt;             &quot;_uuid&quot;<br>
&gt; &gt; &gt;           ],<br>
&gt; &gt; &gt;           &quot;select&quot;: {<br>
&gt; &gt; &gt;             &quot;initial&quot;: true,<br>
&gt; &gt; &gt;             &quot;insert&quot;: true,<br>
&gt; &gt; &gt;             &quot;delete&quot;: true,<br>
&gt; &gt; &gt;             &quot;modify&quot;: true<br>
&gt; &gt; &gt;           }<br>
&gt; &gt; &gt;         },<br>
&gt; &gt; &gt;         {<br>
&gt; &gt; &gt;           &quot;columns&quot;: [<br>
&gt; &gt; &gt;             &quot;_uuid&quot;,<br>
&gt; &gt; &gt;             &quot;locators&quot;<br>
&gt; &gt; &gt;           ],<br>
&gt; &gt; &gt;           &quot;select&quot;: {<br>
&gt; &gt; &gt;             &quot;initial&quot;: true,<br>
&gt; &gt; &gt;             &quot;insert&quot;: true,<br>
&gt; &gt; &gt;             &quot;delete&quot;: true,<br>
&gt; &gt; &gt;             &quot;modify&quot;: true<br>
&gt; &gt; &gt;           }<br>
&gt; &gt; &gt;         }<br>
&gt; &gt; &gt;       ]<br>
&gt; &gt; &gt;     }<br>
&gt; &gt; &gt;   ]<br>
&gt; &gt; &gt; }<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; /anil.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On Tue, Mar 6, 2018 at 11:30 AM, Ben Pfaff &lt;<a href="mailto:blp@ovn.org">blp@ovn.org</a>&gt; wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; On Mon, Mar 05, 2018 at 10:03:13PM -0800, Anil Jangam wrote:<br>
&gt; &gt; &gt; &gt; &gt; Hi,<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; The RFC7047 states below about the Monitor request.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; The request object has the<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;    following members:<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;    o  &quot;method&quot;: &quot;monitor&quot;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;    o  &quot;params&quot;: [&lt;db-name&gt;, &lt;json-value&gt;, &lt;monitor-requests&gt;]<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;    o  &quot;id&quot;: &lt;nonnull-json-value&gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; The &lt;json-value&gt; parameter is used to match subsequent update<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; notifications (see below) to this request.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; The &lt;monitor-requests&gt; object maps the name of the table to be<br>
&gt; &gt; monitored<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; to an array of &lt;monitor-request&gt; objects. Each &lt;monitor-request&gt; is<br>
&gt; &gt; an<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; object with the following members:<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;        &quot;columns&quot;: [&lt;column&gt;*]            optional<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;        &quot;select&quot;: &lt;monitor-select&gt;        optional<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; The columns, if present, define the columns within the table to be<br>
&gt; &gt; &gt; &gt; monitored.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &lt;monitor-select&gt; is an object with the following members:<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;        &quot;initial&quot;: &lt;boolean&gt;              optional<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;        &quot;insert&quot;: &lt;boolean&gt;               optional<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;        &quot;delete&quot;: &lt;boolean&gt;               optional<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;        &quot;modify&quot;: &lt;boolean&gt;               optional<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; The contents of this object specify how the columns or table are to<br>
&gt; &gt; be<br>
&gt; &gt; &gt; &gt; &gt; monitored,<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; as explained in more detail below.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; However, when I look at some of the legitimate samples of the Monitor<br>
&gt; &gt; &gt; &gt; &gt; requests, they are encoded as below.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; {<br>
&gt; &gt; &gt; &gt; &gt;   &quot;id&quot;: &quot;c5c09c07-11c1-449b-8f04-<wbr>016fefe15844&quot;,<br>
&gt; &gt; &gt; &gt; &gt;   &quot;method&quot;: &quot;monitor&quot;,<br>
&gt; &gt; &gt; &gt; &gt;   &quot;params&quot;: [<br>
&gt; &gt; &gt; &gt; &gt;     &quot;hardware_vtep&quot;,<br>
&gt; &gt; &gt; &gt; &gt;     &quot;91c9eed4-00bb-48e3-b2d9-<wbr>51e0364bbdc2&quot;,<br>
&gt; &gt; &gt; &gt; &gt;     {<br>
&gt; &gt; &gt; &gt; &gt;       &quot;Physical_Locator&quot;: {<br>
&gt; &gt; &gt; &gt; &gt;         &quot;columns&quot;: [<br>
&gt; &gt; &gt; &gt; &gt;           &quot;dst_ip&quot;,<br>
&gt; &gt; &gt; &gt; &gt;           &quot;encapsulation_type&quot;,<br>
&gt; &gt; &gt; &gt; &gt;           &quot;_uuid&quot;<br>
&gt; &gt; &gt; &gt; &gt;         ],<br>
&gt; &gt; &gt; &gt; &gt;         &quot;select&quot;: {<br>
&gt; &gt; &gt; &gt; &gt;           &quot;initial&quot;: true,<br>
&gt; &gt; &gt; &gt; &gt;           &quot;insert&quot;: true,<br>
&gt; &gt; &gt; &gt; &gt;           &quot;delete&quot;: true,<br>
&gt; &gt; &gt; &gt; &gt;           &quot;modify&quot;: true<br>
&gt; &gt; &gt; &gt; &gt;         }<br>
&gt; &gt; &gt; &gt; &gt;       },<br>
&gt; &gt; &gt; &gt; &gt;       &quot;Physical_Locator_Set&quot;: {<br>
&gt; &gt; &gt; &gt; &gt;         &quot;columns&quot;: [<br>
&gt; &gt; &gt; &gt; &gt;           &quot;_uuid&quot;,<br>
&gt; &gt; &gt; &gt; &gt;           &quot;locators&quot;<br>
&gt; &gt; &gt; &gt; &gt;         ],<br>
&gt; &gt; &gt; &gt; &gt;         &quot;select&quot;: {<br>
&gt; &gt; &gt; &gt; &gt;           &quot;initial&quot;: true,<br>
&gt; &gt; &gt; &gt; &gt;           &quot;insert&quot;: true,<br>
&gt; &gt; &gt; &gt; &gt;           &quot;delete&quot;: true,<br>
&gt; &gt; &gt; &gt; &gt;           &quot;modify&quot;: true<br>
&gt; &gt; &gt; &gt; &gt;         }<br>
&gt; &gt; &gt; &gt; &gt;       }<br>
&gt; &gt; &gt; &gt; &gt;     }<br>
&gt; &gt; &gt; &gt; &gt;   ]<br>
&gt; &gt; &gt; &gt; &gt; }<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; If we go by the RFC encoding rules, &quot;params&quot; contains the<br>
&gt; &gt; &gt; &gt; &gt; &lt;monitor-requests&gt;, which maps the &quot;Table name&quot; to an array of<br>
&gt; &gt; &gt; &gt; &gt; &lt;Monitor-request&gt; object. So IMHO, the table names comes only once<br>
&gt; &gt; in the<br>
&gt; &gt; &gt; &gt; &gt; message. Correct?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Yes.  That&#39;s what I see above.  The table names are Physical_Locator<br>
&gt; &gt; and<br>
&gt; &gt; &gt; &gt; Physical_Locator_Set, and each of them is mentioned once.<br>
&gt; &gt; &gt; &gt; In the &lt;monitor-requests&gt; object &quot;Physical_Locator&quot; is mapped to:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;        {<br>
&gt; &gt; &gt; &gt;          &quot;columns&quot;: [<br>
&gt; &gt; &gt; &gt;            &quot;dst_ip&quot;,<br>
&gt; &gt; &gt; &gt;            &quot;encapsulation_type&quot;,<br>
&gt; &gt; &gt; &gt;            &quot;_uuid&quot;<br>
&gt; &gt; &gt; &gt;          ],<br>
&gt; &gt; &gt; &gt;          &quot;select&quot;: {<br>
&gt; &gt; &gt; &gt;            &quot;initial&quot;: true,<br>
&gt; &gt; &gt; &gt;            &quot;insert&quot;: true,<br>
&gt; &gt; &gt; &gt;            &quot;delete&quot;: true,<br>
&gt; &gt; &gt; &gt;            &quot;modify&quot;: true<br>
&gt; &gt; &gt; &gt;          }<br>
&gt; &gt; &gt; &gt;        }<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; and similarly for &quot;Physical_Locator_Set&quot;.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Also, it is explicitly mentioned that (as below) and it does NOT<br>
&gt; &gt; contain<br>
&gt; &gt; &gt; &gt; &gt; the &quot;Table name&quot; in it.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Each &lt;monitor-request&gt; is an<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; object with the following members:<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;        &quot;columns&quot;: [&lt;column&gt;*]            optional<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;        &quot;select&quot;: &lt;monitor-select&gt;        optional<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; However, in the message payload that I have, shows the tuple, which<br>
&gt; &gt; &gt; &gt; &gt; contains &quot;Table : Columns : Select&quot;. This list of &lt;monitor-request&gt;<br>
&gt; &gt; &gt; &gt; constitute<br>
&gt; &gt; &gt; &gt; &gt; the &lt;monitor-requests&gt; as per the RFC definition.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; I see this as the discrepancy between the RFC definition and how the<br>
&gt; &gt; &gt; &gt; &gt; message is actually sent by the controller.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; I don&#39;t understand what discrepancy you see.  Can you show an example,<br>
&gt; &gt; &gt; &gt; for example by providing how you think the above example should<br>
&gt; &gt; actually<br>
&gt; &gt; &gt; &gt; be encoded?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt;<br>
</div></div></blockquote></div><br></div>