[Trad] [svn:pgfr] r1246 - traduc/trunk/slony
admin at listes.postgresql.fr
admin at listes.postgresql.fr
Lun 23 Fév 16:47:43 CET 2009
Author: gleu
Date: 2009-02-23 16:47:42 +0100 (Mon, 23 Feb 2009)
New Revision: 1246
Modified:
traduc/trunk/slony/adminscripts.xml
traduc/trunk/slony/installation.xml
traduc/trunk/slony/partitioning.xml
traduc/trunk/slony/releasechecklist.xml
traduc/trunk/slony/schemadoc.xml
traduc/trunk/slony/slon.xml
traduc/trunk/slony/slonconf.xml
traduc/trunk/slony/slonik_ref.xml
traduc/trunk/slony/version.xml
Log:
Mise ?\195?\160 jour vers la version 1.2.15.
Modified: traduc/trunk/slony/adminscripts.xml
===================================================================
--- traduc/trunk/slony/adminscripts.xml 2009-02-23 15:46:28 UTC (rev 1245)
+++ traduc/trunk/slony/adminscripts.xml 2009-02-23 15:47:42 UTC (rev 1246)
@@ -703,6 +703,23 @@
</listitem>
</itemizedlist>
+<note>
+ <para>
+ Ce script fonctionne correctement uniquement lorsqu'il est exécuté sur un
+ nœud <emphasis>origine</emphasis>.
+ </para>
+</note>
+
+<warning>
+ <para>
+ Si ce script est exécuté sur un nœud <emphasis>abonné</emphasis>,
+ le <command>pg_dump</command> utilisé pour dessiner le schéma à partir du
+ nœud source tentera de récupérer le schéma <emphasis>cassé</emphasis>
+ trouvé sur l'abonne et, du coup, le résultat ne sera <emphasis>pas</emphasis>
+ une représentation fidèle du schéma disponible sur le nœud origine.
+ </para>
+</warning>
+
</sect2>
<sect2>
@@ -1065,7 +1082,7 @@
<subtitle>profiles dans le style d'Apache pour FreeBSD <filename>ports/databases/slony/*</filename></subtitle>
<para>
- Dans le répertoire <filename>tools</filename>, le script
+ Dans le répertoire <filename>tools</filename>, le script
<filename>slon.in-profiles</filename> permet de lancer des instances &lslon;
lors du démarrage du système. Il est conçu pour interagir avec le système des
ports de FreeBSD.
Modified: traduc/trunk/slony/installation.xml
===================================================================
--- traduc/trunk/slony/installation.xml 2009-02-23 15:46:28 UTC (rev 1245)
+++ traduc/trunk/slony/installation.xml 2009-02-23 15:47:42 UTC (rev 1246)
@@ -266,8 +266,8 @@
ce bug mais il n'y a eu aucun progrès depuis. La seconde URL ci-dessous
indique qu'il y a eu des tentatives de correction en élevant la valeur de
NAMELEN dans une future version de Red Hat Enterprise Linux, mais cela n'est
- pas le cas en 2005. La distribution Fedora Core 4 devrait avoir corrigé ce
- problème plus tôt.
+ pas le cas en 2005. Les distribution Fedora actuelles ont déjà corrigé ce
+ problème.
</para>
<para>
@@ -301,17 +301,16 @@
distributions Linux, il est également possible d'installer &slony1; en
utilisant des paquets binaires. L'équipe de développement de Slony (NdT :
« Slony Global Development Team ») fournit des paquets RPM et SRPM
- officiels pour différentes versions de Red Hat et Fedora Core.
+ officiels pour différentes versions de Red Hat et Fedora.
</para>
<para>
- Les RPM sont disponibles sur le <ulink
- url="http://pgfoundry.org/projects/slony1/">site &slony1; sur pgFoundry.org
- </ulink>. Lisez le fichier <command>CURRENT_MAINTAINER</command> pour
- plus de détails sur les RPM. Notez que ces RPM rechercheront &postgres; tel
- qu'installé par RPM, donc si vous avez installé &postgres; à partir des
- sources, vous devez ignorer explicitement les dépendances liées à
- &postgres;.
+ Les RPM sont disponibles sur le <ulink url="yum.pgsqlrpms.org">site RPM de
+ &postgres;</ulink>. Merci de lire le guide pratique fourni sur le site web
+ pour configurer yum afin qu'il utilise ce dépôt. Notez que ces RPM
+ rechercheront &postgres; tel qu'installé par RPM, donc si vous avez installé
+ &postgres; à partir des sources, vous devez ignorer explicitement les
+ dépendances liées à &postgres;.
</para>
<para>
@@ -319,12 +318,11 @@
quel paquet RPM :
</para>
-<screen>rpm -ivh postgresql-slony1-engine-....rpm</screen>
+<screen>yum install slony1</screen>
<para>
- Si vous voulez mettre à jour une version antérieure, utilisez simplement la
- commande <command>rpm -Uvh</command>. Cependant, n'oubliez pas de suivre la
- procédure habituelle de mise à jour.
+ yum s'occupera des dépendances. Ce dépôt fournit les binaires de Slony-I
+ utilisables avec chaque version supportée de &postgres;.
</para>
<para>
@@ -332,7 +330,7 @@
fichiers de configuration sont dans le répertoire <filename>/etc</filename>,
les fichiers binaires sont installés dans <filename>/usr/bin</filename>, les
bibliothèques sont dans <filename>/usr/lib/pgsql</filename> et enfin la
- documentation est située dans <filename>/usr/share/doc/postgresql-slony1-engine</filename>.
+ documentation est située dans <filename>/usr/share/doc/slony1</filename>.
</para>
</sect2>
Modified: traduc/trunk/slony/partitioning.xml
===================================================================
--- traduc/trunk/slony/partitioning.xml 2009-02-23 15:46:28 UTC (rev 1245)
+++ traduc/trunk/slony/partitioning.xml 2009-02-23 15:47:42 UTC (rev 1246)
@@ -152,7 +152,8 @@
</itemizedlist>
<para>
- Il existe plusieurs fonctions qui prennent en charge cela. L'utilisateur
+ Il existe plusieurs fonctions qui prennent en charge cela, pour les versions
+ 8.1 et ultérieures de &postgres;. L'utilisateur
peut utiliser celle qu'il préfère. La <quote>fonction de base</quote> est
<function>add_empty_table_to_replication()</function>, les autres disposent
d'arguments supplémentaires ou différents.
Modified: traduc/trunk/slony/releasechecklist.xml
===================================================================
--- traduc/trunk/slony/releasechecklist.xml 2009-02-23 15:46:28 UTC (rev 1245)
+++ traduc/trunk/slony/releasechecklist.xml 2009-02-23 15:47:42 UTC (rev 1246)
@@ -103,11 +103,6 @@
Purgez le répertoire <filename>autom4te.cache</filename> afin qu'il ne
soit pas inclus dans la compilation.
</para>
-
- <para>
- Il n'est pas nécessaire de le faire à la main - la commande suivante
- <command>make distclean</command> le fait pour vous.
- </para>
</listitem>
<listitem>
@@ -115,11 +110,6 @@
Purgez les fichiers .cvsignore ; cela peut se faire avec la commande
<command>find . -name .cvsignore | xargs rm</command>
</para>
-
- <para>
- Il n'est pas nécessaire de le faire à la main - la commande suivante
- <command>make distclean</command> le fait pour vous.
- </para>
</listitem>
<listitem>
@@ -194,12 +184,6 @@
<command> ./configure && make all && make clean</command>
mais c'est une approche quelque peu disgracieuse.
</para>
-
- <para>
- Une méthode légèrement meilleure consiste à lancer
- <command>./configure && make src/slon/conf-file.c
- src/slonik/parser.c src/slonik/scan.c</command>
- </para>
</listitem>
<listitem>
@@ -211,13 +195,6 @@
<para>
<command>make distclean</command> le fera pour vous...
</para>
-
- <para>
- Notez que <command>make distclean</command> nettoie aussi les fichiers
- <filename>.cvsignore</filename> et <filename>autom4te.cache</filename>,
- rendant ainsi obsolète les étapes précédentes qui suggéraient de les
- supprimer.
- </para>
</listitem>
<listitem>
Modified: traduc/trunk/slony/schemadoc.xml
===================================================================
--- traduc/trunk/slony/schemadoc.xml 2009-02-23 15:46:28 UTC (rev 1245)
+++ traduc/trunk/slony/schemadoc.xml 2009-02-23 15:47:42 UTC (rev 1246)
@@ -2952,6 +2952,97 @@
+
+<!-- Function add_empty_table_to_replication( integer, integer, text, text, text, text ) -->
+ <section id="function.add-empty-table-to-replication-integer-integer-text-text-text-text"
+ xreflabel="schemadocadd_empty_table_to_replication( integer, integer, text, text, text, text )">
+ <title id="function.add-empty-table-to-replication-integer-integer-text-text-text-text-title">
+ add_empty_table_to_replication( integer, integer, text, text, text, text )
+ </title>
+ <titleabbrev id="function.add-empty-table-to-replication-integer-integer-text-text-text-text-titleabbrev">
+ add_empty_table_to_replication( integer, integer, text, text, text, text )
+ </titleabbrev>
+
+ <para>
+ <segmentedlist>
+ <title>Function Properties</title>
+ <?dbhtml list-presentation="list"?>
+ <segtitle>Language</segtitle>
+ <segtitle>Return Type</segtitle>
+ <seglistitem>
+ <seg>PLPGSQL</seg>
+ <seg>bigint</seg>
+ </seglistitem>
+ </segmentedlist>
+
+ Verify that a table is empty, and add it to replication.
+tab_idxname is optional - if NULL, then we use the primary key.
+ <programlisting>
+declare
+ p_set_id alias for $1;
+ p_tab_id alias for $2;
+ p_nspname alias for $3;
+ p_tabname alias for $4;
+ p_idxname alias for $5;
+ p_comment alias for $6;
+
+ prec record;
+ v_origin int4;
+ v_isorigin boolean;
+ v_fqname text;
+ v_query text;
+ v_rows integer;
+ v_idxname text;
+
+begin
+-- Need to validate that the set exists; the set will tell us if this is the origin
+ select set_origin into v_origin from sl_set where set_id = p_set_id;
+ if not found then
+ raise exception 'add_empty_table_to_replication: set % not found!', p_set_id;
+ end if;
+
+-- Need to be aware of whether or not this node is origin for the set
+ v_isorigin := ( v_origin = getLocalNodeId('_schemadoc') );
+
+ v_fqname := '"' || p_nspname || '"."' || p_tabname || '"';
+-- Take out a lock on the table
+ v_query := 'lock ' || v_fqname || ';';
+ execute v_query;
+
+ if v_isorigin then
+ -- On the origin, verify that the table is empty, failing if it has any tuples
+ v_query := 'select 1 as tuple from ' || v_fqname || ' limit 1;';
+ execute v_query into prec;
+ GET DIAGNOSTICS v_rows = ROW_COUNT;
+ if v_rows = 0 then
+ raise notice 'add_empty_table_to_replication: table % empty on origin - OK', v_fqname;
+ else
+ raise exception 'add_empty_table_to_replication: table % contained tuples on origin node %', v_fqname, v_origin;
+ end if;
+ else
+ -- On other nodes, TRUNCATE the table
+ v_query := 'truncate ' || v_fqname || ';';
+ execute v_query;
+ end if;
+-- If p_idxname is NULL, then look up the PK index, and RAISE EXCEPTION if one does not exist
+ if p_idxname is NULL then
+ select c2.relname into prec from pg_catalog.pg_index i, pg_catalog.pg_class c1, pg_catalog.pg_class c2, pg_catalog.pg_namespace n where i.indrelid = c1.oid and i.indexrelid = c2.oid and c1.relname = p_tabname and i.indisprimary and n.nspname = p_nspname and n.oid = c1.relnamespace;
+ if not found then
+ raise exception 'add_empty_table_to_replication: table % has no primary key and no candidate specified!', v_fqname;
+ else
+ v_idxname := prec.relname;
+ end if;
+ else
+ v_idxname := p_idxname;
+ end if;
+ perform setAddTable_int(p_set_id, p_tab_id, v_fqname, v_idxname, p_comment);
+ return alterTableRestore(p_tab_id);
+end
+</programlisting>
+ </para>
+ </section>
+
+
<!-- Function add_missing_table_field( text, text, text, text ) -->
<section id="function.add-missing-table-field-text-text-text-text"
xreflabel="schemadocadd_missing_table_field( text, text, text, text )">
@@ -6558,7 +6649,7 @@
<!-- Function logtrigger( ) -->
<section id="function.logtrigger"
- xreflabel="schemadoclogtrigger( )">
+ xreflabel="schemadoc.logtrigger( )">
<title id="function.logtrigger-title">
logtrigger( )
</title>
@@ -7146,38 +7237,89 @@
allow communications between nodes in the Slony-I cluster.
<programlisting>
declare
- v_receiver record ;
- v_provider record ;
- v_origin record ;
- v_reachable int4[] ;
+ v_row record;
+ skip boolean;
begin
-- First remove the entire configuration
delete from sl_listen;
- -- Loop over every possible pair of receiver and provider
- for v_receiver in select no_id from sl_node loop
- for v_provider in select pa_server as no_id from sl_path where pa_client = v_receiver.no_id loop
+ -- Second populate the sl_listen configuration with a full
+ -- network of all possible paths.
+ insert into sl_listen
+ (li_origin, li_provider, li_receiver)
+ select pa_server, pa_server, pa_client from sl_path;
+ while true loop
+ insert into sl_listen
+ (li_origin, li_provider, li_receiver)
+ select distinct li_origin, pa_server, pa_client
+ from sl_listen, sl_path
+ where li_receiver = pa_server
+ and li_origin <> pa_client
+ except
+ select li_origin, li_provider, li_receiver
+ from sl_listen;
- -- Find all nodes that v_provider.no_id can receiver events from without using v_receiver.no_id
- for v_origin in select * from ReachableFromNode(v_provider.no_id, array[v_receiver.no_id]) as r(no_id) loop
+ if not found then
+ exit;
+ end if;
+ end loop;
- -- If v_receiver.no_id subscribes a set from v_provider.no_id, events have to travel the same
- -- path as the data. Ignore possible sl_listen that would break that rule.
- perform 1 from sl_subscribe
- join sl_set on sl_set.set_id = sl_subscribe.sub_set
- where
- sub_receiver = v_receiver.no_id and
- sub_provider != v_provider.no_id and
- set_origin = v_origin.no_id ;
- if not found then
- insert into sl_listen (li_receiver, li_provider, li_origin)
- values (v_receiver.no_id, v_provider.no_id, v_origin.no_id) ;
- end if ;
+ -- We now replace specific event-origin,receiver combinations
+ -- with a configuration that tries to avoid events arriving at
+ -- a node before the data provider actually has the data ready.
+ -- Loop over every possible pair of receiver and event origin
+ for v_row in select N1.no_id as receiver, N2.no_id as origin
+ from sl_node as N1, sl_node as N2
+ where N1.no_id <> N2.no_id
+ loop
+ skip := 'f';
+ -- 1st choice:
+ -- If we use the event origin as a data provider for any
+ -- set that originates on that very node, we are a direct
+ -- subscriber to that origin and listen there only.
+ if exists (select true from sl_set, sl_subscribe
+ where set_origin = v_row.origin
+ and sub_set = set_id
+ and sub_provider = v_row.origin
+ and sub_receiver = v_row.receiver
+ and sub_active)
+ then
+ delete from sl_listen
+ where li_origin = v_row.origin
+ and li_receiver = v_row.receiver;
+ insert into sl_listen (li_origin, li_provider, li_receiver)
+ values (v_row.origin, v_row.origin, v_row.receiver);
+ skip := 't';
+ end if;
- end loop ;
+ if skip then
+ skip := 'f';
+ else
+ -- 2nd choice:
+ -- If we are subscribed to any set originating on this
+ -- event origin, we want to listen on all data providers
+ -- we use for this origin. We are a cascaded subscriber
+ -- for sets from this node.
+ if exists (select true from sl_set, sl_subscribe
+ where set_origin = v_row.origin
+ and sub_set = set_id
+ and sub_receiver = v_row.receiver
+ and sub_active)
+ then
+ delete from sl_listen
+ where li_origin = v_row.origin
+ and li_receiver = v_row.receiver;
+ insert into sl_listen (li_origin, li_provider, li_receiver)
+ select distinct set_origin, sub_provider, v_row.receiver
+ from sl_set, sl_subscribe
+ where set_origin = v_row.origin
+ and sub_set = set_id
+ and sub_receiver = v_row.receiver
+ and sub_active;
+ end if;
+ end if;
- end loop ;
end loop ;
return null ;
@@ -7521,6 +7663,65 @@
</para>
</section>
+<!-- Function replicate_partition( integer, text, text, text, text ) -->
+ <section id="function.replicate-partition-integer-text-text-text-text"
+ xreflabel="schemadocreplicate_partition( integer, text, text, text, text )">
+ <title id="function.replicate-partition-integer-text-text-text-text-title">
+ replicate_partition( integer, text, text, text, text )
+ </title>
+ <titleabbrev id="function.replicate-partition-integer-text-text-text-text-titleabbrev">
+ replicate_partition( integer, text, text, text, text )
+ </titleabbrev>
+
+ <para>
+ <segmentedlist>
+ <title>Function Properties</title>
+ <?dbhtml list-presentation="list"?>
+ <segtitle>Language</segtitle>
+ <segtitle>Return Type</segtitle>
+ <seglistitem>
+ <seg>PLPGSQL</seg>
+ <seg>bigint</seg>
+ </seglistitem>
+ </segmentedlist>
+
+ Add a partition table to replication.
+tab_idxname is optional - if NULL, then we use the primary key.
+This function looks up replication configuration via the parent table.
+ <programlisting>
+declare
+ p_tab_id alias for $1;
+ p_nspname alias for $2;
+ p_tabname alias for $3;
+ p_idxname alias for $4;
+ p_comment alias for $5;
+
+ prec record;
+ prec2 record;
+ v_set_id int4;
+
+begin
+-- Look up the parent table; fail if it does not exist
+ select c1.oid into prec from pg_catalog.pg_class c1, pg_catalog.pg_class c2, pg_catalog.pg_inherits i, pg_catalog.pg_namespace n where c1.oid = i.inhparent and c2.oid = i.inhrelid and n.oid = c2.relnamespace and n.nspname = p_nspname and c2.relname = p_tabname;
+ if not found then
+ raise exception 'replicate_partition: No parent table found for %.%!', p_nspname, p_tabname;
+ end if;
+
+-- The parent table tells us what replication set to use
+ select tab_set into prec2 from sl_table where tab_reloid = prec.oid;
+ if not found then
+ raise exception 'replicate_partition: Parent table % for new partition %.% is not replicated!', prec.oid, p_nspname, p_tabname;
+ end if;
+
+ v_set_id := prec2.tab_set;
+
+-- Now, we have all the parameters necessary to run add_empty_table_to_replication...
+ return add_empty_table_to_replication(v_set_id, p_tab_id, p_nspname, p_tabname, p_idxname, p_comment);
+end
+</programlisting>
+ </para>
+ </section>
+
<!-- Function sequencelastvalue( text ) -->
<section id="function.sequencelastvalue-text"
xreflabel="schemadocsequencelastvalue( text )">
@@ -8950,7 +9151,7 @@
Returns the version patch level of the slony schema
<programlisting>
begin
- return 0;
+ return 12;
end;
</programlisting>
</para>
Modified: traduc/trunk/slony/slon.xml
===================================================================
--- traduc/trunk/slony/slon.xml 2009-02-23 15:46:28 UTC (rev 1245)
+++ traduc/trunk/slony/slon.xml 2009-02-23 15:47:42 UTC (rev 1246)
@@ -244,7 +244,7 @@
</para>
<para>
- Au contraire, avec &slony1; 1.0, le démon
+ Au contraire, avec &slony1; 1.1 et les versions ultérieures, le démon
<application>slon</application> s'adapte en augmentant
<quote>progressivement</quote> le nombre de <command>SYNC</command>
par groupe, de 1 jusqu'à la valeur maximale. Ainsi, si quelques
Modified: traduc/trunk/slony/slonconf.xml
===================================================================
--- traduc/trunk/slony/slonconf.xml 2009-02-23 15:46:28 UTC (rev 1245)
+++ traduc/trunk/slony/slonconf.xml 2009-02-23 15:47:42 UTC (rev 1246)
@@ -477,9 +477,9 @@
</indexterm>
</term>
<listitem>
- <para>Durée que le processus d'écoute distant doit attendre avant
+ <para>Durée, en millisecondes, que le processus d'écoute distant doit attendre avant
de considérer qu'un événement est périmé.
- Valeurs possibles : [30-30000]. Valeur par défaut : 300.
+ Valeurs possibles : [30-30000]. Valeur par défaut : 300ms.
</para>
</listitem>
</varlistentry>
Modified: traduc/trunk/slony/slonik_ref.xml
===================================================================
--- traduc/trunk/slony/slonik_ref.xml 2009-02-23 15:46:28 UTC (rev 1245)
+++ traduc/trunk/slony/slonik_ref.xml 2009-02-23 15:47:42 UTC (rev 1246)
@@ -1213,10 +1213,10 @@
# Supposons que l'ensemble 1 est répliqué sur les nœuds 2 et 3
SUBSCRIBE SET (ID = 999, PROVIDER = 1, RECEIVER = 2);
SYNC (ID=1);
- WAIT FOR EVENT (ORIGIN = 1, CONFIRMED = 2, WAIT FOR=1);
+ WAIT FOR EVENT (ORIGIN = 1, CONFIRMED = 2, WAIT ON=1);
SUBSCRIBE SET (ID = 999, PROVIDER = 1, RECEIVER = 3);
SYNC (ID=1);
- WAIT FOR EVENT (ORIGIN = 1, CONFIRMED = 3, WAIT FOR=1);
+ WAIT FOR EVENT (ORIGIN = 1, CONFIRMED = 3, WAIT ON=1);
MERGE SET ( ID = 1, ADD ID = 999, ORIGIN = 1 );
</programlisting>
</refsect1>
@@ -2745,10 +2745,10 @@
# Supposons que l'ensemble 1 a deux abonnés direct 2 et 3
SUBSCRIBE SET (ID = 999, PROVIDER = 1, RECEIVER = 2);
SYNC (ID=1);
- WAIT FOR EVENT (ORIGIN = 1, CONFIRMED = 2, WAIT FOR=1);
+ WAIT FOR EVENT (ORIGIN = 1, CONFIRMED = 2, WAIT ON=1);
SUBSCRIBE SET (ID = 999, PROVIDER = 1, RECEIVER = 3);
SYNC (ID=1);
- WAIT FOR EVENT (ORIGIN = 1, CONFIRMED = 3, WAIT FOR=1);
+ WAIT FOR EVENT (ORIGIN = 1, CONFIRMED = 3, WAIT ON=1);
MERGE SET ( ID = 1, ADD ID = 999, ORIGIN = 1 );
</programlisting>
</refsect1>
Modified: traduc/trunk/slony/version.xml
===================================================================
--- traduc/trunk/slony/version.xml 2009-02-23 15:46:28 UTC (rev 1245)
+++ traduc/trunk/slony/version.xml 2009-02-23 15:47:42 UTC (rev 1246)
@@ -1,2 +1,2 @@
-<!ENTITY version "1.2.12">
+<!ENTITY version "1.2.15">
<!ENTITY majorversion "1.2">
More information about the Trad
mailing list