Shinguz's blog

Partial restore on MySQL or PXC

Taxonomy upgrade extras: 

The receipt above seems also to work with Percona Xtrabackup:

Galera Cluster Release Notes

Taxonomy upgrade extras: 

Source: Github: codership / documentation

Codership Blog for Galera Cluster with release announcements.

Window functions

Taxonomy upgrade extras: 

Some of my colleagues mentioned Window Functions. Maybe it works. But I fear that window functions are not fast because they do some materialization in between? I have to test...

Databases are standardized but in detail they behave different

Taxonomy upgrade extras: 

For a fancy application we want to query a chunk of rows from a table and therefore we need the minimum and the maximum of the Primary Key of these rows.
Because InnoDB is an Index Organized Table or Index Clustered Table we know that this access will use the Primary Key. But to be sure and to be compliant with the standard (and compatible) we use and ORDER BY on the Primary Key.

Handler_read_first

Taxonomy upgrade extras: 

We got some feedback from Paul Campbell about Handler_read_first:

Thought you might like to know that you can get do this without a full index scan (in 5.7 at least) with a query for SELECT MIN(pkey), only the first key is read in this instance. SELECT MAX(pkey) will do the same for Handler_read_last.

MariaDB Push Replication

Taxonomy upgrade extras: 

Table of Contents

How to make MariaDB Pull Replication as secure as possible

A normal MariaDB Replication is a Pull Replication. This means that a Slave connects to its Master and gathers or better requests Binary Log information from the Master and applies them in a streaming way.

VSZ behaviour with MariaDB MEMORY tables

Taxonomy upgrade extras: 

We recently had the situation that a customer complained about the Oom killer terminating the MariaDB database instance from time to time. The MariaDB database configuration was sized quit OK (about 50% of RAM was used for the database) but they did not have swap configured.

MariaDB memory_used

Taxonomy upgrade extras: 

An inside view from the MariaDB database instance can be received with:

Use Mirror Router instead

Taxonomy upgrade extras: 

I just got a note from Markus Makela with the following suggestion:

Traffic mirroring with MariaDB MaxScale

Taxonomy upgrade extras: 

Recently we had the case that a customer claimed that MariaDB 10.3 Binary Log is using 150% more space on disk than MySQL 5.7 Binary Log. Because I never observed something similar, but to be honest, I did not look to intensively for this situation, we had to do some clarifications.

MariaDB Galera Cluster Upgrade Path

Taxonomy upgrade extras: 

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.

A note about the described problem

Taxonomy upgrade extras: 

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.

How to force InnoDB Buffer Pool flushing

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).

Upgrading from MariaDB 10.4 to MariaDB 10.5 Galera Cluster

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
]:

Partial Table or Schema restore from mariabackup full backup

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…

