Bug #49450 open_files count doesn't decremented after DROP TABLE if mysqld got error 24
Submitted: 4 Dec 2009 9:43 Modified: 7 Dec 2009 10:57
Reporter: Sveta Smirnova Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1 bzr OS:Any
Assigned to: CPU Architecture:Any

[4 Dec 2009 9:43] Sveta Smirnova
Description:
When tried to repeat bug #29071 I noticed strange behavior: if set ulimit -n to some low value, then run test for bug #29071, then drop table and run show global status like '%open_files%'; value of open_files not decremented.

If no error 24 got before this value decremented.

Modified test will be uploaded shortly.

This can show problem with counters.

How to repeat:
1. Run test uploaded
2. Get results like:

set global table_open_cache=100;
show global status like '%open_files%';
Variable_name   Value
Open_files      4
show global status like '%open_files%';
Variable_name   Value
Open_files      202
show global status where variable_name in ('open_files');
Variable_name   Value
Open_files      202
drop table if exists t90;
drop table if exists t91;
drop table if exists t92;
drop table if exists t93;
drop table if exists t94;
drop table if exists t95;
drop table if exists t96;
drop table if exists t97;
drop table if exists t98;
drop table if exists t99;
show global status like '%open_files%';
Variable_name   Value
Open_files      182
show global status where variable_name in ('open_files');
Variable_name   Value
Open_files      182

Notice value of Open_files decremented.

3. Set ulimit -n 159
4. Run test again
5. Get results like:

set global table_open_cache=100;
show global status like '%open_files%';
Variable_name   Value
Open_files      4
show global status like '%open_files%';
Variable_name   Value
Open_files      142
show global status where variable_name in ('open_files');
Variable_name   Value
Open_files      142
drop table if exists t90;
drop table if exists t91;
drop table if exists t92;
drop table if exists t93;
drop table if exists t94;
drop table if exists t95;
drop table if exists t96;
drop table if exists t97;
drop table if exists t98;
drop table if exists t99;
show global status like '%open_files%';
Variable_name   Value
Open_files      142
show global status where variable_name in ('open_files');
Variable_name   Value
Open_files      142
[4 Dec 2009 9:45] Sveta Smirnova
test case

Attachment: bug29071.test (application/octet-stream, text), 7.24 KiB.

[4 Dec 2009 9:46] Sveta Smirnova
option file

Attachment: bug29071-master.opt (application/octet-stream, text), 38 bytes.

[7 Dec 2009 7:09] Sveta Smirnova
Most likely not a bug - need to check if these tables were really opened.
[7 Dec 2009 10:57] Sveta Smirnova
Not a Bug really - no table opened.