Rechercher dans le manuel MySQL
15.6.5 Redo Log
The redo log is a disk-based data structure used during crash recovery to correct data written by incomplete transactions. During normal operations, the redo log encodes requests to change table data that result from SQL statements or low-level API calls. Modifications that did not finish updating the data files before an unexpected shutdown are replayed automatically during initialization, and before the connections are accepted. For information about the role of the redo log in crash recovery, see Section 15.17.2, “InnoDB Recovery”.
By default, the redo log is physically represented on disk by two
files named ib_logfile0
and
ib_logfile1
. MySQL writes to the redo log
files in a circular fashion. Data in the redo log is encoded in
terms of records affected; this data is collectively referred to
as redo. The passage of data through the redo log is represented
by an ever-increasing LSN value.
For related information, see Redo Log File Configuration, and Section 8.5.4, “Optimizing InnoDB Redo Logging”.
Changing the Number or Size of Redo Log Files
To change the number or the size of redo log files, perform the following steps:
Stop the MySQL server and make sure that it shuts down without errors.
Edit
my.cnf
to change the log file configuration. To change the log file size, configureinnodb_log_file_size
. To increase the number of log files, configureinnodb_log_files_in_group
.Start the MySQL server again.
If InnoDB
detects that the
innodb_log_file_size
differs
from the redo log file size, it writes a log checkpoint, closes
and removes the old log files, creates new log files at the
requested size, and opens the new log files.
InnoDB
, like any other
ACID-compliant database engine,
flushes the redo log of a
transaction before it is committed. InnoDB
uses group commit
functionality to group multiple such flush requests together to
avoid one flush for each commit. With group commit,
InnoDB
issues a single write to the log file
to perform the commit action for multiple user transactions that
commit at about the same time, significantly improving
throughput.
For more information about performance of
COMMIT
and other transactional operations,
see Section 8.5.2, “Optimizing InnoDB Transaction Management”.
Traduction non disponible
Le manuel MySQL n'est pas encore traduit en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Document créé le 26/06/2006, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/mysql-rf-innodb-redo-log.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.