Last week I received an urgent email asking to move the time
of my performance review up a few hours. And the email
sender was not in my management structure and was someone
unfamiliar to me. Being a former Xerox employee, I checked
my others emails for notice of a reorganization. Then I
realized the person in question was seeking the other
David Stokes at Oracle. Yup two of us with the same name at
the same company. Whew!
Coincidentally MySQL 8.0.21 added a new ability that allows you
to store information about an account similar to the way the
GCOS field is supposed to be used for in the
UNIX/Linux world. Back in time many decades ago, account names
were limited in length and the GCOS field was populated with the
account's user name, office room number, office phone number, and
some other relevant information. This was the way …
I would say that innodb_rollback_on_timeout is a very important parameter. In this blog, I am going to explain “innodb_rollback_on_timeout” and how it affects the transaction behavior at the MySQL level. I describe two scenarios with practical tests, as it would be helpful to understand this parameter better.
What is innodb_rollback_on_timeout?
The parameter Innodb_rollback_on_timeout will control the behavior of the transaction when a failure occurs with timeout.
- If –innodb-rollback-on-timeout=OFF ( default ) is specified, InnoDB rollbacks only the last statement on a transaction timeout.
- If –innodb-rollback-on-timeout=ON is specified, a transaction timeout causes InnoDB to abort and roll back the entire transaction.
Let’s conduct the test with the …
[Read more]When writing data to disk, for small transactions the cost of writing the commit out do disk dominates the execution time of the script. In order to show that, I wrote a little bit of Python.
The script creates a test table in a database and writes 10.000 rows of test data into it, in commit sizes of 1, 2, 4, …, 1024 rows.
$ ./mysql.py --help
Usage: mysql.py [OPTIONS] COMMAND [ARGS]...
Test commit sizes.
Options:
--help Show this message and exit.
Commands:
create Create the demo table empty.
drop Drop the demo table
fill Write test records into the demo table.
truncate Truncate the demo table.
There is a small driver script to run the test. The driver creates the table, truncates it and will then run the fill command of the script over and over again, with growing commit-sizes. All powers of 2 from 0 to 10 are being tried with 10.000 rows of test data.
The test system has a …
[Read more]
Be sure to register for the July
29th Oracle MySQL Virtual Event: Upgrading to MySQL
8.0!
Join MySQL's first virtual
conference and discover how upgrading to MySQL 8.0 will improve
your application performance. Agenda for the day:
8:00 – 9:00am PDT
Best Practice Tips | Upgrading to 8.0 (LeFred)
9:00 – 10:00am PDT MySQL 8.0 Through
the Eyes of the MySQL Support Team (Megha)
10:00 – 11:00am PDT Customer Insights …
So you talk to a database, doing transactions. What happens actually, behind the scenes? Let’s have a look.
There is a test table and we write data into it inside a transaction:
CREATE TABLE t (
id serial,
data varbinary(255)
)
START TRANSACTION READ WRITE
INSERT INTO t ( id, data ) VALUES (NULL, RANDOM_BYTES(255))
COMMIT
The MySQL test instance we are talking to is running on a Linux
machine, and otherwise idle to make observation easier. Also, we
configured it with innodb_use_native_aio = false
because observing actual physical asynchronous I/O and
attributing it to the statement that caused it is really hard.
Setting things up this way, we can use lsof and strace to see things. But before we do this, let’s set some expectations and establish some background knowledge.
The Log/Data Memory/Storage quadrants
Upper half: Log structures, Lower half: Data …
[Read more]
A new release of MySQL was out on July 13 (8.0.21).
Among all the changes, there are some that I have already tested
and that I really appreciate.
Who stopped the MySQL server?
In previous releases, I can already see in the error log file who
stopped the MySQL server if this was done through the shutdown
statement.
In MySQL 8.0.20:
mysql> shutdown; Query OK, 0 rows affected (0.00 sec) mysql> exit; Bye # tail -2 /u01/app/mysql/admin/mysqld2/log/mysqld2.err 2020-07-23T20:39:08.049064+02:00 9 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.0.20). 2020-07-23T20:39:09.796726+02:00 0 [System] [MY-010910] [Server] /u01/app/mysql/product/mysql-8.0.20/bin/mysqld: Shutdown complete (mysqld 8.0.20) MySQL Community Server - GPL.
In MySQL 8.0.21:
mysql> …[Read more]
A new release of MySQL was out on July 13 (8.0.21).
Among all the changes, there are some that I have already tested
and that I really appreciate.
Who stopped the MySQL server?
In previous releases, I can already see in the error log file who
stopped the MySQL server if this was done through the shutdown
statement.
In MySQL 8.0.20:
mysql> shutdown; Query OK, 0 rows affected (0.00 sec) mysql> exit; Bye # tail -2 /u01/app/mysql/admin/mysqld2/log/mysqld2.err 2020-07-23T20:39:08.049064+02:00 9 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.0.20). 2020-07-23T20:39:09.796726+02:00 0 [System] [MY-010910] [Server] /u01/app/mysql/product/mysql-8.0.20/bin/mysqld: Shutdown complete (mysqld 8.0.20) MySQL Community Server - GPL.
In MySQL 8.0.21:
mysql> …[Read more]
From MySQL 8.0.21 onwards, START GROUP_REPLICATION
includes new options which allow a user to specify credentials to
be used for distributed recovery. You can now pass credentials
when invoking START GROUP_REPLICATION
instead of
setting them when configuring the
group_replication_recovery
channel.
START GROUP_REPLICATION
command now has the options:
-
USER
: User name.
… Tweet Share
This morning, a user asked in the MySQL Community Slack if somebody had an idea why the error log was filled up continuously with a warning messages like this one:
2020-07-24T06:54:00.877128Z 46 [Warning] [MY-013360] [Server] Plugin sha256_password reported: ''sha256_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'
The context was that the user upgraded from MySQL 5.7 to MySQL
8.0 and changed the authentication plugin of all users to
caching_sha2_password
.
As the warning message was written to the error log almost twice per second, I suspected a monitoring tool. The user said, that no application, no monitoring was using this server yet.
Of course we verified that all users had the plugin changed.
This is important when helping people (friends, colleagues, …
[Read more]Group Replication enables you to create fault-tolerant systems with redundancy by replicating the system state to a set of servers. Even if some of the servers subsequently fail, as long it is not all or a majority, the system is still available.…
Tweet Share