Rename undocumented utility SyncSyncID to MasterSync.
Document MasterSync. Fix up a couple of print statements to respect $verbose and $debug.
This commit is contained in:
parent
e6e9e18e9e
commit
e59e805d83
|
@ -34,7 +34,7 @@ $sinfo = "$sinfo host=$opt_host" if (defined($opt_host));
|
||||||
$sinfo = "$sinfo user=$opt_user" if (defined($opt_user));
|
$sinfo = "$sinfo user=$opt_user" if (defined($opt_user));
|
||||||
$sinfo = "$sinfo password=$opt_password" if (defined($opt_password));
|
$sinfo = "$sinfo password=$opt_password" if (defined($opt_password));
|
||||||
|
|
||||||
if ($verbose) { print "Connecting to '$sinfo'\n" };
|
print("Connecting to '$sinfo'\n") if ($debug || $verbose);
|
||||||
my $conn = Pg::connectdb($sinfo);
|
my $conn = Pg::connectdb($sinfo);
|
||||||
|
|
||||||
$res = GetSyncID($conn);
|
$res = GetSyncID($conn);
|
||||||
|
|
|
@ -13,8 +13,9 @@ OBJS = $(NAME).o
|
||||||
DOCS = README.$(NAME)
|
DOCS = README.$(NAME)
|
||||||
SQLS = master.sql slave.sql
|
SQLS = master.sql slave.sql
|
||||||
TCLS = RservTest
|
TCLS = RservTest
|
||||||
PERLS = MasterInit SlaveInit MasterAddTable SlaveAddTable Replicate CleanLog
|
PERLS = MasterInit MasterAddTable Replicate MasterSync CleanLog
|
||||||
PERLS += PrepareSnapshot ApplySnapshot GetSyncID SyncSyncID
|
PERLS += SlaveInit SlaveAddTable GetSyncID
|
||||||
|
PERLS += PrepareSnapshot ApplySnapshot
|
||||||
LIBS = RServ.pm
|
LIBS = RServ.pm
|
||||||
SCRIPTS = InitRservTest
|
SCRIPTS = InitRservTest
|
||||||
MODS = $(OBJS:.o=$(DLSUFFIX))
|
MODS = $(OBJS:.o=$(DLSUFFIX))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- perl -*-
|
# -*- perl -*-
|
||||||
# SyncSyncID
|
# MasterSync
|
||||||
# Vadim Mikheev, (c) 2000, PostgreSQL Inc.
|
# Vadim Mikheev, (c) 2000, PostgreSQL Inc.
|
||||||
|
|
||||||
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
|
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
|
|
@ -48,7 +48,12 @@ Replicate masterdb slavedb
|
||||||
|
|
||||||
GetSyncID [--noverbose] slavedb
|
GetSyncID [--noverbose] slavedb
|
||||||
returns the last syncid the specified slave has seen. May be used
|
returns the last syncid the specified slave has seen. May be used
|
||||||
in conjunction with CleanLog using the --noverbose option.
|
in conjunction with SyncSyncID and CleanLog using the --noverbose
|
||||||
|
option.
|
||||||
|
|
||||||
|
MasterSync masterdb syncid
|
||||||
|
registers a syncid with the specified master database. Used to
|
||||||
|
propagate replication success back to the master database.
|
||||||
|
|
||||||
CleanLog masterdb syncid
|
CleanLog masterdb syncid
|
||||||
removes obsolete entries in the master database replication log
|
removes obsolete entries in the master database replication log
|
||||||
|
|
|
@ -38,7 +38,7 @@ sub RollbackAndQuit {
|
||||||
exit (-1);
|
exit (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "Connecting to $sinfo\n";
|
print("Connecting to $sinfo\n") if ($debug || $verbose);
|
||||||
my $conn = Pg::connectdb($sinfo);
|
my $conn = Pg::connectdb($sinfo);
|
||||||
if ($conn->status != PGRES_CONNECTION_OK) {
|
if ($conn->status != PGRES_CONNECTION_OK) {
|
||||||
print STDERR "Failed opening $sinfo\n";
|
print STDERR "Failed opening $sinfo\n";
|
||||||
|
|
Loading…
Reference in a new issue