Guthrie, Jeremy jeremy.guthrie
Wed Jul 14 13:51:15 PDT 2004
1st off, sorry about the difference in mail format, forced to use exchange for webmail.  yuck.

1.  Makes sense, seems to work just fine.

2.  I trimmed out the cluster name and tried to re-run. 
lock set (id = 1, origin = 1);
wait for event (origin = 1, confirmed = 2);
move set (id = 1, old origin = 1, new origin = 2);
wait for event (origin = 1, confirmed = 2);

Same error.


3.  I don't see Node_ID in sl_event or sl_confirm.  What am I missing?

securityframework=# \d _secframe_cluster.sl_event
           Table "_secframe_cluster.sl_event"
    Column    |            Type             | Modifiers
--------------+-----------------------------+-----------
 ev_origin    | integer                     | not null
 ev_seqno     | bigint                      | not null
 ev_timestamp | timestamp without time zone |
 ev_minxid    | _secframe_cluster.xxid      |
 ev_maxxid    | _secframe_cluster.xxid      |
 ev_xip       | text                        |
 ev_type      | text                        |
 ev_data1     | text                        |
 ev_data2     | text                        |
 ev_data3     | text                        |
 ev_data4     | text                        |
 ev_data5     | text                        |
 ev_data6     | text                        |
 ev_data7     | text                        |
 ev_data8     | text                        |
Indexes:
    "sl_event-pkey" primary key, btree (ev_origin, ev_seqno)

securityframework=# \d _secframe_cluster.sl_confirm
                               Table "_secframe_cluster.sl_confirm"
    Column     |            Type             |                     Modifiers
---------------+-----------------------------+----------------------------------------------------
 con_origin    | integer                     |
 con_received  | integer                     |
 con_seqno     | bigint                      |
 con_timestamp | timestamp without time zone | default (timeofday())::timestamp without time zone
Indexes:
    "sl_confirm_idx1" btree (con_origin, con_received, con_seqno)
    "sl_confirm_idx2" btree (con_received, con_seqno)

4.  When are sequence numbers replicated/updated on the backup node for a set?  At time of failover?  At any point in time I can query db a & b for set 1 and db-a being active will have a current sequence number but db-b will not.

-----Original Message-----
From: Jan Wieck [mailto:JanWieck at Yahoo.com]
Sent: Wed 7/14/2004 4:00 AM
To: Guthrie, Jeremy
Cc: slony1-general at gborg.postgresql.org
Subject: Re: [Slony1-general] Several Questions
 
On 7/13/2004 8:41 PM, Jeremy M. Guthrie wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 1.  Anyone have a query I can run that will tell me wether the DB I've 
> connected to is active or passive?

Wrong question. Slony is not assigning the "master" role to a DB. Every 
set has one origin at any given point of time. So what you are looking 
for is

     where set_origin = getLocalNodeId(<clustername>);


> 2.  When trying to failover...
> I pass the following to slonik:
> cluster name = tsyslog_cluster;
> lock set (id = 1, origin = 1);
> wait for event (origin = 1, confirmed = 2);
> move set (id = 1, old origin = 1, new origin = 2);
> wait for event (origin = 1, confirmed = 2);
> 
> I get:  <stdin>:2: ERROR: syntax error at or near lock
> 
> any ideas?

Yepp ... you don't tell slonik any admin connninfo's. Not too intuitive 
as an error message, I admit. But the parser is defined to get something 
else between "cluster name" and "lock set".

> 
> 3.  how do I query Postgresql/Slony to find out how far behind it is?

Compare the max() values grouped by node ID between sl_event and sl_confirm.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck at Yahoo.com #






More information about the Slony1-general mailing list