[ic] LockType ignored?

Bill Carr interchange-users@interchange.redhat.com
Wed May 8 16:41:00 2002


Mysql 3.23.47, Linux 2.4.19, Sessions on NFS, LVS-DR (martian patch), ic
4.8.3, (What I am about to say looks the same in 4.8.5 but I have not
installed it yet).

It looks to me that global var LockType is ignored. I was having some
slow page delivery that I thought was flock related. I tried this
command:
#  strace -f /etc/init.d/interchange start 2>&1 | grep -i flock
and saw many flock calls even though interchange.cfg and
interchange.structure reported LockType = fcntl.

I hard coded:
$lock_function = \&fcntl_lock;
$unlock_function = \&fcntl_unlock;
in Vend::Util.pm and ran the above command and did not see any more
flock calls.

Vend::Util.pm around 1185 there is:
sub set_lock_type {
	if ($Global::LockType eq 'none') {
		logDebug("using NO locking");
		$lock_function = sub {1};
		$unlock_function = sub {1};
	}
	elsif ($Global::LockType =~ /fcntl/i) {
		logDebug("using fcntl(2) locking");
		$lock_function = \&fcntl_lock;
		$unlock_function = \&fcntl_unlock;
	}
	else {
		$lock_function = \&flock_lock;
		$unlock_function = \&flock_unlock;
	}
	return; # VOID
}
 
sub lockfile {
    &$lock_function(@_);
}

sub unlockfile {
    &$unlock_function(@_);
}

### Still necessary, sad to say.....
if($Global::Windows) {
	set_lock_type('none');
}
elsif($^O =~ /hpux/) {
	set_lock_type('fcntl');
}

1. It looks like set_lock_type should be called if $Global::LockType but
is not.

2. set_lock_type is called with a parameter that is ignored.

I have been having intermittent slow results and timeouts for over two
months. I have been trying everything I can think of to solve the
problem: more RAM, more CPUs, better IC coding, optimizing mysqld,
optimizing my queries, change LVS-NAT to LVS-DR. I hope this is
something that will help my situation.


-- 
Bill Carr
Worldwide Impact
bill@worldwideimpact.com
413-253-6700