MariaDB MaxScale Configuration Variables

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{ 0 | 1 }1- 
maxlog1.4 2.32.42.5{ 0 | 1 }1- 
log_to_shm1.4    { 0 | 1 }0-Deprecated and ignored in 2.3.0 and newer
log_warning1.4 2.32.42.5{ 0 | 1 }1- 
log_notice1.4 2.32.42.5{ 0 | 1 }1- 
log_info1.4 2.32.42.5{ 0 | 1 }0- 
log_debug1.4 2.32.42.5{ 0 | 1 }0- 
log_warn_super_user    2.5 false  
log_messages        Deprecated, use log_notice instead
log_trace        Deprecated, use log_info instead
log_augmentation1.4 2.32.42.5{ 0 | 1 }0- 
log_throttling  2.32.42.5{ <n>, <n>, <n> }10, 1000, 10000time, millisecond, millisecond 
logdir1.4 2.32.42.5<dirpath>/tmp/- 
datadir1.4 2.32.42.5<dirpath>/home/user/maxscale_data/- 
libdir1.4 2.32.42.5<dirpath>/home/user/lib64/- 
cachedir1.4 2.32.42.5<dirpath>/tmp/maxscale_cache/- 
piddir1.4 2.32.42.5<dirpath>/tmp/maxscale_cache/- 
execdir1.4 2.32.42.5<dirpath>/usr/local/bin/- 
connector_plugindir  2.32.42.5<dirpath>/usr/lib/plugin/  
persistdir  2.32.42.5<dirpath>/var/lib/maxscale/maxscale.cnf.d/  
module_configdir  2.32.42.5<dirpath>/var/lib/maxscale/  
language1.4 2.32.42.5<dirpath>/home/user/lang/- 
query_classifier  2.32.42.5<classifier>qc_sqlite  
query_classifier_cache_size  2.32.42.5<n>15% of system Memorybyte 
query_classifier_args  2.32.42.5    
substitute_variables  2.32.42.5{ true | false }false  
sql_mode  2.32.42.5{ default | oracle }default  
local_address  2.32.42.5<IP address>*  
users_refresh_time  2.32.42.5<n>30second 
user_refresh_interval   2.42.5<n>0second 
retain_last_statements  2.32.42.5<n>0statement 
dump_last_statements  2.32.42.5{ on_error | on_close | never }never- 
session_trace  2.32.42.5<n>0statement 
writeq_high_water  2.32.42.5    
writeq_low_water  2.32.42.5    
load_persisted_configs  2.32.42.5{ 0 | 1 }1  
max_auth_errors_until_block   2.42.5<n>10  
debug    2.5    
admin_host  2.32.42.5<IP address>127.0.0.1  
admin_port  2.32.42.5<n>8989  
admin_auth  2.32.42.5 1  
admin_ssl_key  2.32.42.5    
admin_ssl_cert  2.32.42.5    
admin_ssl_ca_cert  2.32.42.5    
admin_enabled  2.32.42.5{ 0 | 1 }   
admin_gui    2.5 1  
admin_secure_gui    2.5    
admin_log_auth_failures   2.42.5{ 0 | 1 }1  
admin_pam_readwrite_service   2.42.5    
admin_pam_readonly_service   2.42.5    

Service Options

VariableVersionsValuesDefaultUnitComment
type1.4 2.32.42.5service - 
router1.4 2.32.42.5{ readconnroute | readwritesplit | schemarouter | binlogrouter } - 
router_option1.4 2.32.42.5{ slave | master,slave } - 
filters1.4 2.32.42.5{ counter | QLA } - 
targets    2.5{ server | service, ... }   
servers1.4 2.32.42.5{ <server1>, <server2>, ... } - 
cluster   2.42.5<name>   
user1.4 2.32.42.5{ <username> } - 
passwd1.4 2.32.42.5{ <password> } - 
enable_root_user1.4 2.32.42.5{ 0 | 1 }0- 
localhost_match_wildcard_host1.4 2.32.4 { 0 | 1 }0 Deprecated and ignored.
version_string1.4 2.32.42.5<string>5.5.5-10.0.0 MaxScale <MaxScale version>  
weightby1.4 2.32.4 <server_weight>  Deprecated in 2.3 and removed in 2.5, use rank instead
auth_all_servers1.4 2.32.42.5{ 0 | 1 }0  
strip_db_esc1.4 2.32.42.5{ 0 | 1 }0  
optimize_wildcard1.4  2.4 { 0 | 1 }0  
retry_on_failure1.4 2.3  { 0 | 1 }1 Ignored by 2.4 and removed in the future.
log_auth_warnings1.4 2.32.42.5{ 0 | 1 }0  
connection_timeout1.4 2.32.42.5<n> second 
max_connections  2.32.42.5<n> connection 
max_retry_interval 2.22.32.4 <n>3600second 
session_track_trx_state  2.32.42.5 false Only supported by MariaDB 10.3 and newer
retain_last_statements  2.32.42.5    
connection_keepalive    2.5<n>300  
net_write_timeout   2.42.5 0second 

Routing Modules

ReadConnRoute

For (weighted) load balancing.

SQL Query Tuning - Performance

Taxonomy upgrade extras: 

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

Pages

Subscribe to RSS - Shinguz's blog