Update June 12, 2023: This component has been deprecated in v17 and will be removed in v18! We recommend that you instead use VTOrc with the semi_sync durability policy. Introduction # MySQL group replication is a new replication mechanism that was released in 2016. Group replication involves establishing a group of nodes that are coordinated automatically via Group Communication System (GCS) protocols, an implementation of Paxos. For a transaction to commit, a majority of the group has to agree on the order of a given transaction in the global sequence of transactions.
Another day, another company announces it changed its license away from open source while claiming “We Believe In A Model Of Sustainable Open Source.”
I’m not sure about you, but this rings to me as similar to an alleged quote about the Vietnam War: “We had to destroy the village in order to save it.”
What Lightbend’s CEO and Founder, Jonas Boner, really means is that they have decided that they do not believe an open source license (Apache 2.0) suits their business goals best any longer, and a proprietary, source available license (BSL) will be a better fit.
As an entrepreneur and business founder myself, I understand business is hard. Often, your choices are limited, especially if you’ve taken other …
[Read more]More and more people are using UUID’s to identify records in their database.
As you already know, for MySQL’s storage engine (InnoDB) the primary key is very important ! (for performance, memory and disk space).
See the following links:
- https://lefred.be/content/mysql-invisible-column-part-ii/
- https://dev.mysql.com/doc/refman/8.0/en/create-table-gipks.html (GIPK mode in MySQL 8.0.30 !)
Problems
There are 2 major problems having a UUID as Primary Key in InnoDB:
- generally they are random and cause clustered index to be rebalanced
- they are included in each secondary indexes (consuming disk and memory)
Let’s have a look at …
[Read more]In my previous blog post, ProcFS UDF: A Different Approach to Agentless Operating System Observability in Your Database, I wrote about the ProcFS UDF MySQL plugin, which allows you to get operating systems stats, through the MySQL database, without having shell access to the server and any local agent installation.
Some of you wondered whether there is a way to use this goodness in Percona Monitoring and Management (PMM), and this blog post will show you exactly how to do that.
Unfortunately, at this point, Percona Monitoring and Management does not support the ProcFS UDF MySQL plugin out of the box. It is in the backlog, along with many other cool things. However, …
[Read more]You have your database instance deployed with AWS and you are using AWS RDS for MySQL. All work smoothly in terms of satisfying queries for your application and delivering reliable uptime and performance. Now you need to take care of your backup strategy. Business is defined to have this retention policy:
- 7 daily full backups
- 4 weekly backups
- 12 monthly backups
Plus the ability to do point-in-time recovery (PITR) for the last 24 hours since the last full backup was taken.
The cloud vendor solution
This is a piece of cake. The daily backups: just set the backup retention period to six days. Done. This also has the plus that PITR is already covered since RDS uploads the transaction logs to S3 every five minutes and stores them in the parquet format, making it smaller than the regular text file. All amazing, right?
Now, the weekly and …
[Read more]
You know how much I praise and like MySQL Shell but if like me,
for you too, old habits die hard, I advise you to create these
different aliases in your ~/.bashrc (or
~/.bash_aliases) file to force yourself to use MySQL
Shell even for a small statement check:
alias mysql="mysqlsh --sql mysql://localhost"
alias mysqlx="mysqlsh --js mysqlx://localhost"
Of course you can specify the user you want, by default it uses the same user as the system one.
For example, if this is your test machine and you want to always
use the root account (even if not recommended), you
can specify it like this by modifying the URI:
alias mysql="mysqlsh --sql mysql://root@localhost"
Example:
So now when using mysql MySQL Shell is launched and
it connects directly to localhost in SQL mode using the classic
protocol.
With …
[Read more]A large table is a pain for many reasons as long as it is in a system. And as if that’s not enough, it is also a difficult task to get rid of it. In this post, we will understand why it is a pain to do this operation and what we can do about it. It will be like asking the table “Tell me what happened and I will ease up the eviction”.
So what happened? When a table is dropped (or truncated), InnoDB has to scan the pages throughout the buffer pool and remove all those belonging to that table. For a large buffer pool, this crawling in the buffer pool pages and eviction process will be slower. When we say “scan buffer pool”, it mainly looks for “LRU”, “FLUSH” (Dirty pages), and “AHI” entries.
LRU: Buffer pool pages are stored in a linked list of pages in order of usage. As the data reaches the end of the list, it is evicted to make space for new data. When the room is needed to add …
[Read more]Of course, there are other ways to determine what tables are present in a particular MySQL Database or Schema. You can also find this information if your database user account has permissions for the INFORMATION_SCHEMA database. Continue reading and follow along with an example query…
The Newsletter for PHP and MySQL Developers
Receive a copy of my ebook, “10 MySQL Tips For Everyone”, absolutely free when you subscribe to the OpenLampTech newsletter.
Image by Clker-Free-Vector-Images from …
[Read more]Recently, somebody asked me how he can find the long running transactions in MySQL.
I already have one MySQL Shell plugin that allows you to find the
current transactions sorted by time. The plugin allows you to
also get the details about the desired transaction. See
check.getRunningStatements().
Let’s see how we can easily find those long transaction that can be a nightmare for the DBAs (see MySQL History List Length post).
SELECT thr.processlist_id AS mysql_thread_id,
concat(PROCESSLIST_USER,'@',PROCESSLIST_HOST) User,
Command,
FORMAT_PICO_TIME(trx.timer_wait) AS trx_duration,
current_statement as `latest_statement`
FROM …[Read more]
We often see an int column of a table that needs to be changed to unsigned-int and then unsigned-bigint due to the value being out of range. Sometimes, there may even be blockers that prevent us from directly altering the table or applying pt-online-schema-change on the primary, which requires the rotation solution: apply the change on the replica first, switch over the writes to the replica, and then apply the change on the previous primary. In this case, MySQL will have to replicate unsigned-int to unsigned-bigint for a while.
One might think it is obvious and straightforward that MySQL should be able to replicate unsigned-int to unsigned-bigint because unsigned-bigint has a larger size(8 bytes) which covers unsigned-int(4 bytes). It is partly true, but there are some tricks in practice. This blog will show you those tricks through the scenarios.
Let’s understand the scenarios and issues that one may face when replicating from …
[Read more]