-
Notifications
You must be signed in to change notification settings - Fork 106
innodb_force_primary_key=1 to mitigate downtimes (row based replication of big tables without index) #197
Comments
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/154715999 The labels on this github issue will be updated when the story is started. |
hello #GETandSELECT
Galera don't like DELETE or UPDATE whith 200.000 records. |
The Physical Row Structure of an InnoDB Table : https://dev.mysql.com/doc/refman/5.7/en/innodb-physical-record.html |
thanks @ldangeard-orange for input from MariaDB KB:
I found no details about this 6-bytes clustered index. Very bad documented. It's seems to be different than Oracle Row-ID. MySQL != MariaDB, special most recent versions. I tested the same table with 200 000 records:
The outage is generated by replication, where FULL TABLE scan for every record is done without primary key (or index). In this example he scans 200 000 x 200 000 records without index/primary key.
|
MySQL (Oracle distribution) use InnoDB engine, Percona and MariaDB 10.1.x use Xtradb Engine and there's some differences. |
@ldangeard-orange |
No, MariaDB . But I'm DBA MySQL/Oracle and I bench MySQL 5.7 vs MariaDB 10.1 |
Table with 500 000 records :
Explain plan is the same : explain delete from orders_pk_idx;
+------+-------------+---------------+------+---------------+------+---------+------+---------+-------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+---------------+------+---------------+------+---------+------+---------+-------+
| 1 | SIMPLE | orders_pk_idx | ALL | NULL | NULL | NULL | NULL | 5869096 | |
+------+-------------+---------------+------+---------------+------+---------+------+---------+-------+```
|
Hello @GETandSELECT , If MySQL create a invisible primary key , GALERA don't use it to replicate |
Hey
I created a table with 200'000 records and NO index.
record looks like this:
Then I deleted all rows in that table
DELETE FROM test.test;
, which resulted that the cluster was down for almost one hour. All write operation timed out. During row based replication MariaDB had to do a full table scan for every record.more Info How the Lack of a Primary Key May Effectively Stop the Slave -> they write about Master/Slave, we could reproduce the same with Galera
What do you think about this (
innodb_force_primary_key
) possible mitigation for this issue? We are DBaaS provider.From XtraDB/InnoDB Server System Variables
thanks for feedback
The text was updated successfully, but these errors were encountered: