Обсуждение: Documentation patch for ALTER SUBSCRIPTION

Поиск
Список
Период
Сортировка

Documentation patch for ALTER SUBSCRIPTION

От
David Christensen
Дата:
Greetings,

Enclosed find a documentation patch that clarifies the behavior of ALTER SUBSCRIPTION … REFRESH PUBLICATION with new
tables;I ran into a situation today where the docs were not clear that existing tables would not be re-copied, so
remedyingthis situation. 

Should apply back to Pg 10.

Best,

David


--
David Christensen
Senior Software and Database Engineer
End Point Corporation
david@endpoint.com
785-727-1171



Вложения

Re: Documentation patch for ALTER SUBSCRIPTION

От
Amit Kapila
Дата:
On Fri, Jan 24, 2020 at 2:05 AM David Christensen <david@endpoint.com> wrote:
>
> Greetings,
>
> Enclosed find a documentation patch that clarifies the behavior of ALTER SUBSCRIPTION … REFRESH PUBLICATION with new
tables;I ran into a situation today where the docs were not clear that existing tables would not be re-copied, so
remedyingthis situation. 
>

It seems this is already covered in REFRESH PUBLICATION, see "This
will start replication of tables that were added to the subscribed-to
publications since the last invocation of REFRESH PUBLICATION or since
CREATE SUBSCRIPTION.".  As far as I understand, this text explains the
situation you were facing.  Can you explain why the text quoted by me
is not sufficient?

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



Re: Documentation patch for ALTER SUBSCRIPTION

От
David Christensen
Дата:
>> On Feb 4, 2020, at 8:45 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>>
>> On Fri, Jan 24, 2020 at 2:05 AM David Christensen <david@endpoint.com> wrote:
>> Greetings,
>> Enclosed find a documentation patch that clarifies the behavior of ALTER SUBSCRIPTION … REFRESH PUBLICATION with new
tables;I ran into a situation today where the docs were not clear that existing tables would not be re-copied, so
remedyingthis situation. 
>
> It seems this is already covered in REFRESH PUBLICATION, see "This
> will start replication of tables that were added to the subscribed-to
> publications since the last invocation of REFRESH PUBLICATION or since
> CREATE SUBSCRIPTION.".  As far as I understand, this text explains the
> situation you were facing.  Can you explain why the text quoted by me
> is not sufficient?

Hi Amit,

From several reads of the text it was not explicitly clear to me that when you issued the copy_data that it would not
effectivelyrecopy existing tables in the existing publication, which I had been trying to confirm was not the case
priorto running a refresh operation. I had to resort to reviewing the source code to get the answer I was looking for. 

If you are already familiar with the operation under the hood I am sure the ambiguity is not there but since I was
recentlyconfused by this I wanted to be more explicit in a way that would have helped me answer my original question.  

Best,

David


Re: Documentation patch for ALTER SUBSCRIPTION

От
Amit Kapila
Дата:
On Wed, Feb 5, 2020 at 8:44 AM David Christensen <david@endpoint.com> wrote:
>
> >> On Feb 4, 2020, at 8:45 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> >>
> >> On Fri, Jan 24, 2020 at 2:05 AM David Christensen <david@endpoint.com> wrote:
> >> Greetings,
> >> Enclosed find a documentation patch that clarifies the behavior of ALTER SUBSCRIPTION … REFRESH PUBLICATION with
newtables; I ran into a situation today where the docs were not clear that existing tables would not be re-copied, so
remedyingthis situation. 
> >
> > It seems this is already covered in REFRESH PUBLICATION, see "This
> > will start replication of tables that were added to the subscribed-to
> > publications since the last invocation of REFRESH PUBLICATION or since
> > CREATE SUBSCRIPTION.".  As far as I understand, this text explains the
> > situation you were facing.  Can you explain why the text quoted by me
> > is not sufficient?
>
> Hi Amit,
>
> From several reads of the text it was not explicitly clear to me that when you issued the copy_data that it would not
effectivelyrecopy existing tables in the existing publication, which I had been trying to confirm was not the case
priorto running a refresh operation. I had to resort to reviewing the source code to get the answer I was looking for. 
>
> If you are already familiar with the operation under the hood I am sure the ambiguity is not there but since I was
recentlyconfused by this I wanted to be more explicit in a way that would have helped me answer my original question. 
>

