130 |
|
|
131 |
my $masterId = 0; |
my $masterId = 0; |
132 |
if ($multiplemaster || $slaveId == 0) { |
if ($multiplemaster || $slaveId == 0) { |
133 |
$masterId = GetServerId($sconn, $master, $masterhost); |
$masterId = GetServerId($mconn, $master, $masterhost); |
134 |
|
|
135 |
die "\n>>>>>>>>>>>>> ERROR: Can't GetServerId for $sinfo\n" if (! defined($masterId)); |
die "\n>>>>>>>>>>>>> ERROR: Can't GetServerId for $sinfo\n" if (! defined($masterId)); |
136 |
|
|
147 |
open $outf, ">$snapshot"; |
open $outf, ">$snapshot"; |
148 |
print "\n>>>>>>>>>>>>> Prepare Snapshot\n\n" if ($verbose); |
print "\n>>>>>>>>>>>>> Prepare Snapshot\n\n" if ($verbose); |
149 |
print "master id: $masterId slave id: $slaveId\n" if ($debug); |
print "master id: $masterId slave id: $slaveId\n" if ($debug); |
150 |
my $res = PrepareSnapshot($mconn, $sconn, $outf, $masterId, $slaveId, $tables); |
my $res = PrepareSnapshot($mconn, $sconn, $outf, $masterId, $slaveId, $multiplemaster, $tables); |
151 |
close $outf; |
close $outf; |
152 |
if ($res < 0) { |
if ($res < 0) { |
153 |
unlink $fname; |
unlink $fname; |
164 |
my $inpf = new IO::File; |
my $inpf = new IO::File; |
165 |
open $inpf, "<$snapshot"; |
open $inpf, "<$snapshot"; |
166 |
print "\n>>>>>>>>>>>>> Apply Snapshot\n\n" if ($verbose); |
print "\n>>>>>>>>>>>>> Apply Snapshot\n\n" if ($verbose); |
167 |
$res = ApplySnapshot($sconn, $inpf, $tables); |
$res = ApplySnapshot($sconn, $inpf, $multiplemaster, $tables); |
168 |
close $inpf; |
close $inpf; |
169 |
if ($res < 0) { |
if ($res < 0) { |
170 |
unlink $fname; |
unlink $fname; |