Fri Oct 1 21:43:03 PDT 2004
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message:
-----------
Vivek Khera's changes that add the $MASTERNODE variable which allows the
scripts that need to know which node is "master" to have a value other
than 1.
Modified Files:
--------------
slony1-engine/tools/altperl:
README (r1.6 -> r1.7)
create_set.pl (r1.6 -> r1.7)
drop_node.pl (r1.4 -> r1.5)
init_cluster.pl (r1.4 -> r1.5)
slon.env (r1.5 -> r1.6)
uninstall_nodes.pl (r1.2 -> r1.3)
-------------- next part --------------
Index: drop_node.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/drop_node.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -Ltools/altperl/drop_node.pl -Ltools/altperl/drop_node.pl -u -w -r1.4 -r1.5
--- tools/altperl/drop_node.pl
+++ tools/altperl/drop_node.pl
@@ -19,7 +19,7 @@
print SLONIK genheader();
print SLONIK qq{
try {
- drop node (id = $node);
+ drop node (id = $node, event node = $MASTERNODE);
} on error {
echo 'Failed to drop node $node from cluster';
exit 1;
Index: create_set.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/create_set.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -Ltools/altperl/create_set.pl -Ltools/altperl/create_set.pl -u -w -r1.6 -r1.7
--- tools/altperl/create_set.pl
+++ tools/altperl/create_set.pl
@@ -23,7 +23,7 @@
print OUTFILE "
echo ' Adding unique key to table $table...';
table add key (
- node id=1,
+ node id=$MASTERNODE,
full qualified name='$table'
);
";
@@ -36,7 +36,7 @@
print OUTFILE "
try {
- create set (id = $set, origin = 1, comment = 'Set $set for $SETNAME');
+ create set (id = $set, origin = $MASTERNODE, comment = 'Set $set for $SETNAME');
} on error {
echo 'Could not create subscription set $set for $SETNAME!';
exit -1;
@@ -60,7 +60,7 @@
foreach my $table (@SERIALTABLES) {
$table = ensure_namespace($table);
print OUTFILE "
- set add table (set id = $set, origin = 1, id = $TABLE_ID, full qualified name = '$table', comment = 'Table $table without primary key', key=serial);
+ set add table (set id = $set, origin = $MASTERNODE, id = $TABLE_ID, full qualified name = '$table', comment = 'Table $table without primary key', key=serial);
echo 'Add unkeyed table $table';
";
$TABLE_ID++;
@@ -69,7 +69,7 @@
foreach my $table (@PKEYEDTABLES) {
$table = ensure_namespace($table);
print OUTFILE "
- set add table (set id = $set, origin = 1, id = $TABLE_ID, full qualified name = '$table', comment = 'Table $table with primary key');
+ set add table (set id = $set, origin = $MASTERNODE, id = $TABLE_ID, full qualified name = '$table', comment = 'Table $table with primary key');
echo 'Add primary keyed table $table';
";
$TABLE_ID++;
@@ -79,7 +79,7 @@
my $key = $KEYEDTABLES{$table};
$table = ensure_namespace($table);
print OUTFILE "
- set add table (set id = $set, origin = 1, id = $TABLE_ID, full qualified name = '$table', key='$key', comment = 'Table $table with candidate primary key $key');
+ set add table (set id = $set, origin = $MASTERNODE, id = $TABLE_ID, full qualified name = '$table', key='$key', comment = 'Table $table with candidate primary key $key');
echo 'Add candidate primary keyed table $table';
";
$TABLE_ID++;
@@ -99,7 +99,7 @@
foreach my $seq (@SEQUENCES) {
$seq = ensure_namespace($seq);
print OUTFILE "
- set add sequence (set id = $set, origin = 1, id = $SEQID, full qualified name = '$seq', comment = 'Sequence $seq');
+ set add sequence (set id = $set, origin = $MASTERNODE, id = $SEQID, full qualified name = '$seq', comment = 'Sequence $seq');
echo 'Add sequence $seq';
";
$SEQID++;
Index: init_cluster.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/init_cluster.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -Ltools/altperl/init_cluster.pl -Ltools/altperl/init_cluster.pl -u -w -r1.4 -r1.5
--- tools/altperl/init_cluster.pl
+++ tools/altperl/init_cluster.pl
@@ -12,9 +12,9 @@
print SLONIK genheader();
-my ($dbname, $dbhost)=($DBNAME[1], $HOST[1]);
+my ($dbname, $dbhost)=($DBNAME[$MASTERNODE], $HOST[$MASTERNODE]);
print SLONIK "
- init cluster (id = 1, comment = 'Node $node - $dbname\@$dbhost');
+ init cluster (id = $MASTERNODE, comment = 'Node $node - $dbname\@$dbhost');
";
close SLONIK;
run_slonik_script($FILE);
@@ -23,9 +23,9 @@
print SLONIK genheader();
foreach my $node (@NODES) {
- if ($node > 1) { # skip the first one; it's already initialized!
+ if ($node != $MASTERNODE) { # skip the first one; it's already initialized!
my ($dbname, $dbhost) = ($DBNAME[$node], $HOST[$node]);
- print SLONIK " store node (id = $node, comment = 'Node $node - $dbname\@$dbhost');\n";
+ print SLONIK " store node (id = $node, event node = $MASTERNODE, comment = 'Node $node - $dbname\@$dbhost');\n";
}
}
Index: uninstall_nodes.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/uninstall_nodes.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -Ltools/altperl/uninstall_nodes.pl -Ltools/altperl/uninstall_nodes.pl -u -w -r1.2 -r1.3
--- tools/altperl/uninstall_nodes.pl
+++ tools/altperl/uninstall_nodes.pl
@@ -10,7 +10,7 @@
open(SLONIK, ">$FILE");
print SLONIK genheader();
print SLONIK qq{
- uninstall node (id=1);
+ uninstall node (id=$MASTERNODE);
};
close SLONIK;
run_slonik_script($FILE);
Index: slon.env
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon.env,v
retrieving revision 1.5
retrieving revision 1.6
diff -Ltools/altperl/slon.env -Ltools/altperl/slon.env -u -w -r1.5 -r1.6
--- tools/altperl/slon.env
+++ tools/altperl/slon.env
@@ -66,3 +66,5 @@
);
}
+$MASTERNODE ||= 1; # Set MASTER node only if not set above...
+1;
Index: README
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/README,v
retrieving revision 1.6
retrieving revision 1.7
diff -Ltools/altperl/README -Ltools/altperl/README -u -w -r1.6 -r1.7
--- tools/altperl/README
+++ tools/altperl/README
@@ -45,6 +45,8 @@
involved in the replication set, you will find the namespace
"_$SETNAME" that contains Slony-I's configuration tables
+ $MASTERNODE is the number of the "master" node. It defaults to 1, if
+ not otherwise set.
Set Level Configuration
-----------------------------------
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list