Does binlog stay in memory when replication happens?

Does binlog stay in memory when replication happens?

am 27.02.2009 13:04:54 von Cui Shijun

hi,
I wonder if it is safe to assume that binlog can stay in master's
memory when replication happens. If not, when the binlog getts
corruptted, will the slave's binlog also get corrupted?
Is there way to make the slave's binlog survive even in master's disk failure?

Thank you

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Does binlog stay in memory when replication happens?

am 27.02.2009 14:48:20 von Baron Schwartz

On Fri, Feb 27, 2009 at 7:04 AM, Cui Shijun wrote:
> hi,
> =A0I wonder if it is safe to assume that binlog can stay in master's
> memory when replication happens

It's not safe to assume. It varies from system to system depending on
operating system, filesystem, scheduler algorithm, amount of memory on
the machine, and probably a bunch of other variables. The binlog is
first and foremost a file, and any portion of it that happens to be
cached in memory is an operating-system optimization that cannot be
counted on.

What does replication have to do with it?

>. If not, when the binlog getts corruptted, will the slave's binlog also g=
et corrupted?

Slave's binlog? The slave's binlog is not tied to the master's
binlog. I am not sure you understand clearly how replication works.

If the slave reads a corrupt binlog from the master's disk, then the
slave's RELAY log will be corrupt too.

> =A0Is there way to make the slave's binlog survive even in master's disk =
failure?

Again I'm not sure what you are really asking. You might be looking
for the Google synchronous replication patches. Do a web search for
those and read up on what they offer.

--=20
Baron Schwartz, Director of Consulting, Percona Inc.
Our Blog: http://www.mysqlperformanceblog.com/
Our Services: http://www.percona.com/services.html

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

Re: Does binlog stay in memory when replication happens?

am 28.02.2009 12:15:45 von Cui Shijun

hi,
Thank you for your reply :-)

> What does replication have to do with it?
I wonder whether mysql will copy its binlog from memory( if it exists
) then send to slave. I haven't refer to the source codes yet...

> Slave's binlog? =A0The slave's binlog is not tied to the master's
> binlog. =A0I am not sure you understand clearly how replication works.
Yes. I am confused by binlog & RELAY log. Given the data which is
replicated only, will the content( at least SQL ) of the two logs be
the same?

> Again I'm not sure what you are really asking. =A0You might be looking
> for the Google synchronous replication patches. =A0Do a web search for
> those and read up on what they offer.
It helps :-)

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg