Shinguz's blog
Which table is hit by an InnoDB page corruption?
Submitted by Shinguz on Mon, 2010-08-02 16:49InnoDB is known to have crash-recovery capabilities and thus is called a crash safe storage engine (in contrary to MyISAM). Never the less under certain circumstances it seems like InnoDB pages can get corrupt during a crash and then a manual crash-recovery is needed.
MySQL Cluster Local Checkpoint (LCP) and Global Checkpoint (GCP)
Submitted by Shinguz on Thu, 2010-07-29 15:29MySQL Cluster is mainly an in-memory database. Nevertheless it requires a good I/O system for writing various different information to disk.
The information MySQL Cluster writes to disk are the:
- Global Checkpoints (GCP) which are the transactions.
- Local Checkpoints (LCP) which is a dirty image of the data.
- Backup.
In the following schema (a 2-node Cluster) you can see what is related to each other:

Please find here the meaning of each parameter:
How the MySQL Optimizer with MySQL Cluster is cheating you...
Submitted by Shinguz on Mon, 2010-05-17 19:10At a customer we had a nice example of how the MySQL Optimizer is cheating when used in combination with the MySQL Cluster. The customer had queries running not too slow in the development environment but when he tried them on the acceptance test environment (with more data) the query was running much too long which was unacceptable because this query can occur many times per second.
FromDual - The MySQL consulting company goes operational today!
Submitted by Shinguz on Mon, 2010-03-01 12:11Hello everybody,
One month earlier than planned we have the great pleasure to announce you that the company called FromDual goes operational today!
We are excited about this step and it is an new era in our personal evolution to get back in full-contact with customers and solve their real life day-to-day MySQL problems.
So we are happy hearing from you and to help you solving your individual MySQL problems...
You can find us at FromDual or you can drop us a line.
Regards,
Oli
Logging users to the MySQL error log
Submitted by Shinguz on Mon, 2010-02-15 16:18Problem
A customer recently showed up with the following problem:
With your guidelines [1] I am now able to send the MySQL error log to the syslog and in particular to an external log server.
But I cannot see which user connects to the database in the error log.
How can I achieve this?
Idea
During night when I slept my brain worked independently on this problem and in the morning he had prepared a possible solution for it.
What came out is the following:
- We create an UDF which allows an application to write to the MySQL error log.
Can you trust your backup?
Submitted by Shinguz on Thu, 2010-02-11 22:06Today a customer with corrupted data files showed up. When we enquired a bit more he told us that he had a broken I/O controller. This is one of the worst things which can happen to you!
The reason is the following: When a I/O controller starts to die it often does not happen immediately. The controller dies slowly producing more and more corrupt data. When you just write data without checking or reading them it can take days or even weeks until you discover the problem.
But the nasty thing is, that even your backup is infected with the corrupted data.
What is CHECK TABLE doing with InnoDB tables?
Submitted by Shinguz on Fri, 2010-01-29 21:37Recently we had a case where a customer got some corrupted blocks in his InnoDB tables. His largest tables where quite big, about 30 to 100 Gbyte. Why he got this corrupted blocks we did not find out yet (disk broken?).
When you have corrupted blocks in InnoDB, it is mandatory to get rid of them again. Otherwise your database can crash suddenly.
If you are lucky only "normal" tables are concerned.
MySQL on VMware Workstation/DRBD vs. VMWare ESX Server/SAN
Submitted by Shinguz on Fri, 2010-01-22 17:05Or an active-active fail-over cluster à la VMware.
Today I have learned about a totally crazy/cool looking architecture where the expensive VMware ESX server was replace by a free/cheap VMware Workstation version in combination with DRBD.
Basically DRBD we name "the little man's SAN" and that is exactly what this customer is doing. He replaced the SAN with DRBD and now he can easily move one VMware instance to the other host.
The battle against Oracle is probably over but has the real war begun yet?
Submitted by Shinguz on Wed, 2010-01-20 09:36According to different sources from the web the decision about the Oracle - Sun merger has been approved by the European commission soon. So at least in the West it is clear what is going on. Let us see what the East decides... [1], [2].
Oracles arch-enemy Microsoft has already brought its weapons in position against the target with its: "Microsoft offers Oracle-phobes MySQL migration tool" [3], [4]. So far so good.
MySQL reporting to syslog
Submitted by Shinguz on Thu, 2010-01-07 10:20There are 2 different possible situations you can face when you have to deal with MySQL and syslog:
- MySQL is used as back-end for syslog to store the logging information. [6]
- MySQL itself should report to the syslog.
In this blog article we look at the second situation: How can you make MySQL reporting to the syslog.
Since the version 5.1.20 MySQL is capable to log to the syslog [1], [2].
My wish for the New Year: MySQL DBA's, please install iostat on your servers!
Submitted by Shinguz on Wed, 2009-12-30 14:00Iostat is a very handy tool to help you investigating what kind of performance problems you have. Especially your databases can cause a lot of troubles to your I/O system and thus it would be very nice if every DBA has installed iostat on all of his MySQL database servers.
MySQL useful add-on collection using UDF
Submitted by Shinguz on Mon, 2009-10-19 10:14I really like this new toy (for me) called UDF. So I try to provide some more, hopefully useful, functionality.
The newest extension I like is the possibility to write to the MySQL error log through the application. Oracle can do that since long. Now we can do this as well...
A list of what I have done up to now you can find here:
- Query and change InnoDB spin_wait_delay: udf_spin_wait_delay-5.1.30-linux-i686-glibc23.so (md5 807c6bc09b5dc88a8005788519f2483a, BIN ...
Using MySQL User-Defined Functions (UDF) to get MySQL internal informations
Submitted by Shinguz on Thu, 2009-10-15 19:34In one of my previous posts I was writing about how to read other processes memory [1]. As an example I tried to get the value of the hard coded MySQL internal InnoDB variable spin_wait_delay (srv_spin_wait_delay).
In this example we were using gdb or the operating system ptrace function to retrieve this value. This method has the disadvantage that it is pretty invasive.
When I was working on a customer support case I had the idea to solve this by the much less invasive method of User-Defined Functions (UDF).
Determine in MySQL if we are in summer time or winter time (daylight saving time, DST)
Submitted by Shinguz on Fri, 2009-10-02 10:24Recently a colleague at Sun was asking me if MySQL can tell him to determine if we are currently in summer time or winter time. He was doing some data analysis of his house where he has installed solar panels.
I am not aware of what he wants to do exactly, but possibly he wants all the data in solar time.
Reading other processes memory
Submitted by Shinguz on Fri, 2009-08-14 13:49As you probably have experienced yet MySQL does not always provide all internal information as you might want to have them and as you are used to have from other RDBMS.
MySQL plans to improve this implementing the/a performance schema and its probably already partly done in MySQL 5.4. But who knows when this will be finished and what it contains at all...
What is not provided to me I want to gather myself... But how? Other RDBMS provide interfaces to attach applications directly to their memory to retreive information. But MySQL does not.
MySQL licenses for dummies
Submitted by Shinguz on Tue, 2008-12-23 12:03The following summary shows my personal understanding of MySQL 5.1 licenses, packages and products. It does not necessarily reflect 100% the way MySQL understands it.
Why does MySQL Cluster takes so long for --initial?
Submitted by Shinguz on Thu, 2008-11-13 21:43This week we had a very interesting problem at a customer: They complained, that their MySQL Cluster takes about 1 hour for a --initial start-up. After some tuning on the hardware and the config.ini they brought it down to around 40 minutes. But this is still unacceptable long...
This sounds a little strange to me. But let us have a look at their config.ini first.
MySQL Multi-Master – Single-Slave – Replication (Episode 2)
Submitted by Shinguz on Mon, 2008-10-13 15:17Introduction
One of the features that make MySQL so great is its easy replication set-up. If you are experienced and know-how to do it, it takes you about 15 minutes to set-up a slave. What you have in the end is a replication from one master to one or several slaves.
Test application for MySQL high availability (HA) set-up
Submitted by Shinguz on Thu, 2008-10-09 15:25When I set-up a MySQL HA environment for customers I usually do some final fail over tests after configuring the whole beast.
To check if the application behaves like expected I always run my little test application (test.sh) from the server(s) where the customers application runs.
Citation of the week
Submitted by Shinguz on Thu, 2008-09-25 15:02"Das dreieckige Rad hat gegenüber dem viereckigen einen gewaltigen Vorteil: Ein Rumms weniger pro Umdrehung!"
Translation:
"The triangular wheel has one enormous advantage over the quadrangular: One knock less per revolution!"
Maybe not new, but I have not heard it yet and I love it. It was about reinventing functionality in a well known product...
MySQL Cluster: No more room in index file
Submitted by Shinguz on Tue, 2008-09-23 16:18Recently we were migrating an InnoDB/MyISAM schema to NDB.
Possible memory leak in NDB-API applications?
Submitted by Shinguz on Tue, 2008-09-23 13:20A customer has recently experienced a possible memory leak in its NDB-API application. What he did was something like:
# ps aux | grep <pid>
over time and then he saw the RSS increasing. When he would have had a look a little longer he would have seen that the RSS consumption would increase up to a certain level and then becomes stable. Which is the expected behavior.

Active/active fail over cluster with MySQL Replication
Submitted by Shinguz on Fri, 2008-09-05 16:00Electing a slave as new master and aligning the other slaves to the new master
In a simple MySQL Replication set-up you have high-availability (HA) on the read side (r). But for the master which covers all the writes (w) and the time critical read (rt) there is no HA implemented. For some situations this can be OK.
Typical automated MySQL maintenance jobs
Submitted by Shinguz on Mon, 2008-08-25 19:06The following maintenance jobs are typically run against a MySQL database:
- Backup
- Clean-up binary logs
- Optimize tables
- Purge query cache
- Rotate binary logs
Backup
A backup is not a typical maintenance job. But it behaves more or less like one. The backup should be done regularly depending on the restore/PITR (Point in Time Recovery) requirements.
My thoughts about MySQL (Cluster) replication
Submitted by Shinguz on Sat, 2008-06-28 12:00According to Johans wishes I write down my concerns about MySQL (Cluster) replication. These items are things I run again and again into it with customers:
- SQL-nodes are still loosing too easy connection to cluster after data node or management node restart (which leads into gaps, see next point). Automatic fail over or reconnection is just a dream (maybe it works in about 90% of the cases at least).
