Feed Aggregator

MariaDB Galera Cluster Upgrade Path

Shinguz - Fri, 2020-12-18 10:47

Because we conduct many customers in MariaDB Galera Cluster upgrades and because these customers sometimes have pretty old MariaDB Galera Cluster set-ups I think it is good to have a rough MariaDB Galera Cluster Upgrade Path.

For an Upgrade Path we have to consider a few things:

  • We face different MariaDB Galera Cluster version (5.5, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5 and soon 10.6).
  • We face different Galera plug-in versions (v2, v3 and v4). Direct upgrade from v2 to v4 is not possible. Upgrade from latest lower version to higher version is supported.
  • We should upgrade to the newest version of a Release Series first before upgrading to the next major Release Series.
  • MariaDB supports skipping of Major Release Series in general but we should consider the Galera plug-in as well.
  • New versions in a Release Series can have new bugs.
  • We should make sure that also application side MariaDB connectors are ready for the new version and not only the MariaDB database server. In MariaDB this is a bit less of an issue than …

Taxonomy upgrade extras:  mariadb, galera, cluster, upgrade,

A note about the described problem

Shinguz - Thu, 2020-12-10 21:40

Hi Oli,

I think that it could be worth mentioning that in MariaDB 10.5, the described problem should no longer exist, thanks to https://jira.mariadb.org/browse/MDEV-19747 removing the code. Also, in older MariaDB versions, https://jira.mariadb.org/browse/MDEV-23720 disables the feature by default.

I must confess that omitting the redo logging was my suggestion. Unfortunately, no proper benchmarking was conducted before it was implemented in MySQL 5.7. With a reasonable innodb_log_file_size, performance should be acceptable, as noted in the above two MDEVs.

Best regards,

Marko
--
Marko Mäkelä, Lead Developer InnoDB
MariaDB Corporation


Taxonomy upgrade extras: 
Categories: 

How to force InnoDB Buffer Pool flushing

Shinguz - Thu, 2020-12-10 17:38

InnoDB tries to keep pages in Buffer Pool to be fast. If a page is changed by a DML statement (INSERT, UPDATE, DELETE) this change will be done in InnoDB Buffer Pool and not directly on disk. But those changed InnoDB pages residing in InnoDB Buffer Pool must be flushed sooner or later to disk to become persistent. This is done by the InnoDB background writer thread(s) (default 4).

InnoDB flushes the dirty pages with a pace of innodb_io_capactiy (default 200) pages/s. This variable should be set depending on the rate you are dirtying pages and on the capacity of your I/O system. 1 single server HDD has an I/O capacity of about 200 IOPS, a SSD between 1000 and 50000 IOPS.
The rate of dirtying pages depends on the number of DML statements and the locality of the changes in your database blocks (random vs. sequential, AUTO_INCREMENT vs. UUID).

Keeping many dirty pages in InnoDB Buffer Pool is good from performance point of view. But in certain cases you want to have the number of dirty pages small or even close …


Taxonomy upgrade extras:  innodb, buffer pool, flushing, meb, mysql enterprise backup, backup,

Upgrading from MariaDB 10.4 to MariaDB 10.5 Galera Cluster

Shinguz - Sat, 2020-11-21 20:58

Because upgrading from MariaDB 10.4 to MariaDB 10.5 (non-clustered) seems not to be a problem
[ 1
] we take the challenge and try to create a receipt based on the MariaDB 10.3 to MariaDB 10.4 Galera Cluster upgrade documentation
[ 3
]:

Before you start

Before you begin with the upgrade you should consider a few things:

  • Downgrade is officially not supported!
    [ 4
    ] It might work, or not.
  • So you should have taken a proper an clean backup before you start with the upgrade and you should be sure the restore works as well!
  • It is recommended to upgrade to the newest MariaDB minor release first
    [ 5
    ] before you upgrade to a new major release. This reduces the risk that you run into already known and fixed bugs.
  • Take a look at Upgrading from MariaDB 10.4 to MariaDB 10.5
    [ 1
    ] to see what has changed between the major versions.
  • New MariaDB Major Release may behave differently than older MariaDB Major Release. Thus you should test the new major release series first before putting it into production!
  • Ideally, you want …

Taxonomy upgrade extras:  mariadb, upgrade, cluster, galera cluster, rolling upgrade, 10.4, 10.5,

Partial Restore of a Table into a MariaDB Galera Cluster

Shinguz - Fri, 2020-11-20 15:08

In my former Blog Post Partial Table or Schema restore from mariabackup full backup we worked out the basics of a partial restore of a table into a MariaDB database instance.

