Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ee81dfe

Browse files
author
Liudmila Mantrova
committed
DOC: bug fix for tables without pk, spaces, make_table_local
1 parent f69ae2c commit ee81dfe

File tree

1 file changed

+37
-27
lines changed

1 file changed

+37
-27
lines changed

doc/src/sgml/multimaster.sgml

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,12 @@
8282
</listitem>
8383
<listitem>
8484
<para>
85-
The replicated tables must have primary keys or replica identity. Otherwise,
86-
<filename>multimaster</filename> will not allow replication
87-
because of the logical replication restrictions. Unlogged tables are not replicated, as in the standard <productname>PostgreSQL</productname>.
85+
The replicated tables must have primary keys or replica identity because of logical replication restrictions.
86+
Although tables without primary keys can be replicated, <filename>multimaster</filename> does not allow
87+
<literal>UPDATE</literal> and <literal>DELETE</literal> operations on such tables. For details, see
88+
<xref linkend="ignore-tables-without-pk">.
89+
Unlogged tables are not replicated, as in the standard <productname>PostgreSQL</productname>.
8890
</para>
89-
<note><para>You can enable replication
90-
of tables without primary keys by setting the <varname>multimaster.ignore_tables_without_pk</varname> variable to <literal>false</literal>. However, take into account that
91-
<filename>multimaster</filename> does not allow update operations on such tables.</para></note>
9291
</listitem>
9392
<listitem>
9493
<para>
@@ -425,7 +424,7 @@ max_worker_processes = 250
425424
multimaster.max_nodes = 3 # cluster size
426425
multimaster.node_id = 1 # the 1-based index of this node
427426
# in the cluster
428-
multimaster.conn_strings = 'dbname=mydb user=myuser host=node1, dbname=mydb user=myuser host=node2, dbname=mydb user=myuser host=node3'
427+
multimaster.conn_strings = 'dbname=mydb user=myuser host=node1,dbname=mydb user=myuser host=node2,dbname=mydb user=myuser host=node3'
429428
# comma-separated list
430429
# of connection strings
431430
# to neighbor nodes
@@ -545,7 +544,7 @@ mtm.get_cluster_state();
545544
<para>
546545
<varname>multimaster.min_recovery_lag</varname> &mdash; sets the
547546
minimal WAL lag between the node to be restored and the current cluster state.
548-
By default, <varname>multimaster.min_recovery_lag</varname> is set to 100KB.
547+
By default, <varname>multimaster.min_recovery_lag</varname> is set to 100KB.
549548
When the disconnected node is fast-forwarded up to the
550549
<varname>multimaster.min_recovery_lag</varname> threshold,
551550
<filename>multimaster</filename> stops all new commits to the
@@ -689,8 +688,8 @@ pg_basebackup -D <replaceable>datadir</replaceable> -h node1 -x
689688
</para>
690689
<programlisting>
691690
multimaster.node_id = 4
692-
multimaster.conn_strings = 'dbname=mydb user=myuser host=node1, dbname=mydb user=myuser host=node2,
693-
dbname=mydb user=myuser host=node3, dbname=mydb user=myuser host=node4'
691+
multimaster.conn_strings = 'dbname=mydb user=myuser host=node1,dbname=mydb user=myuser host=node2,
692+
dbname=mydb user=myuser host=node3,dbname=mydb user=myuser host=node4'
694693
</programlisting>
695694
</listitem>
696695
<listitem>
@@ -751,7 +750,7 @@ SELECT mtm.stop_node(3);
751750
<sect3 id="multimaster-restoring-a-node-manually">
752751
<title>Restoring a Cluster Node</title>
753752
<para>
754-
The <filename>multimaster</filename> extension can <link linkend="multimaster-failure-detection-and-recovery">automatically restore</link> a failed node if the WAL is available for the time when the node was disconnected from the cluster. However, if the data updates on the alive nodes exceed the allowed WAL size specified in the <literal>multimaster.max_recovery_lag</literal> variable. In this case, you can manually restore the failed node.
753+
The <filename>multimaster</filename> extension can <link linkend="multimaster-failure-detection-and-recovery">automatically restore</link> a failed node if the WAL is available for the time when the node was disconnected from the cluster. However, if the data updates on the alive nodes exceed the allowed WAL size specified in the <literal>multimaster.max_recovery_lag</literal> variable, automatic recovery is impossible. In this case, you can manually restore the failed node.
755754
</para>
756755
<para>
757756
Suppose <literal>node2</literal> got disconnected from your three-node cluster and needs to be manually restored. The typical workflow is as follows:
@@ -814,7 +813,7 @@ pg_ctl -D <replaceable>datadir</replaceable> -l <replaceable>pg.log</replaceable
814813
The <varname>multimaster.conn_strings</varname> parameter must be identical on all nodes.
815814
Each connection string must include the name of the database to replicate
816815
and the cluster node domain name. For example, 'dbname=mydb
817-
host=node1, dbname=mydb host=node2, dbname=mydb host=node3'.
816+
host=node1,dbname=mydb host=node2,dbname=mydb host=node3'.
818817
Optionally, you can add other <link linkend="libpq-paramkeywords">connection parameters</link> to change the default connection settings.
819818
Connection strings must appear in the order of the node IDs
820819
specified in the <varname>multimaster.node_id</varname> variable.
@@ -866,14 +865,17 @@ pg_ctl -D <replaceable>datadir</replaceable> -l <replaceable>pg.log</replaceable
866865
variable to zero, replication slot will not be dropped. </para><para>Default:
867866
100000000
868867
</para></listitem></varlistentry>
869-
<varlistentry><term><varname>multimaster.ignore_tables_without_pk</varname><indexterm><primary><varname>multimaster.ignore_tables_without_pk</varname></primary></indexterm></term><listitem><para>
868+
<varlistentry id="ignore-tables-without-pk"><term><varname>multimaster.ignore_tables_without_pk</varname><indexterm><primary><varname>multimaster.ignore_tables_without_pk</varname></primary></indexterm></term><listitem><para>
870869
Boolean.
871-
This variable enables/disables replication of tables without primary
872-
keys. By default, such replication is
873-
disabled because of the logical replication restrictions. To enable
874-
replication of tables without primary keys, you can set this variable to <literal>false</literal>. However, take into
875-
account that <varname>multimaster</varname> does not allow update
876-
operations on such tables. </para><para>Default: true
870+
This variable enables/disables replication of <literal>INSERT</literal> operations
871+
for tables without primary keys. By default, such replication is enabled.
872+
Setting this parameter to <literal>on</literal> disables replication
873+
of <literal>INSERT</literal> operations for these tables.
874+
Regardless of this setting, DDL operations on tables without primary keys are always replicated,
875+
while <literal>UPDATE</literal> and <literal>DELETE</literal> operations are not replicated
876+
because of the logical replication restrictions.
877+
</para>
878+
<para>Default: <literal>off</literal>
877879
</para></listitem></varlistentry>
878880
<varlistentry><term><varname>multimaster.cluster_name</varname><indexterm><primary><varname>multimaster.cluster_name</varname></primary></indexterm></term><listitem><para>
879881
Name of the cluster. If
@@ -1072,9 +1074,9 @@ pg_ctl -D <replaceable>datadir</replaceable> -l <replaceable>pg.log</replaceable
10721074