It is possible that one might not understand how this option works by
reading the already existing text in docs, but I think writing in a
different language the same thing also doesn't seem advisable.  I
think if we want to explain it better, then maybe a succinct example
at the end of the page might be helpful.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



Re: Documentation patch for ALTER SUBSCRIPTION

От
Alvaro Herrera
Дата:
On 2020-Feb-05, Amit Kapila wrote:

> It is possible that one might not understand how this option works by
> reading the already existing text in docs, but I think writing in a
> different language the same thing also doesn't seem advisable.  I
> think if we want to explain it better, then maybe a succinct example
> at the end of the page might be helpful.

For reference, the complete varlistentry is:

    <term><literal>REFRESH PUBLICATION</literal></term>
    <listitem>
     <para>
      Fetch missing table information from publisher.  This will start
      replication of tables that were added to the subscribed-to publications
      since the last invocation of <command>REFRESH PUBLICATION</command> or
      since <command>CREATE SUBSCRIPTION</command>. <!-- [2] -->
     </para>

     <para>
      <replaceable>refresh_option</replaceable> specifies additional options for the
      refresh operation.  The supported options are:

      <variablelist>
       <varlistentry>
        <term><literal>copy_data</literal> (<type>boolean</type>)</term>
        <listitem>
         <para>
          Specifies whether the existing data in the publications that are
          being subscribed to should be copied once the replication starts.
          The default is <literal>true</literal>. <!-- [1] -->
         </para>
        </listitem>
       </varlistentry>
      </variablelist>
     </para>
    </listitem>

I tend to agree with David that this is ambiguous enough to warrant a
few words.  Maybe his proposed wording is too verbose; how about just
adding "(Previously subscribed tables are not copied.)" where the [1]
appears?  Alternatively, we could add "Tables that were already present
in the subscription are not modified in any way." where [2] appears, but
that seems less clear to me.

An example would not be bad if it showed that existing data is not
copied.  But examples are actually just syntactical examples, so you'd
have to resort to a comment explaining that existing tables are not
copied by the shown syntax.  You might as well just add the words in the
reference docs ...

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: Documentation patch for ALTER SUBSCRIPTION

От
David Christensen
Дата:
> On Feb 5, 2020, at 7:56 AM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>
> On 2020-Feb-05, Amit Kapila wrote:
>
>> It is possible that one might not understand how this option works by
>> reading the already existing text in docs, but I think writing in a
>> different language the same thing also doesn't seem advisable.  I
>> think if we want to explain it better, then maybe a succinct example
>> at the end of the page might be helpful.
>
> For reference, the complete varlistentry is:
>
>    <term><literal>REFRESH PUBLICATION</literal></term>
>    <listitem>
>     <para>
>      Fetch missing table information from publisher.  This will start
>      replication of tables that were added to the subscribed-to publications
>      since the last invocation of <command>REFRESH PUBLICATION</command> or
>      since <command>CREATE SUBSCRIPTION</command>. <!-- [2] -->
>     </para>
>
>     <para>
>      <replaceable>refresh_option</replaceable> specifies additional options for the
>      refresh operation.  The supported options are:
>
>      <variablelist>
>       <varlistentry>
>        <term><literal>copy_data</literal> (<type>boolean</type>)</term>
>        <listitem>
>         <para>
>          Specifies whether the existing data in the publications that are
>          being subscribed to should be copied once the replication starts.
>          The default is <literal>true</literal>. <!-- [1] -->
>         </para>
>        </listitem>
>       </varlistentry>
>      </variablelist>
>     </para>
>    </listitem>
>
> I tend to agree with David that this is ambiguous enough to warrant a
> few words.  Maybe his proposed wording is too verbose; how about just
> adding "(Previously subscribed tables are not copied.)" where the [1]
> appears?  Alternatively, we could add "Tables that were already present
> in the subscription are not modified in any way." where [2] appears, but
> that seems less clear to me.
>
> An example would not be bad if it showed that existing data is not
> copied.  But examples are actually just syntactical examples, so you'd
> have to resort to a comment explaining that existing tables are not
> copied by the shown syntax.  You might as well just add the words in the
> reference docs …

I would be happy with the suggestion [1]; it would have clarified my specific question.

Thanks,

David

Вложения

Re: Documentation patch for ALTER SUBSCRIPTION

От
Alvaro Herrera
Дата:
OK, pushed that.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services