Skip to content

Commit e59e805

Browse files
author
Thomas G. Lockhart
committed
Rename undocumented utility SyncSyncID to MasterSync.
Document MasterSync. Fix up a couple of print statements to respect $verbose and $debug.
1 parent e6e9e18 commit e59e805

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

contrib/rserv/GetSyncID.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $sinfo = "$sinfo host=$opt_host" if (defined($opt_host));
3434
$sinfo = "$sinfo user=$opt_user" if (defined($opt_user));
3535
$sinfo = "$sinfo password=$opt_password" if (defined($opt_password));
3636

37-
if ($verbose) { print "Connecting to '$sinfo'\n" };
37+
print("Connecting to '$sinfo'\n") if ($debug || $verbose);
3838
my $conn = Pg::connectdb($sinfo);
3939

4040
$res = GetSyncID($conn);

contrib/rserv/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ OBJS = $(NAME).o
1313
DOCS = README.$(NAME)
1414
SQLS = master.sql slave.sql
1515
TCLS = RservTest
16-
PERLS = MasterInit SlaveInit MasterAddTable SlaveAddTable Replicate CleanLog
17-
PERLS += PrepareSnapshot ApplySnapshot GetSyncID SyncSyncID
16+
PERLS = MasterInit MasterAddTable Replicate MasterSync CleanLog
17+
PERLS += SlaveInit SlaveAddTable GetSyncID
18+
PERLS += PrepareSnapshot ApplySnapshot
1819
LIBS = RServ.pm
1920
SCRIPTS = InitRservTest
2021
MODS = $(OBJS:.o=$(DLSUFFIX))

contrib/rserv/SyncSyncID.in renamed to contrib/rserv/MasterSync.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- perl -*-
2-
# SyncSyncID
2+
# MasterSync
33
# Vadim Mikheev, (c) 2000, PostgreSQL Inc.
44

55
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'

contrib/rserv/README.rserv

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ Replicate masterdb slavedb
4848

4949
GetSyncID [--noverbose] slavedb
5050
returns the last syncid the specified slave has seen. May be used
51-
in conjunction with CleanLog using the --noverbose option.
51+
in conjunction with SyncSyncID and CleanLog using the --noverbose
52+
option.
53+
54+
MasterSync masterdb syncid
55+
registers a syncid with the specified master database. Used to
56+
propagate replication success back to the master database.
5257

5358
CleanLog masterdb syncid
5459
removes obsolete entries in the master database replication log

contrib/rserv/SlaveInit.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ sub RollbackAndQuit {
3838
exit (-1);
3939
}
4040

41-
print "Connecting to $sinfo\n";
41+
print("Connecting to $sinfo\n") if ($debug || $verbose);
4242
my $conn = Pg::connectdb($sinfo);
4343
if ($conn->status != PGRES_CONNECTION_OK) {
4444
print STDERR "Failed opening $sinfo\n";

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy