The MySQL Utilities team is happy to introduce a new MySQL
utility named ‘mysqlbinlogpurge‘, which allows users to
easily and safely purge binary logs on a master by determining
the binary logs that are obsolete. This utility is included in
MySQL Utilities
release-1.6.1 Alpha release along with ‘mysqlslavetrx‘ and ‘mysqlbinlogrotate‘. This utility enables you
to purge binary logs by ensuring that any files which are in use
or required by any of the slaves in a replication topology are
not deleted. This is achieved by
checking which binary logs have been read on each slave. This
determines the minimal set of binary log files that …
We are very happy to introduce a new MySQL utility named
'mysqlbinlogmove', which is used to relocate binary log files.
This utility is one of two new utilities included in MySQL
Utilities release-1.6.0 Alpha. The other utility is
'mysqlgrants', which is used to display the privileges (grants)
of database objects.
Note: I use "binary log" to refer to both "kinds" of binary log
files (binlog and relay log files) in general, and use "binlog"
to refer specifically to those that are not "relay log"
files.
The mysqlbinlogmove utility allows you to move binary log files
to a new location taking care of correctly updating the
respective index file for you. This utility can be very useful if
you want to change the location to store the binlog file and you
want to move all of the binary log files. It is also handy to
archive older binary log files to a new location thereby saving
disk space in the server's partition.
…
We are very happy to introduce a new MySQL utility named “mysqlbinlogmove“, which is used to relocate binary log files. This utility is one of two new utilities included in MySQL Utilities release-1.6.0 Alpha. The other utility is “mysqlgrants“, which is used to display the privileges (grants) of database objects.
Note: I use “binary log” to refer to both “kinds” of binary log files (binlog and relay log files) in general, and use “binlog” to refer specifically to those that are not “relay log” files.
The mysqlbinlogmove utility allows you to move binary log files to a new location taking care of correctly updating the respective index file for you. This utility can be very useful if you want to change the location to store the binlog file and you want to move all of the binary log files. It is also handy to archive older binary log files to a new location thereby saving disk …
[Read more]In the first part of this article we examined the types of conflicts and their causes. In this part, we will analyse some of the methods available to deal with conflicts.
Pessimistic locking (or: conflicts won't happen)
Applicability: synchronous clusters with 2pc
We've covered this topic in the previous article, but it's worth repeating. If you use a synchronous cluster, you don't have conflicts. For example, MySQL Cluster ensures consistent data with updates coming from different nodes. However, MySQL Cluster is not a replacement for a MySQL server, and it has severe limitations.
Optimistic locking
Applicability: synchronous clusters without 2pc (Galera)
Conflicting transactions proceed on different nodes with local locking. The last one then …
[Read more]With the release of MySQL 5.6 binary log group commit is included, which is a feature focused on improving performance of a server when the binary log is enabled. In short, binary log group commit improve performance by grouping several writes to the binary log instead of writing them one by one, but let me digress a little on how transactions are logged to the binary log before going into the details. Before going into details about the problem and the implementation, let look at what you do to turn it on.
Nothing.
Well... we actually have a few options to tweak it, but nothing
required to turn it on. It even works for existing engines since
we did not have to extend the handlerton interface to implement
the binary log group commit. However, InnoDB has some
optimizations to take advantage of the binary log group commit
implementation.
-
binlog_order_commits={0|1}
- This is a …
When using the replication slave stream, or mysql command line client and mysqlbinlog output from a binary/relay log, all statements are executed in a single thread as quickly as possible.
I am seeking a tool to simulate the replay of the binary/relay log for a benchmark at a pace that is more representative to original statements. For a simple example, if the Binary Log has 3 transactions in the first second, 2 transactions in the second second, and 5 transactions in the third second, I am wanting to simulate the replay to take roughly 3 seconds, not as fast as possible (which would be sub-second). The tool should try to wait the remainder of a second before processing SQL statements in the incoming stream.
Does anybody know of a tool that currently provides this type of functionality? Any input appreciated before I create my own.
Even when the output of EXPLAIN doesn’t show “using temporary”, a temporary file may still be used in certain cases.
That’s not to say the query needs the temporary file to actually resolve the query (like what you’d see from the need for a derived table). But rather, the temporary file I’m speaking of is due to binary logging.
In particular, you can see this easily if using InnoDB, (most
commonly) row-based binary logging, and you issue a
large transaction, say a large UPDATE
(large meaning
something larger than the size of binlog_cache_size). In this case, you’ll
notice a temporary file being …
BackgroundNormally, I would use a comment. The first thing I
would think is
CREATE PROCEDURE p1(i int) select "hello" /* This is my
text */
But most client libraries will strip it.
There was a …
A few days ago, a friend of mine asked me if I knew of a way of
filtering a bunch of binary logs, to extract only statements
related to a single table. The task was about filtering a few
hundred binary log files.
It's a tricky problem. Even with my experience with regular
expressions, I knew that using a script to extract statements
related to a single table was going to be a nasty business.
However, I know of an entity that can filter by table name
efficiently, and that's the MySQL replication system. So I
suggested using replication to a sandbox with a
replicate-wild-do-table statement to get the job done.
My friend was skeptical and did not want to go that way. I was
busy writing an article for an Italian magazine and did not
follow up immediately. But today, with the article safely in the
editor's hands, I did a quick test, and guess what? It
works!
Here is a step-by-step procedure to do it. I started …
This is the second in a series on what's seriously limiting MySQL in certain circumstances (links: part 1). In the first part, I wrote about single-threaded replication. Upstream from the replicas is the primary, which enables replication by writing a so-called "binary log" of events that modify data in the server. The binary log is a real limitation in MySQL.
The binary log is necessary not only for replication, but for point-in-time recovery, too. Given a backup and the corresponding binary log position, you can replay the binary log and roll forward the state of your server to a desired point in time.
But enabling the binary log reduces MySQL's performance dramatically. It is not the logging itself that's the problem -- writing the log is usually not much additional work. It's ensuring consistency and …
[Read more]