Mark Leith wrote:
Paul DuBois wrote:
At 8:46 PM -0400 5/2/07, Baron Schwartz wrote:
Ofer Inbar wrote:
That's a good point, though probably a minor one: At most you would
end up with one binary logfile that's "old" and not deleted. As soon
as you create a new one, that one would be deleted (if this feature
works).
In our case, we flush logs nightly. (but hardly ever restart mysqld)
-- Cos
We roll many logs every day, but never restart unless we have to. So
for us, it looked like it genuinely wasn't working on roll; I have no
idea about restart.
I have a 4.1.13 server that's been up for 100 days. It has
expire_logs_days,
and I have 7 binlog files. I do flush my logs once a day to force the
logs
to rotate.
So that's one confirmation that it works, at least in 4.1.13. :-)
This seems to work just fine on 5.0.40 as well:
medusa:/usr/local/mysql/data root# ls -l
total 58352
-rw-rw---- 1 mysql wheel 5242880 May 3 10:49 ib_logfile0
-rw-rw---- 1 mysql wheel 5242880 May 2 22:27 ib_logfile1
-rw-rw---- 1 mysql wheel 18874368 May 3 10:47 ibdata1
-rw-rw---- 1 mysql wheel 102514 May 3 10:55 medusa-bin.000001
-rw-rw---- 1 mysql wheel 102517 May 3 10:55 medusa-bin.000002
-rw-rw---- 1 mysql wheel 102517 May 3 10:55 medusa-bin.000003
-rw-rw---- 1 mysql wheel 102517 May 3 10:56 medusa-bin.000004
-rw-rw---- 1 mysql wheel 81473 May 3 10:56 medusa-bin.000005
-rw-rw---- 1 mysql wheel 375 May 3 10:56 medusa-bin.index
-rw-rw---- 1 mysql wheel 5 May 3 10:49 medusa.pid
drwxr-x--- 53 mysql wheel 1802 May 2 22:26 mysql
drwxr-x--- 9 mysql wheel 306 May 3 10:52 test
medusa:/usr/local/mysql/data root# cat /etc/my.cnf
[mysqld]
log-bin
max_binlog_size = 100K
expire_logs_days = 2
medusa:/usr/local/mysql/data root# date Thu May 3 10:58:22 BST 2007
medusa:/usr/local/mysql/data root# date
Sun May 6 10:58:42 BST 2007
medusa:/usr/local/mysql/data root# while [ 1 ]
> do
> mysql -u root test -e 'insert into binlog_test (i,j) values (1,1)'
> done
^C
medusa:/usr/local/mysql/data root# ls -l
total 57888
-rw-rw---- 1 mysql wheel 5242880 May 3 10:49 ib_logfile0
-rw-rw---- 1 mysql wheel 5242880 May 2 22:27 ib_logfile1
-rw-rw---- 1 mysql wheel 18874368 May 3 10:47 ibdata1
-rw-rw---- 1 mysql wheel 102517 May 6 10:59 medusa-bin.000005
-rw-rw---- 1 mysql wheel 102517 May 6 10:59 medusa-bin.000006
-rw-rw---- 1 mysql wheel 55853 May 6 10:59 medusa-bin.000007
-rw-rw---- 1 mysql wheel 225 May 6 10:59 medusa-bin.index
-rw-rw---- 1 mysql wheel 5 May 3 10:49 medusa.pid
drwxr-x--- 53 mysql wheel 1802 May 2 22:26 mysql
drwxr-x--- 9 mysql wheel 306 May 3 10:52 test
I declare 'No Bug Here' :) At least on the current versions of 5.0
(tested on 5.0.40), anyway.
I will test again on my servers now that I have upgraded to 5.0.38. One
question for people for whom expire_logs_days DOES work: do you have any slaves
connected to the server?
Thanks
Baron
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]