MT#64858 fix check balance record created by B node

we cannot enforce READ COMMITTED with statement-based repl,
as repl cannot lock lock transactions.

therefore 27d39e5 introduced "insert IGNORE contract_balances"
and a subsequent check for the number of modified rows, to
see if the B node added records.

there is a bug with that hwoever, since ->execute returns 0E0
if 0 rows affected, and the RESTART_BALANCE_CATCHUP is not
entered.

Change-Id: Ica862d2e15364e4d627b797cafa35f0be620bfeb
(cherry picked from commit ef1ffede7e)
(cherry picked from commit badf5cc3a7)
mr12.5.1
Rene Krenn 3 months ago
parent d6b9e5a6a3
commit 5807d286ed

@ -1660,8 +1660,9 @@ PREPARE_BALANCE_CATCHUP:
($last_cash_balance) x 2,$last_cash_balance_int,($last_free_balance) x 2,$last_free_balance_int,
((defined $underrun_profiles_time ? $underrun_profiles_time : 0)) x 2,((defined $underrun_lock_time ? $underrun_lock_time : 0)) x 2,$stime);
push(@bind_parms,$etime) if defined $etime;
unless ($sth->execute(@bind_parms)
or FATAL "Error executing new contract balance statement: ".$sth->errstr) {
my $res = $sth->execute(@bind_parms);
FATAL "Error executing new contract balance statement: ".$sth->errstr unless defined $res;
unless ($res > 0) {
$sth->finish;
INFO "cash balance record ($contract_id, $stime) was created elsewhere, starting over";
goto RESTART_BALANCE_CATCHUP;

Loading…
Cancel
Save