MySQL Cluster Local Checkpoint (LCP) and Global Checkpoint (GCP)
Submitted by Shinguz on Thu, 2010-07-29 15:29
MySQL 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:

1. Why shall 2 LCPs be kept?
1. Why shall 2 LCPs be kept? It seems that 1 LCP is enough for recovering.
2. From the above picture, When I can't find NDB write data to data file?
3. Does LCP do an accumulated backup or a whole backup?
Why shall 2 LCPs be kept?
Hi Baomin Wang,
After some thinking an talking to some colleagues I found the answer:
When MySQL Cluster writes LCP's it first writes LCP 1, then LCP 2. After LCP 2 it OVERwrites the LCP 1 again and then overwrites LCP 2 again and so on...
This assures that we have always ONE complete and good LCP from where we can recover in case of a complete Cluster crash.
When we would have only 1 LCP file this cannot be assured.
Regards,
Oli
Why shall 2 LCPs be kept?
Hi Baomin Wang,
1. I come back with an answer later...
2. MySQL Cluster is mainly an In-Memory-Database. In a typical set-up we do not have such things like tablespaces or data files as in other MySQL Storage engines. Just the LCP- and GCP-files (and some others files related to the MySQL Cluster).
MySQL Cluster also knows disk based data (which is a less common set-up). There you have indeed such tablespace and UNDO log files. But I did not consider it in this picture because it is a less often used set-up.
3. As written above, an LCP is a dirty image of the data. So it is not a backup at all. But it writes continuously the whole image of your data to disk.
I hope, this helps?
Regards,
Oli