15 messages in com.mysql.lists.internalsRe: Adding new flush commands
FromSent OnAttachments
Eric Bergen12 May 2008 20:03 
Sergei Golubchik13 May 2008 00:15 
Rick James13 May 2008 10:15 
Eric Bergen15 May 2008 10:32 
Rick James15 May 2008 10:47 
Eric Bergen15 May 2008 13:30 
Rick James15 May 2008 13:39 
Rick James15 May 2008 13:44 
Eric Bergen15 May 2008 14:38 
Mark Callaghan16 May 2008 00:44 
Eric Bergen18 May 2008 20:04 
Sergei Golubchik18 May 2008 22:48 
Eric Bergen19 May 2008 09:33 
Eric Bergen21 May 2008 19:56 
Eric Bergen25 Oct 2008 12:33 
Subject:Re: Adding new flush commands
From:Eric Bergen (er@provenscaling.com)
Date:05/15/2008 01:30:52 PM
List:com.mysql.lists.internals

I think it should rotate after N bytes like the binlog. It can also be rotated with it's own flush slow log; command. I don't know how useful a flush binary log and slave stop sql will be since it will stop all slaves.

On Thu, May 15, 2008 at 10:47 AM, Rick James <rja@yahoo-inc.com> wrote:

:)

I would like the slowlogs rotated; numbered is fine.

When to rotate slowlog? * After N bytes (a la binlog) ? * On demand -- In this case, would not like it tied to other logs: I might want
to rotate the slowlogs daily, but never explicitly rotate any other logs. * On restart ? Once there is rotation, this seems ok. (No strong opinion.)

General log * would like to turn on/off without restarting server * "rotation" with numbered files would be nice * Again, would not like it to be tied to any other flush.

FLUSH LOGS -- command to flush all -- ok FLUSH [SLOW|GENERAL|BIN|...] LOG -- flush one log.

Also, I would like FLUSH BIN LOG to be optionally replicated! This would lead
to some interesting tricks for taking snapshots and/or pointing a slave to a
different master. Think about it; this would easily give you a precise
position. [I think]

Maybe this combo as an atomic operation FLUSH BINLOG AND SLAVE STOP SQL; would be 'necessary' for the idea I presented above.

-----Original Message----- From: eric@provenscaling.com [mailto:eric@provenscaling.com] On Behalf Of Eric Bergen Sent: Thursday, May 15, 2008 10:32 AM To: Rick James Cc: Internals List Subject: Re: Adding new flush commands

Rick,

Flush slow logs (soon to be log or logs) is in the patch below. There is a problem in that the slow query log can be flushed but there isn't any code to rotate it. A flush reopens the file with a new header. In a separate patch I'm going to update the slow, general, and error logs so they rotate in numbered files like the binary logs. What do you think?

On Tue, May 13, 2008 at 10:15 AM, Rick James <rja@yahoo-inc.com> wrote:

FLUSH SLOW LOG; please

-----Original Message----- From: Sergei Golubchik [mailto:se@mysql.com] Sent: Tuesday, May 13, 2008 12:16 AM To: Eric Bergen Cc: Internals List Subject: Re: Adding new flush commands

Hi!

On May 12, Eric Bergen wrote:

Hi,

I'm trying to split the flush logs command into several different flush commands. Examples are; flush binary log; flush relay log;

My problem is that when I add the log symbol the new commands work but the log function is disabled with a parse error:

mysqltest: At line 495: query 'select log()' failed with wrong errno 1064: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '()' at line 1', instead of 1582...

If I change the commands to flush binary logs (as in the patch below) it works great.

Is there something special I have to define to prevent my log symbol from conflicting with the log function?

Yes :( You need to remove LOG function from item_create.cc and add an explicit rule for it in sql_yacc.yy. See rules function_call_keyword, function_call_nonkeyword, function_call_generic, function_call_conflict there.

Regards / Mit vielen Grüssen, Sergei