An now we use this know-how to try the same procedure on a Galera Cluster.

The backup is done in the exact same way as described in the mentioned article. We can even use the backup made there.

For the restore we use the following procedure:

Prepare and Restore a table

# BACKUPDIR="/home/mysql/bck/qamariadb105/daily"
# DATADIR="/home/mysql/database/magal-105-a/data"
# SCHEMA="world"
# TABLE="City"

# mariabackup --prepare --export <br>
   --databases="${SCHEMA}" <br>
   --tables="${TABLE}" <br>
   --datadir=${DATADIR} <br>
   --target-dir=${BACKUPDIR}

But now comes the little difference to a simple MariaDB database instance. The following operations have to be done on ALL nodes of the Galera Cluster:

SQL> ALTER TABLE `world`.`City` DISCARD TABLESPACE; …

Taxonomy upgrade extras:  backup, restore, schema, database, physical backup, mariabackup, table restore, schema restore, partial restore, database restore,

Partial Table or Schema restore from mariabackup full backup

Shinguz - Wed, 2020-11-11 21:59

For me it was for a long time not clear if a mariabackup full backup can be used to do partial table or schema restores. Now we faced this challenge with a customer. So time to try it out…

This test was made with MariaDB 10.5.5. So it may not work with some older MariaDB releases…

Backup

Because I do not know during the backup if I need a full or a partial restore I always want to do a full mariabackup backup!

The full backup can be done as normal but the prepare should not be done yet during the backup (or I am not sure if the prepare can be done twice, first without --export during the backup and next with --export during the restore). Further I am not sure yet if a backup treated with --export can later be used for a full restore once more. Further research has to be done in this area…

For a partial table or schema restore we need the CREATE TABLE statements as well. So it makes sense to also backup the table structures already during backups. This avoids troubles or cumbersome and …


Taxonomy upgrade extras:  backup, restore, schema, database, physical backup, mariabackup, table restore, schema restore, partial restore, database restore,

MariaDB MaxScale Configuration Variables

Shinguz - Wed, 2020-11-04 22:49

Table of Contents

Global Options

