This post explains the inherent problem of running online schema changes in MySQL, on tables participating in a foreign key relationship. We'll lay some ground rules and facts, sketch a simplified schema, and dive into an online schema change operation. Our discussion applies to gh-ost, pt-online-schema-change, and VReplication based migrations, or any other online schema change tool that works with a shadow/ghost table like the Facebook tools. Why Online DDL? # Online schema change tools come as workarounds to an old problem: schema migrations in MySQL were blocking, uninterruptible, aggressive in resources, replication unfriendly.
The practice of running databases in containers continues to grow in popularity. As a Technical Account Manager at Percona, I get asked regularly about our Percona Distribution for MySQL Operator. Additionally, I’m asked what I’m seeing in the industry in terms of adoption. In most cases, the questions stem around new deployments. Our DBaaS tool (currently in Technical Preview) makes launching a new cluster in a Kubernetes deployment trivial.
Once the operator completes and verifies the setup, the UI displays the endpoint and credentials and you are on your way. Voila! You now have a cluster, behind a load balancer, that you can access from within your k8s cluster or …
[Read more]One of the most popular ways in achieving high availability for MySQL is replication. Replication has been around for many years, and became much more stable with the introduction of GTIDs. But even with these improvements, the replication process can break due to various reasons - for instance, when master and slave are out of sync because writes were sent directly to the slave. How do you troubleshoot replication issues, and how do you fix them?
In this blog post, we will discuss some of the common issues with replication and how to fix them with ClusterControl. Let’s start with the first one.
Replication Stopped With Some Error
Most MySQL DBAs will typically see this kind of problem at least once …
[Read more]In the previous release of our Percona Distribution for MySQL Operator, we implemented one interesting feature, which can be seen as “self-healing”: https://jira.percona.com/browse/K8SPXC-564.
I do not think it got enough attention, so I want to write more about this.
As it is well known, a 3-node cluster can survive a crash of one node (or pod, in Kubernetes terminology), and this case is very well handled by itself. However, if there is a problem with 2 nodes at the same time, this scenario is problematic for Percona XtraDB Cluster. Let’s see why this is a problem.
First, let’s review if the first node goes offline:
In this case, the cluster can continue work, because Node 1 and Node 2 figure out …
[Read more]
In this blog, we will discuss about how to setup MySQL NDB
Cluster replication in a more secure way with the help of binary
log and relay log encryption and a secure connection. These
measures protect binary log dat in transit and at rest.
Let’s create two MySQL NDB Clusters with the following
environment, Here, one will be termed as ‘source’ cluster and the
other one will be termed as ‘replica’ cluster.
- MySQL NDB Cluster version (Latest GA version)
- 1 Management node
- 4 Data nodes
- 1 MySQLDs
- Configuration slots for up to 4 additional API nodes
Step 1: Start both of the Clusters
Let’s start both the source cluster and replica cluster but do
not start the MySQLD servers from both the clusters as we want to
modify their configuration first.
…
A few weeks ago the MySQL Group on Linked.in passed 20,000 members. For those of you who do not know about Linked.in, it is a business and employment oriented online platform that is mainly used for professional networking, and allows job seekers to post their resumes and employers to post jobs.
You can find job positing, announcements, relevant blog posts, and more on the MySQL page. Please join us if you already have an account.
All opinions expressed in this blog are those of Dave Stokes who is actually amazed to find anyone else agreeing with him
In my previous post Back From a Long Sleep, MyDumper Lives!, I told you that Fast Index Creation was in the queue and (after fixing several bugs) it will package in release 0.10.7 next month. But why am I so excited about it? Well, this feature opens new opportunities, what I’m going to call Restore Strategies.
In the Past…
In the past, the only option was to first restore the table definition and then insert the data rows in two simple steps. On tables with millions of rows, we already know why it takes more time as it inserts in the clustered index and in the secondary index, instead of building the secondary indexes after the data has been inserted, as myloader is able to do now.
Nowadays, we have the option to do it, in …
[Read more]We are proud to announce the latest release of ProxySQL version 2.2.0
ProxySQL is a high performance, high availability, protocol aware proxy for MySQL, with a GPL license! It can be downloaded from the ProxySQL Repository (instructions here) or for a Docker image check out the Official ProxySQL Docker Repository. ProxySQL is freely usable and accessible according to the GNU GPL v3.0 license.
Release Overview Highlights
ProxySQL v2.2.0 is a minor release comprising of backward compatible changes, enhancements and bug fixes. Going forward ProxySQL will be using the common versioning standard “Major.Minor.Patch” and so this is essentially the first minor release of the 2.1 branch and inclues many fixes and features that were added to the 2.0 branches …
[Read more]
In this blog, we will discuss about how to scale out MySQL NDB
Cluster in few easy steps. The use cases could be, when user
business applications demand massive expansion and the existing
cluster may not able to handle the request in that case a cluster
scaling is needed. This is an online procedure i.e. zero cluster
downtime so that user’s business won’t affect while this scaling
process is going on.
In the below demo, we will see, how to scale from a 4 nodes
cluster to 8 nodes cluster while transactions are going on.
Let’s create a MySQL NDB Cluster with the following
environment.
- MySQL NDB Cluster version (Latest GA version)
- 1 Management node
- 4 Data nodes
- 1 MySQLDs
- Configuration slots for up to 4 additional API nodes
Step 1: Let's start the Cluster
Let’s start a 4 nodes cluster.
…
Time zone handling can sometimes generate confusion, especially when dealing with data migrations to different host running on a different time zone, or when switching to a Daylight Saving Time (DST) time zone or when leap seconds are introduced. Will the stored date still make sense after changing a system-wide configuration? What happens when you migrate a server to another host? What is actually stored in the database?
There’s plenty of literature around about MySQL and time zone management, but there’s also missing information, because new features and fixes are constantly introduced into MySQL Server in this area. So I thought that spending a few words here to summarize how to best deal with time zones, and keeping this information up to date to reflect the current implementation …
[Read more]