List:Internals« Previous MessageNext Message »
From:Jeremy Cole Date:February 28 2006 10:42pm
Subject:MySQL's locking schemes due for an upgrade?
View as plain text  
Hi Heikki, All,

Isn't it time that MySQL's naive locking scheme was cleaned up?

Based on this bug: http://bugs.mysql.com/bug.php?id=16229

It seems like it would make more sense to reverse the locking procedures 
in MySQL and their handling by the storage engines.  As I understand it, 
currently MySQL asks for a table lock in all cases and the storage 
engine (InnoDB, in this case) may downgrade that to a row lock.

Wouldn't it make far more sense for MySQL to ask for a row lock, and the 
storage engine (MyISAM, in this case) to upgrade that to a page lock, 
table lock, etc. as support is available?  Basically MySQL should ask 
the storage engine for the most granular lock possible, and the storage 
engine should upgrade that lock if it is unable to lock with that 
granularity.

It seems like as new features are added, more "stupid" mistakes like 
this will occur, if the current locking scheme is kept.  It also seems 
that storage engines downgrading locks on a whim may introduce more 
serious bugs in the future.

Regards,

Jeremy

-- 
Jeremy Cole
MySQL Geek, Yahoo! Inc.
Desk: 408 349 5104
Thread
MySQL's locking schemes due for an upgrade?Jeremy Cole28 Feb
  • Re: MySQL's locking schemes due for an upgrade?Heikki Tuuri2 Mar
  • Re: MySQL's locking schemes due for an upgrade?Konstantin Osipov30 Mar
    • Re: MySQL's locking schemes due for an upgrade?Jeremy Cole31 Mar
      • Re: MySQL's locking schemes due for an upgrade?SGreen31 Mar
      • Re: MySQL's locking schemes due for an upgrade?Konstantin Osipov31 Mar