VariableVersionsValuesDefaultUnitComment
threads1.4 2.32.42.5{ <n> | auto }1thread 
thread_stack_size 2.2   <n>  Ignored and deprecated in 2.3
rebalance_period    2.5<n>0second 
rebalance_threshold    2.5<n>20delta load 
rebalance_window    2.5<n>10second 
auth_connect_timeout1.42.22.32.4 <n>3second 
auth_read_timeout1.42.22.32.4 <n>1secondDeprecated in 2.5
auth_write_timeout1.42.22.32.4 <n>2secondDeprecated in 2.5
query_retries  2.32.42.5<n>1timeAdded in 2.1.10, disabled by default until 2.3.0
query_retry_timeout  2.32.42.5 5  
passive  2.32.42.5 false  
ms_timestamp1.4 2.32.42.5{ 0 | 1 }0- 
skip_permission_checks  2.32.42.5{ 0 | 1 }0  
syslog1.4 2.32.42.5{ …

Taxonomy upgrade extras:  mariadb, maxscale, configuration, variables, load balancer,
Categories: 

FromDual Backup and Recovery Manager for MariaDB and MySQL 2.2.2 has been released

Shinguz - Wed, 2020-10-14 14:22

FromDual has the pleasure to announce the release of the new version 2.2.2 of its popular Backup and Recovery Manager for MariaDB and MySQL (brman).

The new FromDual Backup and Recovery Manager can be downloaded from here. The FromDual Repositories were updated. How to install and use the Backup and Recovery Manager is describe in FromDual Backup and Recovery Manager (brman) installation guide.

In the inconceivable case that you find a bug in the FromDual Backup and Recovery Manager please report it to the FromDual Bugtracker or just send us an [email](mailto:contact@fromdual.com?Subject=Bug report for brman).

Any feedback, statements and testimonials are welcome as well! Please send them to feedback@fromdual.com.

Upgrade from 2.x to 2.2.2

shell> cd ${HOME}/product
shell> tar xf /download/brman-2.2.2.tar.gz
shell> rm -f brman
shell> ln -s brman-2.2.2 brman

Changes in FromDual Backup and Recovery Manager 2.2.2

This release is a new minor release. It contains only bug fixes. We have tried to …


Taxonomy upgrade extras:  backup, restore, recovery, pitr, brman, release, bman, rman, fromdual backup and recovery manager,

SQL Query Tuning - Performance

Shinguz - Mon, 2020-10-05 16:13

How could the following SQL queries be improved performance wise and otherwise and can you also explain why your change is more optimal?

Please consider, when testing, that your results are not confused by the Query Cache or by reading data from your I/O system which are an order of magnitude faster (Query Cache) or slower (I/O) than the in-memory behaviour.

Table of Contents

SQL Query Tuning - Covering function

Difficulty: Very easy.

Query:

SELECT *
  FROM bills
 WHERE UNIX_TIMESTAMP(due_date) < 1601560170
;

Table and data:

CREATE TABLE bills (
  id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
, amount DECIMAL (10,2) NOT NULL
, due_date DATETIME NOT NULL
, customer_id SMALLINT UNSIGNED NOT NULL …

Taxonomy upgrade extras:  query, tuning, optimizer, sql, performance,
Categories: 

Creating synthetic data sets for tuning SQL queries

Shinguz - Fri, 2020-10-02 16:50

When it comes to SQL Query tuning with customers we often get the slow running SQL query and possibly, in good cases, also the table structure. But very often, for various reasons, we do not get the data.

SQL query tuning on an empty table or a table with only little data is not really fun because either the results of the optimizer have nothing to do with reality or the response times do not really show if your change has improved anything. For example if your query response time before the change was 2 ms and after 1 ms this can be either the consequence of your improvement but more probable a hiccup of your system.

So what to do to get valid results from your SQL query optimizer during SQL query tuning?

  • The best case is you get real data from the customer in size and content.
  • The second best case is if you get real data from the customer in content. So you can analyze this content and synthetically pump it up.
  • The worst case is if you get no data at all from your customer. In this case you have to create …

Taxonomy upgrade extras:  performance, tuning, query, optimizer, sql, explain, optimizing, query tuning, performance tuning, data,

Kernel Documentation

Shinguz - Thu, 2020-09-24 10:19

And this is what the Linux kernel documentation says about it: https://www.kernel.org/doc/Documentation/networking/bonding.txt


Taxonomy upgrade extras: 
Categories: 

MyISAM locking and who is the evil?

Shinguz - Wed, 2020-09-23 09:58

Yes, I know, MyISAM is deprecated and unofficially discontinued by the vendors. But we still have from time to time customers using MyISAM and even evangelize for MyISAM…

And to be honest in some cases MyISAM has even advantages (beside some huge disadvantages) over other Storage Engines (simple file copy, footprint, single-query latency, …). But most of our customers are not aware of these advantages and are using MyISAM just because they did it since ever…

One of the biggest problems we see at customers is the MyISAM table lock behaviour. They claim things like the database stalls, crashes or stocks beside other non-qualified expressions. Which is typically not the case but the database just runs out of connections because they reach the max_connections fuse. In fact what happens is that one long running writer connection blocks an important and frequently used (MyISAM) table and other writer and reader connections have to wait (Waiting for table level lock) until the writer finishes …


Taxonomy upgrade extras:  myisam, lock, locking,

Good explanation for bond interfaces

Shinguz - Wed, 2020-09-23 09:14

802.3ad bond interface have show high RX dropped packets

I found a god explanation for dropped packages on bonded interfaces: [ 1 ]

This is related to the bonding mode and _not_ a bug. The bonding module will drop duplicate frames received on inactive ports, which is normal behaviour. Overall the packets should be getting into the machine without problems since they are received on the active slave. To confirm this do the following

1) Check dropped packets from all interfaces. So if eth0/eth1 are connected to bond0, we may see dropped packets for bond0 and eth0, but not for eth1. This depends on which interface is the active interface. This can be checked using the following:

cat /sys/class/net/bond0/bonding/active_slave

So if the active_slave isn't dropping packets, and the inactive slave is dropping packets this is normal in 'active-backup' mode (or any mode where there is an inactive slave).

2) If we want both interfaces to not drop packets we can use 'all_slaves_active' bonding module parameter. …


Taxonomy upgrade extras: 
Categories: 

Solutions

admin - Tue, 2020-09-08 16:01

I have described 3 different ways to "solve" the problem above:

  • I assume MySQL has just disabled the Note?
  • You can find various advices in the Internet about how to get rid of this Note:
  • So I strongly assume it is a noisy-neighbour problem. ... Because we did not cause more load and over-saturated the system it must be triggered externally:

So find out, which one of the latter two will help you.


Taxonomy upgrade extras: 
Categories: 

PageCleaners issue

sk - Tue, 2020-09-08 13:05

