| 18 | | <para>If you have more than two or three nodes, and any degree of |
|---|
| 19 | | usage of cascaded subscribers (<emphasis>e.g.</emphasis> - subscribers |
|---|
| 20 | | that are subscribing through a subscriber node), you will have to be |
|---|
| 21 | | fairly careful about the configuration of <quote>listen paths</quote> |
|---|
| 22 | | via the Slonik <xref linkend="stmtstorelisten"/> and <xref |
|---|
| 23 | | linkend="stmtdroplisten"/> statements that control the contents of the |
|---|
| 24 | | table <xref linkend="table.sl-listen"/>.</para> |
|---|
| 25 | | |
|---|
| 26 | | <para>The <quote>listener</quote> entries in this table control where |
|---|
| 27 | | each node expects to listen in order to get events propagated from |
|---|
| 28 | | other nodes. You might think that nodes only need to listen to the |
|---|
| 29 | | <quote>parent</quote> from whom they are getting updates, but in |
|---|
| 30 | | reality, they need to be able to receive messages from |
|---|
| 31 | | <emphasis>all</emphasis> nodes in order to be able to conclude that |
|---|
| 32 | | <command>sync</command>s have been received everywhere, and that, |
|---|
| 33 | | therefore, entries in <xref linkend="table.sl-log-1"/> and <xref |
|---|
| 34 | | linkend="table.sl-log-2"/> have been applied everywhere, and can |
|---|
| 35 | | therefore be purged. this extra communication is needful so |
|---|
| 36 | | <productname>Slony-I</productname> is able to shift origins to other |
|---|
| 37 | | locations.</para> |
|---|
| 38 | | |
|---|
| 39 | | <sect2><title>How listening can break</title> |
|---|
| 40 | | |
|---|
| 41 | | <indexterm><primary> listening breakage </primary></indexterm> |
|---|
| 42 | | |
|---|
| 43 | | <para>On one occasion, I had a need to drop a subscriber node (#2) and |
|---|
| 44 | | recreate it. That node was the data provider for another subscriber |
|---|
| 45 | | (#3) that was, in effect, a <quote>cascaded slave.</quote> Dropping |
|---|
| 46 | | the subscriber node initially didn't work, as <xref linkend="slonik"/> |
|---|
| 47 | | informed me that there was a dependant node. I repointed the |
|---|
| 48 | | dependant node to the <quote>master</quote> node for the subscription |
|---|
| 49 | | set, which, for a while, replicated without difficulties.</para> |
|---|
| 50 | | |
|---|
| 51 | | <para>I then dropped the subscription on <quote>node 2</quote>, and |
|---|
| 52 | | started resubscribing it. that raised the &slony1; |
|---|
| 53 | | <command>set_subscription</command> event, which started copying |
|---|
| 54 | | tables. at that point in time, events stopped propagating to |
|---|
| 55 | | <quote>node 3</quote>, and while it was in perfectly ok shape, no |
|---|
| 56 | | events were making it to it.</para> |
|---|
| 57 | | |
|---|
| 58 | | <para>The problem was that node #3 was expecting to receive events |
|---|
| 59 | | from node #2, which was busy processing the <command>set_subscription</command> |
|---|
| 60 | | event, and was not passing anything else on.</para> |
|---|
| 61 | | |
|---|
| 62 | | <para>We dropped the listener rules that caused node #3 to listen to |
|---|
| 63 | | node 2, replacing them with rules where it expected its events to come |
|---|
| 64 | | from node #1 (the origin node for the replication set). At that |
|---|
| 65 | | moment, <quote>as if by magic</quote>, node #3 started replicating again, as |
|---|
| 66 | | it discovered a place to get <command>sync</command> events.</para> |
|---|
| | 19 | <para>Si vous avez plus de deux ou trois noeuds et un niveau d'abonnement |
|---|
| | 20 | en cascade ( <emphasis>c'est à dire</emphasis> des noeuds qui s'abonne |
|---|
| | 21 | à des noeuds abonnés ), vous devez être trÚs prudent avec la configuration |
|---|
| | 22 | des <quote>voies d'écoute</quote> par les commandes Slonik |
|---|
| | 23 | <xref linkend="stmtstorelisten"/> et <xref linkend="stmtdroplisten"/> qui |
|---|
| | 24 | contrÃŽle le contenu de la table <xref linkend="table.sl-listen"/>.</para> |
|---|
| | 25 | |
|---|
| | 26 | <para>Les entrées de cette table contrÎlent où chaque noeuds doit écouter afin |
|---|
| | 27 | d'obtenir les événements propagés par les autres noeuds. Vous vous dites |
|---|
| | 28 | peut-être que chaque noeud doit simplement écouter le noeud |
|---|
| | 29 | <quote>parent</quote> qui leur transmet les mise à jours, mais en réalité, ils doivent |
|---|
| | 30 | pouvoir recevoir des messages de ma part de <emphasis>tous</emphasis> les noeuds |
|---|
| | 31 | afin de pouvoir déterminer si les <command>SYNC</command>s ont été reçus |
|---|
| | 32 | partout et que les entrées de <xref linkend="table.sl-log-1"/> et <xref |
|---|
| | 33 | linkend="table.sl-log-2"/> ont été appliquées partout et qu'elles |
|---|
| | 34 | peuvent être purgées. Ces communications supplémentaires permettent à |
|---|
| | 35 | <productname>Slony-I</productname> de déplacer les origines vers d'autres |
|---|
| | 36 | noeuds.</para> |
|---|
| | 37 | |
|---|
| | 38 | <sect2><title>Comment l'écoute peut être rompue</title> |
|---|
| | 39 | |
|---|
| | 40 | <indexterm><primary> rupture d'écoute </primary></indexterm> |
|---|
| | 41 | |
|---|
| | 42 | <para>A une occasion, j'ai eu besoin de supprimer un noeud abonné (#2) et |
|---|
| | 43 | de la recréer. Ce noeud était le fournisseur d'un autre abonné (#3) qui |
|---|
| | 44 | était, de facto, un <quote>esclave en cascade</quote>. |
|---|
| | 45 | La suppression du noeud abonné ne fonctionna, en effet |
|---|
| | 46 | <xref linkend="slonik"/> m'informa qu'il existait un noeud dépendant. |
|---|
| | 47 | Je fit pointer le noeud dépendant vers le noeud <quote>maître</quote> |
|---|
| | 48 | de l'ensemble de réplication, ce qui se déroula, pour un temps, |
|---|
| | 49 | sans difficultés.</para> |
|---|
| | 50 | |
|---|
| | 51 | <para>Je supprimais alors l'abonnement du <quote>node 2</quote>, et tentais de |
|---|
| | 52 | l'abonner de nouveau. Cela déclencha un événement &slony1; |
|---|
| | 53 | <command>set_subscription</command>, qui commença à copier les tables. |
|---|
| | 54 | à ce moment, les événements ne furent plus propagés au <quote>noeud 3</quote>, |
|---|
| | 55 | et tandis qu'il était en parfait état de fonctionnement, plus aucun |
|---|
| | 56 | événement ne lui parvenait.</para> |
|---|
| | 57 | |
|---|
| | 58 | <para>Le problÚme était que le noeud #3 attendait de recevoir des événements de la part |
|---|
| | 59 | du noeud #2, qui était occupé par le traitement de l'événement <command>set_subscription</command> |
|---|
| | 60 | et ne transmettait aucune autre information.</para> |
|---|
| | 61 | |
|---|
| | 62 | <para>Nous supprimames les rÚgles qui ordonnait au noeud #3 d'écouter le noeud #2, |
|---|
| | 63 | en les remplaçant par des rÚgles qui lui indiquait d'attendre les événements en provenance |
|---|
| | 64 | du noeud #1 ( le noeud origine de la réplication ). à ce moment, |
|---|
| | 65 | <quote>comme par magie</quote>, le noeud #3 recommença à répliquer, car |
|---|
| | 66 | il avait découvert une source ou écouter les évÚnements <command>SYNC</command>.</para> |
|---|
| 148 | | <listitem><para> If you change the shape of the node set, so that the |
|---|
| 149 | | nodes subscribe differently to things, you need to drop <xref |
|---|
| 150 | | linkend="table.sl-listen"/> entries and create new ones to indicate the |
|---|
| 151 | | new preferred paths between nodes. Until &slony1;, there is no |
|---|
| 152 | | automated way at this point to do this |
|---|
| 153 | | <quote>reshaping</quote>.</para></listitem> |
|---|
| 154 | | |
|---|
| 155 | | <listitem><para> If you <emphasis>don't</emphasis> change the |
|---|
| 156 | | <xref linkend="table.sl-listen"/> entries, events will likely continue to propagate so long as |
|---|
| 157 | | all of the nodes continue to run well. the problem will only be |
|---|
| 158 | | noticed when a node is taken down, <quote>orphaning</quote> any nodes |
|---|
| 159 | | that are listening through it.</para></listitem> |
|---|
| 160 | | |
|---|
| 161 | | <listitem><para> you might have multiple replication sets that have |
|---|
| 162 | | <emphasis>different</emphasis> shapes for their respective trees of |
|---|
| 163 | | subscribers. there won't be a single <quote>best</quote> listener |
|---|
| 164 | | configuration in that case.</para></listitem> |
|---|
| 165 | | |
|---|
| 166 | | <listitem><para> In order for there to be an <xref |
|---|
| 167 | | linkend="table.sl-listen"/> path, there <emphasis>must</emphasis> be a |
|---|
| 168 | | series of <xref linkend="table.sl-path"/> entries connecting the origin |
|---|
| 169 | | to the receiver. this means that if the contents of <xref |
|---|
| 170 | | linkend="table.sl-path"/> do not express a <quote>connected</quote> |
|---|
| 171 | | network of nodes, then some nodes will not be reachable. this would |
|---|
| 172 | | typically happen, in practice, when you have two sets of nodes, one in |
|---|
| 173 | | one subnet, and another in another subnet, where there are only a |
|---|
| 174 | | couple of <quote>firewall</quote> nodes that can talk between the |
|---|
| 175 | | subnets. cut out those nodes and the subnets stop |
|---|
| 176 | | communicating.</para></listitem> |
|---|
| | 149 | <listitem><para> Si vous changez la structure du l'ensemble de noeuds, alors |
|---|
| | 150 | les noeuds sont abonnés différemment et vous devez supprimer les entrées |
|---|
| | 151 | de la table <xref linkend="table.sl-listen"/> et en créez de nouvelles |
|---|
| | 152 | pour décrire les nouvelles voies d'écoute entre les noeuds. |
|---|
| | 153 | Jusqu'à &slony1; 1.2, il n'y a aucune maniÚre automatique de réaliser |
|---|
| | 154 | cette <quote>restructuration</quote>.</para></listitem> |
|---|
| | 155 | |
|---|
| | 156 | <listitem><para> Si vous <emphasis>ne changez pas</emphasis> les entrées |
|---|
| | 157 | <xref linkend="table.sl-listen"/>, les événements se propageront |
|---|
| | 158 | tant que les noeuds fonctionnerait correctement. Le problÚme se |
|---|
| | 159 | déclenchera lorsqu'un noeud sera retiré,,rendant <quote>orphelin</quote> |
|---|
| | 160 | les noeuds qui l'écoutaient.</para></listitem> |
|---|
| | 161 | |
|---|
| | 162 | <listitem><para> Vous pouvez essayer de multiples ensembles de réplication |
|---|
| | 163 | qui ont des structures <emphasis>différentes</emphasis> pour leur arborescence |
|---|
| | 164 | d'abonnés. Il n'y aucune configuration d'écoute qui convienne parfaitement |
|---|
| | 165 | dans ce cas.</para></listitem> |
|---|
| | 166 | |
|---|
| | 167 | <listitem><para> Afin de créer une voie <xref linkend="table.sl-listen"/>, |
|---|
| | 168 | il <emphasis>doit</emphasis> exister une série d'entrées<xref linkend="table.sl-path"/> |
|---|
| | 169 | qui connectent l'origine au récepteur. Cela implique que si le contenu |
|---|
| | 170 | de <xref linkend="table.sl-path"/> ne définit pas réseau <quote>connecté</quote> |
|---|
| | 171 | de noeuds, alors certains noeuds ne seront pas accessibles. Typiquement cela |
|---|
| | 172 | peut se produire, lorsque vous avez deux ensembles de noeuds, placés sur deux |
|---|
| | 173 | sous-réseaux séparés, avec simplement deux noeuds <quote>pare-feu</quote> |
|---|
| | 174 | qui communiquent d'un sous-réseau à l'autre. Couper un de ces noeuds et les |
|---|
| | 175 | sous-ensembles de réplication s'arrêtent.</para></listitem> |
|---|
| 192 | | <listitem><para> <xref linkend="table.sl-subscribe"/> entries are the |
|---|
| 193 | | first, most vital control as to what listens to what; we |
|---|
| 194 | | <emphasis>know</emphasis> there must be a direct path between each |
|---|
| 195 | | subscriber node and its provider.</para></listitem> |
|---|
| 196 | | |
|---|
| 197 | | <listitem><para> <xref linkend="table.sl-path"/> entries are the second |
|---|
| 198 | | indicator; if <xref linkend="table.sl-subscribe"/> has not already |
|---|
| 199 | | indicated <quote>how to listen,</quote> then a node may listen |
|---|
| 200 | | directly to the event's origin if there is a suitable <xref |
|---|
| 201 | | linkend="table.sl-path"/> entry.</para></listitem> |
|---|
| 202 | | |
|---|
| 203 | | <listitem><para> Lastly, if there has been no guidance thus far based |
|---|
| 204 | | on the above data sources, then nodes can listen indirectly via every |
|---|
| 205 | | node that is either a provider for the receiver, or that is using the |
|---|
| 206 | | receiver as a provider.</para></listitem> |
|---|
| | 191 | <listitem><para>Les entrées <xref linkend="table.sl-subscribe"/> sont |
|---|
| | 192 | les informations primordiales et vitales sur qui doit écouter quoi; |
|---|
| | 193 | nous <emphasis>savons</emphasis> qu'il doit y avoir une voie |
|---|
| | 194 | directe entre chaque abonné et son fournisseur. |
|---|
| | 195 | </para></listitem> |
|---|
| | 196 | |
|---|
| | 197 | <listitem><para>Les entrées <xref linkend="table.sl-path"/> sont |
|---|
| | 198 | le second indicateur; si a table <xref linkend="table.sl-subscribe"/> |
|---|
| | 199 | n'indique pas <quote>comment écouter</quote>, alors un noeud |
|---|
| | 200 | peut écouter directement l'origine si il existe une voie praticable |
|---|
| | 201 | dans <xref linkend="table.sl-path"/>.</para></listitem> |
|---|
| | 202 | |
|---|
| | 203 | <listitem><para> Enfin, si aucune indication n'a été obtenue à partir des |
|---|
| | 204 | informations précédentes. alors les noeuds peuvent écouter indirectement |
|---|
| | 205 | via un noeud qui est fournisseur de l'abonné, ou qui utilise l'abonné comme |
|---|
| | 206 | fournisseur.</para></listitem> |
|---|