On 5/4/07, Baron Schwartz <[EMAIL PROTECTED]> wrote:

Hi,

Jake Peavy wrote:
> On 5/4/07, Baron Schwartz <[EMAIL PROTECTED]> wrote:
>>
>> Mark Leith wrote:
>> > Baron Schwartz wrote:
>> >> 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?
>> >>
>> >
>> > I did not within my test. I could easily add that if need be
however..
>> > Let me know if your testing does show that it's not working for you.
>>
>> I think we've found the bug.  I just did a bunch of tests and I'm 99%
>> sure
>> not only
>> does expire_logs_days not work if there are slaves attached, neither
does
>> PURGE MASTER
>> LOGS.  When I read my email this morning, Nagios alerted me the master
>> server was over
>> the expected disk usage, and I looked at the disk and saw our nightly
>> PURGE MASTER LOGS
>> job hasn't been working.
>>
>> http://bugs.mysql.com/28238
>>
>
> It seems to me that some communication is neccessary in the case of
> replication -- you wouldn't want to purge MASTER logs if the slave
hadn't
> parsed them yet.
>
> Perhaps this is why the feature is disabled in this case.

Not according to
http://dev.mysql.com/doc/refman/5.0/en/purge-master-logs.html:

"This statement is safe to run while slaves are replicating. You do not
need to stop
them. If you have an active slave that currently is reading one of the
logs you are
trying to delete, this statement does nothing and fails with an error."


Yes, this quote refers to file locking/concurrent access to the bin files.

What I was getting at is if the slave has fallen behind and hasn't yet
parsed some particular bin files, you wouldn't want to remove them from the
master until the slave I/O thread was able to parse them.  Otherwise your
slave would lose those database changes and thus be out of sync.

When purging master logs in a replicated setup one must first examine the
result of SHOW SLAVE STATUS and only PURGE MASTER LOGS up to the log
indicated by Master_Log_File.

--
-jp


Chuck Norris frequently donates blood to the Red Cross. Just never his own.

Reply via email to