only Problem statement, where is the solution to this issue of Page Cleaners?


Taxonomy upgrade extras: 
Categories: 

MariaDB and MySQL package holding or locking

Shinguz - Fri, 2020-08-07 16:02

Repositories from your favourite Linux distribution and from your favourite database software vendor get regular package updates. If you do periodic system upgrades (for example every 2 weeks as we do) you get the newest packages of a release series.
Unfortunately recently the software vendors started not only to fix bugs in new releases but also to introduce new features. And when you fix bugs or introduce new stuff new bugs might appear.
To avoid being hit unexpectedly by new bugs you do not want to upgrade untested software. To achieve this you want to keep/not upgrade some important packages. For example the MariaDB or MySQL server package.
This package pinning is called package version lock on CentOS and Redhat and package holding on Debian and Ubuntu.

How you do this I have summarized below:

Debian / Ubuntu

See also apt_preferences (APT pinning) and man 5 apt_preferences

shell> dpkg -l | grep mariadb
ii  libmariadb3:amd64                     3.0.3-1build1                                   amd64 …

Taxonomy upgrade extras:  debian, ubuntu, centos, package, upgrade, lock, locking, hold, redhat, pin, red hat,

MariaDB SQL Error Log Plugin

Shinguz - Thu, 2020-07-30 12:26

When you are for too long in business you think you know already everything and you are getting lazy. This happened to me again a few weeks ago. A customer asked me about the SQL Error Log Plugin. First I though he was talking about the MariaDB Error Log or the General Query Log. But then I have learned that there is something “new” I did not know yet…

MariaDB introduced in 5.5.22 (March 2012) a new plugin called the SQL Error Log Plugin. This Plugin collects all the errors which were sent from the MariaDB daemon to applications/clients and writes it to a log file.

This Client error log file can be analysed later to find and fix bugs in the application if the applications did not catch the errors themselves.

Installation

The Plugin can be easily installed with:

SQL> INSTALL PLUGIN sql_error_log SONAME 'sql_errlog';

and uninstalled again with:

SQL> UNINSTALL PLUGIN sql_error_log;
Query OK, 0 rows affected, 1 warning (0.002 sec)

The installation and uninstallation informations are …


Taxonomy upgrade extras:  mariadb, sql, error, logging, error log, syntax,

FromDual Ops Center File Transfer

Shinguz - Tue, 2020-07-28 09:59

With the FromDual Ops Center file transfer tool you can easily upload files from your personal computer to the focmm machine, download files from the focmm machine to your personal computer or transfer files from the focmm machine to any of your database machines or between them. This feature is made for importing, exporting or transferring data from, to or between your different database instances. For example to copy a production schema to a testing database instance.

For backup and restore of a database instance or schema see Operations.

File Transfer

You can reach the file transfer tool under the menu Tools on the left and then File transfer.

Upload

For uploading a file just click to the Browse… button, select a file from your local file system and then click to Upload File.

Upload File

After a while, when the upload is completed, the file will appear in the Download section of your focmm machine.

Download section

Alternatively you can also upload files from your personal computer to the focmm machine via your favourite file transfer …


Taxonomy upgrade extras:  focmm, fromdual ops center, file, file transfer,

Centralized Crontab with FromDual Ops Center

Shinguz - Thu, 2020-07-23 11:18

One of the tools of FromDual Ops Center for MariaDB and MySQL is the centralized crontab for all of your database machines. Instead of maintaining various different crontabs on different machines you can manage them now in one place within the Ops Center.

Under the Tools menu on the left you find Crontab. Here you get a first overview of crontab jobs available:

Tools/Crontab
  • The first column shows if the crontab job is active or not.
  • The second column indicates the O/S user the crontab job should run as.
  • Then we have the typical crontab scheduling entries: Minute, Hour, Day, Month and Day of Week (DoW).
  • Now follows the actual command which should be run with a comment describing the command.
  • The column Last indicates when the job was run last successfully.
  • And RC shows the last Return Code of the job (0 - success, otherwise error number).
  • With the trash icon you can delete a crontab job and with the run icon you can start and run a crontab job right now.

With the Add Crontab Entry button on the bottom you can add new …


Taxonomy upgrade extras:  focmm, fromdual ops center, crontab, centralization,

WMware snapshots or Veeam backups

Shinguz - Wed, 2020-07-22 16:02

We have found a strong correlation between VMware snapshots and Veeam backups and those dropped packets.


Taxonomy upgrade extras: 
Categories: 

Pages

Subscribe to FromDual aggregator