10731075
<varlistentry>
10741076
<term>
1075-
<function>mtm.collect_cluster_state()</function>
1077+
<function>mtm.collect_cluster_state_info()</function>
10761078
<indexterm>
1077-
<primary><function>mtm.collect_cluster_state</></primary>
1079+
<primary><function>mtm.collect_cluster_state_info</></primary>
10781080
</indexterm>
10791081
</term>
10801082
<listitem>
@@ -1094,6 +1096,12 @@ pg_ctl -D <replaceable>datadir</replaceable> -l <replaceable>pg.log</replaceable
10941096
<para>Shows the status of the <filename>multimaster</filename> extension. Returns a tuple of the following values:
10951097
</para>
10961098
<itemizedlist>
1099+
<listitem>
1100+
<para>
1101+
<parameter>id</parameter>, <type>integer</type>
1102+
</para>
1103+
<para>Node ID.</para>
1104+
</listitem>
10971105
<listitem>
10981106
<para>
10991107
<parameter>status</parameter>, <type>text</type>
@@ -1245,9 +1253,9 @@ pg_ctl -D <replaceable>datadir</replaceable> -l <replaceable>pg.log</replaceable
12451253
</varlistentry>
12461254
<varlistentry>
12471255
<term>
1248-
<function>mtm.drop_node(<parameter>node</parameter> <type>integer</type>, <parameter>drop_slot</parameter> <type>bool</type> default false)</function>
1256+
<function>mtm.stop_node(<parameter>node</parameter> <type>integer</type>, <parameter>drop_slot</parameter> <type>bool</type> default false)</function>
12491257
<indexterm>
1250-
<primary><function>mtm.drop_node</></primary>
1258+
<primary><function>mtm.stop_node</></primary>
12511259
</indexterm>
12521260
</term>
12531261
<listitem>
@@ -1304,7 +1312,7 @@ pg_ctl -D <replaceable>datadir</replaceable> -l <replaceable>pg.log</replaceable
13041312
</varlistentry>
13051313
<varlistentry>
13061314
<term>
1307-
<function>mtm.make_table_local(<parameter>relation</parameter> <type>regclass</type>)</function>
1315+
<function>mtm.make_table_local(<parameter>'table_name'</parameter> <type>regclass</type>)</function>
13081316
<indexterm>
13091317
<primary><function>mtm.make_table_local</></primary>
13101318
</indexterm>
@@ -1317,7 +1325,7 @@ pg_ctl -D <replaceable>datadir</replaceable> -l <replaceable>pg.log</replaceable
13171325
<itemizedlist>
13181326
<listitem>
13191327
<para>
1320-
<parameter>relation</parameter> &mdash; The table you would like to
1328+
<parameter>table_name</parameter> &mdash; The table you would like to
13211329
exclude from the replication scheme.</para>
13221330
<para>Type: <literal>regclass</literal></para>
13231331
</listitem>
@@ -1333,8 +1341,10 @@ pg_ctl -D <replaceable>datadir</replaceable> -l <replaceable>pg.log</replaceable
13331341
<sect2 id="multimaster-compatibility">
13341342
<title>Compatibility</title>
13351343
<para>
1336-
The <filename>multimaster</filename> extension currently passes 162
1337-
of 166 <productname>PostgreSQL</productname> regression tests. We are working right now on
1344+
The <filename>multimaster</filename> extension currently passes almost all
1345+
<productname>PostgreSQL</productname> regression tests, except for a few tests for
1346+
edge cases related to working with temporary tables and updating <literal>enum</literal>, which are not always
1347+
transactional in <productname>PostgreSQL</productname>. We are working right now on
13381348
providing full compatibility with the standard <productname>PostgreSQL</productname>.
13391349
</para>
13401350
</sect2>

0 commit comments

Comments
 (0)