Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitec67d2a

Browse files
committed
Back out rserv changes that would allow limit of replicated tables ---
not ready yet.
1 parent111d8e5 commitec67d2a

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

‎contrib/rserv/RServ.pm

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ my %Stables = ();
1919

2020
subPrepareSnapshot
2121
{
22-
my ($conn,$outf,$server,$onlytables) =@_;# (@_[0], @_[1], @_[2]);
22+
my ($conn,$outf,$server) =@_;# (@_[0], @_[1], @_[2]);
2323

2424
my$result =$conn->exec("BEGIN");
2525
if ($result->resultStatusne PGRES_COMMAND_OK)
@@ -52,10 +52,6 @@ sub PrepareSnapshot
5252
while (@row =$result->fetchrow)
5353
{
5454
#printf "$row[0], $row[1], $row[2]\n";
55-
if (ref($onlytables)eq'HASH') {
56-
nextunless (exists$onlytables->{$row[1]});
57-
$onlytables->{$row[1]} =$row[0]unless ($onlytables->{$row[1]});
58-
}
5955
push @{$Mtables{$row[0]}},$row[1],$row[2];
6056
}
6157

@@ -236,7 +232,7 @@ sub GetSYNCID
236232

237233
subCleanLog
238234
{
239-
my ($conn,$howold,$onlytables) =@_;# (@_[0], @_[1]);
235+
my ($conn,$howold) =@_;# (@_[0], @_[1]);
240236

241237
my$result =$conn->exec("BEGIN");
242238
if ($result->resultStatusne PGRES_COMMAND_OK)
@@ -278,11 +274,6 @@ sub CleanLog
278274
my$alist =join(',',keys%active);
279275
my$sinfo ="logid <$maxid";
280276
$sinfo .=" and logid not in ($alist)"if$alistne'';
281-
#if (ref($onlytables) eq 'HASH') {
282-
#foreach my $onlytable (keys %{$onlytables}) {
283-
#$sinfo
284-
#}
285-
#}
286277

287278
$sql ="delete from _RSERV_LOG_ where" .
288279
"logtime < now() - '$howold second'::interval and$sinfo";
@@ -311,7 +302,7 @@ sub CleanLog
311302

312303
subApplySnapshot
313304
{
314-
my ($conn,$inpf,$onlytables) =@_;# (@_[0], @_[1]);
305+
my ($conn,$inpf) =@_;# (@_[0], @_[1]);
315306

316307
my$result =$conn->exec("BEGIN");
317308
if ($result->resultStatusne PGRES_COMMAND_OK)
@@ -345,10 +336,6 @@ sub ApplySnapshot
345336
while (@row =$result->fetchrow)
346337
{
347338
#printf "%s%s\n", $row[1], $row[0];
348-
if (ref($onlytables)eq'HASH') {
349-
nextunless (exists$onlytables->{$row[1]});
350-
$onlytables->{$row[1]} =$row[0]unless ($onlytables->{$row[1]});
351-
}
352339
push @{$Stables{$row[1]}},$row[0],$row[2],$row[3];
353340
}
354341

‎contrib/rserv/Replicate.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ if (defined($opt_help) || (scalar(@ARGV) < 2)) {
3232

3333
my$master =$ARGV[0] ||"master";
3434
my$slave =$ARGV[1] ||"slave";
35-
my$tables =$#ARGV < 2 ?undef : {map {($_,undef)}@ARGV[2..$#ARGV] };
3635
my$server = 0;
3736

3837
my$minfo ="dbname=$master";
@@ -57,7 +56,7 @@ SyncSync($mconn, $sconn);
5756
my$outf = new IO::File;
5857
open$outf,">$snapshot";
5958
print"\n>>>>>>>>>>>>> Prepare Snapshot\n\n"if ($verbose);
60-
$res = PrepareSnapshot($mconn,$outf,$server,$tables);
59+
$res = PrepareSnapshot($mconn,$outf,$server);
6160
close$outf;
6261
die"\n>>>>>>>>>>>>> ERROR\n"if$res < 0;
6362
if ($res == 0)
@@ -69,7 +68,7 @@ if ($res == 0)
6968
my$inpf = new IO::File;
7069
open$inpf,"<$snapshot";
7170
print"\n>>>>>>>>>>>>> Apply Snapshot\n\n"if ($verbose);
72-
$res = ApplySnapshot($sconn,$inpf,$tables);
71+
$res = ApplySnapshot($sconn,$inpf);
7372
close$inpf;
7473
die"\n>>>>>>>>>>>>> ERROR\n"if$res < 0;
7574

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp