Replication and MEMORY Tables-opracowanie

Nasza ocena:

3
Wyświetleń: 539
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Replication and MEMORY Tables-opracowanie - strona 1 Replication and MEMORY Tables-opracowanie - strona 2

Fragment notatki:

Replication and MEMORY Tables
When a master server shuts down and restarts, its MEMORY tables become empty. To replicate this
effect to slaves, the first time that the master uses a given MEMORY table after startup, it logs an event
that notifies slaves that the table must to be emptied by writing a DELETE statement for that table to the
binary log.
When a slave server shuts down and restarts, its MEMORY tables become empty. This causes the slave
to be out of synchrony with the master and may lead to other failures or cause the slave to stop:
• Row-format updates and deletes received from the master may fail with Can't find record in
'memory_table'.
• Statements such as INSERT INTO ... SELECT FROM memory_table may insert a different set
of rows on the master and slave.
The safe way to restart a slave that is replicating MEMORY tables is to first drop or delete all rows from
the MEMORY tables on the master and wait until those changes have replicated to the slave. Then it is
safe to restart the slave.
An alternative restart method may apply in some cases. When binlog_format=ROW [2047], you
can prevent the slave from stopping if you set slave_exec_mode=IDEMPOTENT [2028] before
you start the slave again. This allows the slave to continue to replicate, but its MEMORY tables will
still be different from those on the master. This can be okay if the application logic is such that the
contents of MEMORY tables can be safely lost (for example, if the MEMORY tables are used for caching).
slave_exec_mode=IDEMPOTENT [2028] applies globally to all tables, so it may hide other replication
errors in non-MEMORY tables.
The size of MEMORY tables is limited by the value of the max_heap_table_size [519] system
variable, which is not replicated (see Section 16.4.1.33, “Replication and Variables”). A change in
max_heap_table_size takes effect for MEMORY tables that are created or updated using ALTER
TABLE ... ENGINE = MEMORY or TRUNCATE TABLE following the change, or for all MEMORY
tables following a server restart. If you increase the value of this variable on the master without doing
so on the slave, it becomes possible for a table on the master to grow larger than its counterpart
on the slave, leading to inserts that succeed on the master but fail on the slave with Table is
full errors. This is a known issue (Bug #48666). In such cases, you must set the global value of
max_heap_table_size [519] on the slave as well as on the master, then restart replication. It is also
recommended that you restart both the master and slave MySQL servers, to insure that the new value ... zobacz całą notatkę

Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz