Thu Dec 2 23:31:05 PST 2004
- Previous message: [Slony1-commit] By wieck: Added spoolnode option to slonik command doc.
- Next message: [Slony1-commit] By wieck: Create confirm records for all old events when slonik creates
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message:
-----------
Changed so that subscribeSet() is called on the data provider
instead of the receiver. It should finally be called on the
set origin and replace ENABLE SUBSCRIPTION entirely, but that
is a way bigger change. With what we have so far it is possible
to create and subscribe a virtual spool node.
Jan
Modified Files:
--------------
slony1-engine/src/backend:
slony1_funcs.sql (r1.48 -> r1.49)
slony1-engine/src/slonik:
slonik.c (r1.35 -> r1.36)
-------------- next part --------------
Index: slony1_funcs.sql
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/backend/slony1_funcs.sql,v
retrieving revision 1.48
retrieving revision 1.49
diff -Lsrc/backend/slony1_funcs.sql -Lsrc/backend/slony1_funcs.sql -u -w -r1.48 -r1.49
--- src/backend/slony1_funcs.sql
+++ src/backend/slony1_funcs.sql
@@ -3639,6 +3639,7 @@
p_sub_receiver alias for $3;
p_sub_forward alias for $4;
v_set_origin int4;
+ v_ev_seqno int8;
begin
-- ----
-- Grab the central configuration lock
@@ -3648,8 +3649,8 @@
-- ----
-- Check that this is called on the receiver node
-- ----
- if p_sub_receiver != @NAMESPACE at .getLocalNodeId(''_ at CLUSTERNAME@'') then
- raise exception ''Slony-I: subscribeSet() must be called on receiver'';
+ if p_sub_provider != @NAMESPACE at .getLocalNodeId(''_ at CLUSTERNAME@'') then
+ raise exception ''Slony-I: subscribeSet() must be called on provider'';
end if;
-- ----
@@ -3671,6 +3672,13 @@
end if;
-- ----
+ -- Create the SUBSCRIBE_SET event
+ -- ----
+ v_ev_seqno := @NAMESPACE at .createEvent(''_ at CLUSTERNAME@'', ''SUBSCRIBE_SET'',
+ p_sub_set, p_sub_provider, p_sub_receiver,
+ case p_sub_forward when true then ''t'' else ''f'' end);
+
+ -- ----
-- Call the internal procedure to store the subscription
-- ----
perform @NAMESPACE at .subscribeSet_int(p_sub_set, p_sub_provider,
@@ -3681,12 +3689,7 @@
-- ----
perform @NAMESPACE at .RebuildListenEntries();
- -- ----
- -- Create the SUBSCRIBE_SET event
- -- ----
- return @NAMESPACE at .createEvent(''_ at CLUSTERNAME@'', ''SUBSCRIBE_SET'',
- p_sub_set, p_sub_provider, p_sub_receiver,
- case p_sub_forward when true then ''t'' else ''f'' end);
+ return v_ev_seqno;
end;
' language plpgsql;
comment on function @NAMESPACE at .subscribeSet (int4, int4, int4, bool) is
Index: slonik.c
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slonik/slonik.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -Lsrc/slonik/slonik.c -Lsrc/slonik/slonik.c -u -w -r1.35 -r1.36
--- src/slonik/slonik.c
+++ src/slonik/slonik.c
@@ -837,7 +837,7 @@
errors++;
}
- if (script_check_adminfo(hdr, stmt->sub_receiver) < 0)
+ if (script_check_adminfo(hdr, stmt->sub_provider) < 0)
errors++;
}
break;
@@ -3412,7 +3412,7 @@
SlonikAdmInfo *adminfo1;
SlonDString query;
- adminfo1 = get_active_adminfo((SlonikStmt *)stmt, stmt->sub_receiver);
+ adminfo1 = get_active_adminfo((SlonikStmt *)stmt, stmt->sub_provider);
if (adminfo1 == NULL)
return -1;
- Previous message: [Slony1-commit] By wieck: Added spoolnode option to slonik command doc.
- Next message: [Slony1-commit] By wieck: Create confirm records for all old events when slonik creates
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list