Maybe i got it! For the chronicle:

I resolved the problem decreasing the max_bdb_lock to the default value
and creating an index on the column used in the where clause of my
query. Probably mysql tried to lock the whole table because the primary
key wasn't in the where clause.

Cheers,
Marco

Marco Baroetto wrote:

>Hi, here's my create table:
>
>mysql> show create table parametrivaloriplc;
>+--------------------+-----------------------------------------+
>| Table              | Create Table                            |
>+--------------------+-----------------------------------------+
>| parametrivaloriplc | CREATE TABLE `parametrivaloriplc` (
>  `idParametroPLC` int(11) NOT NULL auto_increment,
>  `name` varchar(100) NOT NULL default '',
>  `idDataType` int(11) NOT NULL default '0',
>  `unit` varchar(20) default NULL,
>  `molt` int(11) default NULL,
>  `div` int(11) default NULL,
>  `accesso` char(3) NOT NULL default '',
>  `idCategoriaParametriPLC` int(11) NOT NULL default '0',
>  `max` int(11) default NULL,
>  `min` int(11) default NULL,
>  `idParametroPadre` int(11) default NULL,
>  `idParametroMax` int(11) default NULL,
>  `idParametroMin` int(11) default NULL,
>  `invalidable` tinyint(1) default NULL,
>  `id_centralina` int(10) unsigned NOT NULL default '0',
>  `valore` varchar(50) NOT NULL default '',
>  PRIMARY KEY  (`idParametroPLC`)
>) ENGINE=BerkeleyDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC |
>+--------------------+-----------------------------------------+
>1 row in set (0.00 sec)
>
>Tonight i had the following unexpected restart, may it be caused by the
>high value of bdb_max_lock?
>
>---------------
>mysqld got signal 11;
>This could be because you hit a bug. It is also possible that this binary
>or one of the libraries it was linked against is corrupt, improperly built,
>or misconfigured. This error can also be caused by malfunctioning hardware.
>We will try our best to scrape up some info that will hopefully help
>diagnose
>the problem, but since we have already crashed, something is definitely
>wrong
>and this may fail.
>
>key_buffer_size=8388600
>read_buffer_size=131072
>max_used_connections=12
>max_connections=100
>threads_connected=2
>It is possible that mysqld could use up to
>key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections
>= 225791 K
>bytes of memory
>Hope that's ok; if not, decrease some variables in the equation.
>
>thd=0x9964008
>Attempting backtrace. You can use the following information to find out
>where mysqld died. If you see no messages after this, something went
>terribly wrong...
>Cannot determine thread, fp=0xae3fa304, backtrace may not be correct.
>Stack range sanity check OK, backtrace follows:
>0x813198c
>0x8a07c8
>0x82770aa
>0x82770aa
>0x827651c
>0x8276adb
>0x824ee13
>0x824f6d2
>0x824fb82
>0x81b6566
>0x81a8bac
>0x81855fa
>0x814514a
>0x8148dfa
>0x8149638
>0x814a263
>0x814ab5a
>0x89a341
>0x71a6fe
>New value of fp=(nil) failed sanity check, terminating stack trace!
>Please read http://dev.mysql.com/doc/mysql/en/Using_stack_trace.html and
>follow instructions on how to resolve the stack trace. Resolved
>stack trace is much more helpful in diagnosing the problem, so please do
>resolve it
>Trying to get some variables.
>Some pointers may be invalid and cause the dump to abort...
>thd->query at 0x996d548 = delete from parametrivaloriplc where
>id_centralina=343
>thd->thread_id=1
>The manual page at http://www.mysql.com/doc/en/Crashing.html contains
>information that should help you find out what is causing the crash.
>
>Memory status:
>Non-mmapped space allocated from system: 6262784
>Number of free chunks:                   18
>Number of fastbin blocks:                0
>Number of mmapped regions:               11
>Space in mmapped regions:                86974464
>Maximum total allocated space:           0
>Space available in freed fastbin blocks: 0
>Total allocated space:                   5625120
>Total free space:                        637664
>Top-most, releasable space:              133336
>Estimated memory (with thread stack):    93433856
>
>Number of processes running now: 0
>051209 01:00:31  mysqld restarted
>051209  1:00:32  InnoDB: Database was not shut down normally!
>InnoDB: Starting crash recovery.
>InnoDB: Reading tablespace information from the .ibd files...
>InnoDB: Restoring possible half-written data pages from the doublewrite
>InnoDB: buffer...
>051209  1:00:33  InnoDB: Starting log scan based on checkpoint at
>InnoDB: log sequence number 0 52400171.
>InnoDB: Doing recovery: scanned up to log sequence number 0 52400171
>051209  1:00:33  InnoDB: Flushing modified pages from the buffer pool...
>051209  1:00:33  InnoDB: Started; log sequence number 0 52400171
>051209  1:00:33 [Warning] Can't open and lock time zone table: Table
>'mysql.time_zone_leap_second' doesn't exist trying to live without them
>/usr/libexec/mysqld: ready for connections.
>Version: '4.1.12'  socket: '/var/lib/mysql/mysql.sock'  port: 3306 
>Source distribution
>------------------------------
>
>
>More details about my environment follows:
>
># cat /proc/version
>Linux version 2.6.9-22.0.1.ELsmp ([EMAIL PROTECTED]) (gcc version
>3.4.4 20050721 (Red Hat 3.4.4-2)) #1 SMP Thu Oct 27 13:14:25 CDT 2005
>
># mysql --version
>mysql  Ver 14.7 Distrib 4.1.12, for redhat-linux-gnu (i686) using
>readline 4.3
>
># cat /etc/init.d/mysqld
> /usr/bin/mysqld_safe  --defaults-file=/etc/my.cnf
>--pid-file="$mypidfile" -O bdb_max_lock=120000 >/dev/null 2>&1 &
>
># cat /etc/my.cnf
>[mysqld]
>datadir=/var/lib/mysql
>socket=/var/lib/mysql/mysql.sock
># Default to using old password format for compatibility with mysql 3.x
># clients (those using the mysqlclient10 compatibility package).
>old_passwords=1
>
>[mysql.server]
>user=mysql
>basedir=/var/lib
>
>[mysqld_safe]
>err-log=/var/log/mysqld.log
>pid-file=/var/run/mysqld/mysqld.pid
>
>
># ps aux|grep mysqld
>root     12811  0.0  0.0  5420 1080 ?        S    Nov30   0:00 /bin/sh
>/usr/bin/mysqld_safe --defaults-file=/etc/my.cnf
>--pid-file=/var/run/mysqld/mysqld.pid -O bdb_max_lock=120000
>mysql     9184 33.6  3.3 179136 70148 ?      Sl   01:00 177:45
>/usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr
>--datadir=/var/lib/mysql --user=mysql
>--pid-file=/var/run/mysqld/mysqld.pid --skip-locking
>--socket=/var/lib/mysql/mysql.sock -O bdb_max_lock=120000
>
>
>Any hint?
>
>
>Thank you,
>Marco
>
>
>
>Jim Winstead wrote:
>
>  
>
>>On 12/7/05, Marco Baroetto <[EMAIL PROTECTED]> wrote:
>> 
>>
>>    
>>
>>>Hi,
>>>I have a berkeley db table containing about 50000 rows where I do this
>>>transaction (pseudocode follows):
>>>
>>>begin work
>>>delete from mytable where myfield='boo' /*delete about 100 rows*/
>>>for (i=0; i<=100; i++){
>>>insert into mytable values(...);
>>>}
>>>commit
>>>
>>>During the insert command i get the following error:
>>>"Lock table is out of available locks"
>>>
>>>I tried to resolve the problem starting mysqld with -O
>>>bdb_max_lock=60000  and later with -O bdb_max_lock=120000 but i still
>>>receive the same error.
>>>   
>>>
>>>      
>>>
>>Hi Marco.
>>
>>What does 'SHOW CREATE TABLE' look like for your table?
>>
>>You may want to file a bug about this and attach your data and the
>>actual queries being run. I was not able to come up with a test case to
>>reproduce this problem, but you haven't provided much information to go
>>on.
>>
>>Jim Winstead
>>MySQL Inc.
>>

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to