mysql InnoDB のクラッシュ回復プロセスとは何ですか

WBOY
リリース: 2023-05-28 11:07:11
転載
1052 人が閲覧しました

1. ログ操作のやり直し: 送信されたトランザクションによって影響を受ける最新のデータがデータ ページにフラッシュされるようにします。

2. ログ操作を元に戻す: コミットされていないトランザクションの影響を受けたデータ ページがロールバックされるようにします。

3. 書き込みバッファ (変更バッファ) のマージ。

4. パージ操作。

InnoDB は、別のバックグラウンド スレッドを使用して、インデックス内で削除対象としてマークされたデータを定期的に処理するガベージ コレクション メカニズムです。

/* Look for MLOG_CHECKPOINT. */
recv_group_scan_log_recs(group, &contiguous_lsn, false);
/* The first scan should not have stored or applied any records. */
ut_ad(recv_sys->n_addrs == 0);
ut_ad(!recv_sys->found_corrupt_fs);
 
if (recv_sys->found_corrupt_log && !srv_force_recovery) {
log_mutex_exit();
return(DB_ERROR);
}
 
if (recv_sys->mlog_checkpoint_lsn == 0) {
if (!srv_read_only_mode
    && group->scanned_lsn != checkpoint_lsn) {
ib::error() << "Ignoring the redo log due to missing"
" MLOG_CHECKPOINT between the checkpoint "
<< checkpoint_lsn << " and the end "
<< group->scanned_lsn << ".";
if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
log_mutex_exit();
return(DB_ERROR);
}
}
 
group->scanned_lsn = checkpoint_lsn;
rescan = false;
} else {
contiguous_lsn = checkpoint_lsn;
rescan = recv_group_scan_log_recs(
group, &contiguous_lsn, false);
 
if ((recv_sys->found_corrupt_log && !srv_force_recovery)
    || recv_sys->found_corrupt_fs) {
log_mutex_exit();
return(DB_ERROR);
}
}
 
/* NOTE: we always do a 'recovery' at startup, but only if
there is something wrong we will print a message to the
user about recovery: */
 
if (checkpoint_lsn != flush_lsn) {
 
if (checkpoint_lsn + SIZE_OF_MLOG_CHECKPOINT < flush_lsn) {
ib::warn() << " Are you sure you are using the"
" right ib_logfiles to start up the database?"
" Log sequence number in the ib_logfiles is "
<< checkpoint_lsn << ", less than the"
" log sequence number in the first system"
" tablespace file header, " << flush_lsn << ".";
}
 
if (!recv_needed_recovery) {
 
ib::info() << "The log sequence number " << flush_lsn
<< " in the system tablespace does not match"
" the log sequence number " << checkpoint_lsn
<< " in the ib_logfiles!";
 
if (srv_read_only_mode) {
ib::error() << "Can't initiate database"
" recovery, running in read-only-mode.";
log_mutex_exit();
return(DB_READ_ONLY);
}
 
recv_init_crash_recovery();
}
}
 
log_sys->lsn = recv_sys->recovered_lsn;
 
if (recv_needed_recovery) {
err = recv_init_crash_recovery_spaces();
 
if (err != DB_SUCCESS) {
log_mutex_exit();
return(err);
}
 
if (rescan) {
contiguous_lsn = checkpoint_lsn;
recv_group_scan_log_recs(group, &contiguous_lsn, true);
 
if ((recv_sys->found_corrupt_log
     && !srv_force_recovery)
    || recv_sys->found_corrupt_fs) {
log_mutex_exit();
return(DB_ERROR);
}
}
} else {
ut_ad(!rescan || recv_sys->n_addrs == 0);
}
ログイン後にコピー

以上がmysql InnoDB のクラッシュ回復プロセスとは何ですかの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

関連ラベル:
ソース:yisu.com
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
最新の問題
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!