import{_ as s}from"./plugin-vue_export-helper-DlAUqK2U.js";import{c as a,d as m,a as Q,b as t,o as l}from"./app-BNrZTL3A.js";const e="/assets/image-Bo7VRP88.png",n="/assets/image-1-BQWACPqr.png",o="/assets/image-2-CgID8MXz.png",d="/assets/image-3-CrInC1ky.png",r="/assets/image-4-DIM28KDP.png",i={},g={class:"MathJax",jax:"SVG",style:{position:"relative"}},h={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},p={class:"MathJax",jax:"SVG",style:{position:"relative"}},H={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},u={class:"MathJax",jax:"SVG",style:{position:"relative"}},L={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},M={class:"MathJax",jax:"SVG",style:{position:"relative"}},w={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"},f={class:"MathJax",jax:"SVG",style:{position:"relative"}},x={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},Z={class:"MathJax",jax:"SVG",style:{position:"relative"}},v={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.98ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3969 1000","aria-hidden":"true"},c={class:"MathJax",jax:"SVG",style:{position:"relative"}},y={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"16.397ex",height:"1.984ex",role:"img",focusable:"false",viewBox:"0 -683 7247.6 877","aria-hidden":"true"},b={class:"MathJax",jax:"SVG",style:{position:"relative"}},D={style:{"vertical-align":"-0.339ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.307ex",height:"1.885ex",role:"img",focusable:"false",viewBox:"0 -683 1019.6 833","aria-hidden":"true"},V={class:"MathJax",jax:"SVG",style:{position:"relative"}},C={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.928ex",height:"1.545ex",role:"img",focusable:"false",viewBox:"0 -683 852 683","aria-hidden":"true"},j={class:"MathJax",jax:"SVG",style:{position:"relative"}},k={style:{"vertical-align":"-0.339ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.307ex",height:"1.885ex",role:"img",focusable:"false",viewBox:"0 -683 1019.6 833","aria-hidden":"true"},B={class:"MathJax",jax:"SVG",style:{position:"relative"}},S={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},J={class:"MathJax",jax:"SVG",style:{position:"relative"}},G={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.743ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 6958.5 834.8","aria-hidden":"true"},E={class:"MathJax",jax:"SVG",style:{position:"relative"}},F={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.743ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 6958.5 834.8","aria-hidden":"true"},A={class:"MathJax",jax:"SVG",style:{position:"relative"}},X={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"},R={class:"MathJax",jax:"SVG",style:{position:"relative"}},z={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.98ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3969 1000","aria-hidden":"true"},I={class:"MathJax",jax:"SVG",style:{position:"relative"}},P={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"12.518ex",height:"1.984ex",role:"img",focusable:"false",viewBox:"0 -683 5532.8 877","aria-hidden":"true"},N={class:"MathJax",jax:"SVG",style:{position:"relative"}},O={style:{"vertical-align":"-0.05ex"},xmlns:"http://www.w3.org/2000/svg",width:"1.74ex",height:"1.595ex",role:"img",focusable:"false",viewBox:"0 -683 769 705","aria-hidden":"true"},q={class:"MathJax",jax:"SVG",style:{position:"relative"}},K={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.928ex",height:"1.545ex",role:"img",focusable:"false",viewBox:"0 -683 852 683","aria-hidden":"true"},W={class:"MathJax",jax:"SVG",style:{position:"relative"}},U={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.743ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 6958.5 834.8","aria-hidden":"true"},Y={class:"MathJax",jax:"SVG",style:{position:"relative"}},$={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"},_={class:"MathJax",jax:"SVG",style:{position:"relative"}},Q1={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.743ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 6958.5 834.8","aria-hidden":"true"},T1={class:"MathJax",jax:"SVG",style:{position:"relative"}},t1={style:{"vertical-align":"-0.375ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.991ex",height:"1.906ex",role:"img",focusable:"false",viewBox:"0 -677 7068.1 842.6","aria-hidden":"true"},a1={class:"MathJax",jax:"SVG",style:{position:"relative"}},l1={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.418ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3720.6 1000","aria-hidden":"true"},m1={class:"MathJax",jax:"SVG",style:{position:"relative"}},n1={style:{"vertical-align":"-0.375ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.991ex",height:"1.906ex",role:"img",focusable:"false",viewBox:"0 -677 7068.1 842.6","aria-hidden":"true"},s1={class:"MathJax",jax:"SVG",style:{position:"relative"}},e1={style:{"vertical-align":"-0.339ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.991ex",height:"1.871ex",role:"img",focusable:"false",viewBox:"0 -677 7068.1 827","aria-hidden":"true"},o1={class:"MathJax",jax:"SVG",style:{position:"relative"}},d1={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.418ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3720.6 1000","aria-hidden":"true"},r1={class:"MathJax",jax:"SVG",style:{position:"relative"}},i1={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.418ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3720.6 1000","aria-hidden":"true"},g1={class:"MathJax",jax:"SVG",style:{position:"relative"}},h1={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.746ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3866 1000","aria-hidden":"true"},p1={class:"MathJax",jax:"SVG",style:{position:"relative"}},H1={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},u1={class:"MathJax",jax:"SVG",style:{position:"relative"}},L1={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},M1={class:"MathJax",jax:"SVG",style:{position:"relative"}},w1={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.17ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3611 1000","aria-hidden":"true"},f1={class:"MathJax",jax:"SVG",style:{position:"relative"}},x1={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},Z1={class:"MathJax",jax:"SVG",style:{position:"relative"}},v1={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},c1={class:"MathJax",jax:"SVG",style:{position:"relative"}},y1={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"},b1={class:"MathJax",jax:"SVG",style:{position:"relative"}},D1={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"21.976ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 9713.5 1000","aria-hidden":"true"},V1={class:"MathJax",jax:"SVG",style:{position:"relative"}},C1={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},j1={class:"MathJax",jax:"SVG",style:{position:"relative"}},k1={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"},B1={class:"MathJax",jax:"SVG",style:{position:"relative"}},S1={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"21.976ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 9713.5 1000","aria-hidden":"true"},J1={class:"MathJax",jax:"SVG",style:{position:"relative"}},G1={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},E1={class:"MathJax",jax:"SVG",style:{position:"relative"}},F1={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.994ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3975.6 1000","aria-hidden":"true"},A1={class:"MathJax",jax:"SVG",style:{position:"relative"}},X1={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.994ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3975.6 1000","aria-hidden":"true"},R1={class:"MathJax",jax:"SVG",style:{position:"relative"}},z1={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.418ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3720.6 1000","aria-hidden":"true"},I1={class:"MathJax",jax:"SVG",style:{position:"relative"}},P1={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.418ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3720.6 1000","aria-hidden":"true"},N1={class:"MathJax",jax:"SVG",style:{position:"relative"}},O1={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.418ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3720.6 1000","aria-hidden":"true"},q1={class:"MathJax",jax:"SVG",style:{position:"relative"}},K1={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},W1={class:"MathJax",jax:"SVG",style:{position:"relative"}},U1={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},Y1={class:"MathJax",jax:"SVG",style:{position:"relative"}},$1={style:{"vertical-align":"-0.339ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.309ex",height:"1.871ex",role:"img",focusable:"false",viewBox:"0 -677 1020.6 827","aria-hidden":"true"},_1={class:"MathJax",jax:"SVG",style:{position:"relative"}},Q2={style:{"vertical-align":"-0.339ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.309ex",height:"1.871ex",role:"img",focusable:"false",viewBox:"0 -677 1020.6 827","aria-hidden":"true"},T2={class:"MathJax",jax:"SVG",style:{position:"relative"}},t2={style:{"vertical-align":"-0.339ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.309ex",height:"1.871ex",role:"img",focusable:"false",viewBox:"0 -677 1020.6 827","aria-hidden":"true"},a2={class:"MathJax",jax:"SVG",style:{position:"relative"}},l2={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"16.397ex",height:"1.984ex",role:"img",focusable:"false",viewBox:"0 -683 7247.6 877","aria-hidden":"true"},m2={class:"MathJax",jax:"SVG",style:{position:"relative"}},n2={style:{"vertical-align":"-0.339ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.307ex",height:"1.885ex",role:"img",focusable:"false",viewBox:"0 -683 1019.6 833","aria-hidden":"true"},s2={class:"MathJax",jax:"SVG",style:{position:"relative"}},e2={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.928ex",height:"1.545ex",role:"img",focusable:"false",viewBox:"0 -683 852 683","aria-hidden":"true"},o2={class:"MathJax",jax:"SVG",style:{position:"relative"}},d2={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.746ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3866 1000","aria-hidden":"true"},r2={class:"MathJax",jax:"SVG",style:{position:"relative"}},i2={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},g2={class:"MathJax",jax:"SVG",style:{position:"relative"}},h2={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},p2={class:"MathJax",jax:"SVG",style:{position:"relative"}},H2={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"16.397ex",height:"1.984ex",role:"img",focusable:"false",viewBox:"0 -683 7247.6 877","aria-hidden":"true"},u2={class:"MathJax",jax:"SVG",style:{position:"relative"}},L2={style:{"vertical-align":"-0.339ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.307ex",height:"1.885ex",role:"img",focusable:"false",viewBox:"0 -683 1019.6 833","aria-hidden":"true"},M2={class:"MathJax",jax:"SVG",style:{position:"relative"}},w2={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.928ex",height:"1.545ex",role:"img",focusable:"false",viewBox:"0 -683 852 683","aria-hidden":"true"},f2={class:"MathJax",jax:"SVG",style:{position:"relative"}},x2={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.085ex",height:"1.984ex",role:"img",focusable:"false",viewBox:"0 -683 5783.4 877","aria-hidden":"true"},Z2={class:"MathJax",jax:"SVG",style:{position:"relative"}},v2={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.198ex",height:"1.927ex",role:"img",focusable:"false",viewBox:"0 -694 5833.5 851.8","aria-hidden":"true"},c2={class:"MathJax",jax:"SVG",style:{position:"relative"}},y2={style:{"vertical-align":"-0.339ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.307ex",height:"1.885ex",role:"img",focusable:"false",viewBox:"0 -683 1019.6 833","aria-hidden":"true"},b2={class:"MathJax",jax:"SVG",style:{position:"relative"}},D2={style:{"vertical-align":"-0.339ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.307ex",height:"1.885ex",role:"img",focusable:"false",viewBox:"0 -683 1019.6 833","aria-hidden":"true"},V2={class:"MathJax",jax:"SVG",style:{position:"relative"}},C2={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"16.397ex",height:"1.984ex",role:"img",focusable:"false",viewBox:"0 -683 7247.6 877","aria-hidden":"true"},j2={class:"MathJax",jax:"SVG",style:{position:"relative"}},k2={style:{"vertical-align":"-0.05ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.871ex",height:"1.595ex",role:"img",focusable:"false",viewBox:"0 -683 1269 705","aria-hidden":"true"},B2={class:"MathJax",jax:"SVG",style:{position:"relative"}},S2={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.928ex",height:"1.545ex",role:"img",focusable:"false",viewBox:"0 -683 852 683","aria-hidden":"true"},J2={class:"MathJax",jax:"SVG",style:{position:"relative"}},G2={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.17ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3611 1000","aria-hidden":"true"},E2={class:"MathJax",jax:"SVG",style:{position:"relative"}},F2={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},A2={class:"MathJax",jax:"SVG",style:{position:"relative"}},X2={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"16.397ex",height:"1.984ex",role:"img",focusable:"false",viewBox:"0 -683 7247.6 877","aria-hidden":"true"},R2={class:"MathJax",jax:"SVG",style:{position:"relative"}},z2={style:{"vertical-align":"-0.339ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.307ex",height:"1.885ex",role:"img",focusable:"false",viewBox:"0 -683 1019.6 833","aria-hidden":"true"},I2={class:"MathJax",jax:"SVG",style:{position:"relative"}},P2={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.928ex",height:"1.545ex",role:"img",focusable:"false",viewBox:"0 -683 852 683","aria-hidden":"true"},N2={class:"MathJax",jax:"SVG",style:{position:"relative"}},O2={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"},q2={class:"MathJax",jax:"SVG",style:{position:"relative"}},K2={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.743ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 6958.5 834.8","aria-hidden":"true"},W2={class:"MathJax",jax:"SVG",style:{position:"relative"}},U2={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.198ex",height:"1.927ex",role:"img",focusable:"false",viewBox:"0 -694 5833.5 851.8","aria-hidden":"true"},Y2={class:"MathJax",jax:"SVG",style:{position:"relative"}},$2={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"},_2={class:"MathJax",jax:"SVG",style:{position:"relative"}},Q4={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.743ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 6958.5 834.8","aria-hidden":"true"},T4={class:"MathJax",jax:"SVG",style:{position:"relative"}},t4={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.198ex",height:"1.927ex",role:"img",focusable:"false",viewBox:"0 -694 5833.5 851.8","aria-hidden":"true"},a4={class:"MathJax",jax:"SVG",style:{position:"relative"}},l4={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},m4={class:"MathJax",jax:"SVG",style:{position:"relative"}},n4={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},s4={class:"MathJax",jax:"SVG",style:{position:"relative"}},e4={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.198ex",height:"1.927ex",role:"img",focusable:"false",viewBox:"0 -694 5833.5 851.8","aria-hidden":"true"},o4={class:"MathJax",jax:"SVG",style:{position:"relative"}},d4={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},r4={class:"MathJax",jax:"SVG",style:{position:"relative"}},i4={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.994ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3975.6 1000","aria-hidden":"true"},g4={class:"MathJax",jax:"SVG",style:{position:"relative"}},h4={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.717ex",height:"1.545ex",role:"img",focusable:"false",viewBox:"0 -683 759 683","aria-hidden":"true"},p4={class:"MathJax",jax:"SVG",style:{position:"relative"}},H4={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.697ex",height:"1.62ex",role:"img",focusable:"false",viewBox:"0 -716 750 716","aria-hidden":"true"},u4={class:"MathJax",jax:"SVG",style:{position:"relative"}},L4={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.34ex",height:"1.984ex",role:"img",focusable:"false",viewBox:"0 -683 6780.4 877","aria-hidden":"true"},M4={class:"MathJax",jax:"SVG",style:{position:"relative"}},w4={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.32ex",height:"2.059ex",role:"img",focusable:"false",viewBox:"0 -716 6771.4 910","aria-hidden":"true"},f4={class:"MathJax",jax:"SVG",style:{position:"relative"}},x4={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.194ex",height:"2.009ex",role:"img",focusable:"false",viewBox:"0 -694 5831.8 888","aria-hidden":"true"},Z4={class:"MathJax",jax:"SVG",style:{position:"relative"}},v4={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.418ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3720.6 1000","aria-hidden":"true"},c4={class:"MathJax",jax:"SVG",style:{position:"relative"}},y4={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.994ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3975.6 1000","aria-hidden":"true"},b4={class:"MathJax",jax:"SVG",style:{position:"relative"}},D4={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.697ex",height:"1.62ex",role:"img",focusable:"false",viewBox:"0 -716 750 716","aria-hidden":"true"},V4={class:"MathJax",jax:"SVG",style:{position:"relative"}},C4={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.717ex",height:"1.545ex",role:"img",focusable:"false",viewBox:"0 -683 759 683","aria-hidden":"true"},j4={class:"MathJax",jax:"SVG",style:{position:"relative"}},k4={style:{"vertical-align":"-0.05ex"},xmlns:"http://www.w3.org/2000/svg",width:"1.719ex",height:"1.645ex",role:"img",focusable:"false",viewBox:"0 -705 760 727","aria-hidden":"true"},B4={class:"MathJax",jax:"SVG",style:{position:"relative"}},S4={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"14.211ex",height:"2.034ex",role:"img",focusable:"false",viewBox:"0 -705 6281.4 899","aria-hidden":"true"},J4={class:"MathJax",jax:"SVG",style:{position:"relative"}},G4={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.194ex",height:"2.009ex",role:"img",focusable:"false",viewBox:"0 -694 5831.8 888","aria-hidden":"true"},E4={class:"MathJax",jax:"SVG",style:{position:"relative"}},F4={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.418ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3720.6 1000","aria-hidden":"true"},A4={class:"MathJax",jax:"SVG",style:{position:"relative"}},X4={style:{"vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"8.418ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 3720.6 1000","aria-hidden":"true"},R4={class:"MathJax",jax:"SVG",style:{position:"relative"}},z4={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.697ex",height:"1.62ex",role:"img",focusable:"false",viewBox:"0 -716 750 716","aria-hidden":"true"},I4={class:"MathJax",jax:"SVG",style:{position:"relative"}},P4={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.717ex",height:"1.545ex",role:"img",focusable:"false",viewBox:"0 -683 759 683","aria-hidden":"true"},N4={class:"MathJax",jax:"SVG",style:{position:"relative"}},O4={style:{"vertical-align":"-0.05ex"},xmlns:"http://www.w3.org/2000/svg",width:"1.719ex",height:"1.645ex",role:"img",focusable:"false",viewBox:"0 -705 760 727","aria-hidden":"true"},q4={class:"MathJax",jax:"SVG",style:{position:"relative"}},K4={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"18.261ex",height:"2.009ex",role:"img",focusable:"false",viewBox:"0 -694 8071.6 888","aria-hidden":"true"},W4={class:"MathJax",jax:"SVG",style:{position:"relative"}},U4={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"18.261ex",height:"2.009ex",role:"img",focusable:"false",viewBox:"0 -694 8071.6 888","aria-hidden":"true"},Y4={class:"MathJax",jax:"SVG",style:{position:"relative"}},$4={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.541ex",height:"1.545ex",role:"img",focusable:"false",viewBox:"0 -683 681 683","aria-hidden":"true"},_4={class:"MathJax",jax:"SVG",style:{position:"relative"}},Q3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},T3={class:"MathJax",jax:"SVG",style:{position:"relative"}},t3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"},a3={class:"MathJax",jax:"SVG",style:{position:"relative"}},l3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"},m3={class:"MathJax",jax:"SVG",style:{position:"relative"}},n3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"},s3={class:"MathJax",jax:"SVG",style:{position:"relative"}},e3={style:{"vertical-align":"-0.666ex"},xmlns:"http://www.w3.org/2000/svg",width:"17.19ex",height:"2.211ex",role:"img",focusable:"false",viewBox:"0 -683 7597.9 977.2","aria-hidden":"true"},o3={class:"MathJax",jax:"SVG",style:{position:"relative"}},d3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.743ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 6958.5 834.8","aria-hidden":"true"},r3={class:"MathJax",jax:"SVG",style:{position:"relative"}},i3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},g3={class:"MathJax",jax:"SVG",style:{position:"relative"}},h3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},p3={class:"MathJax",jax:"SVG",style:{position:"relative"}},H3={style:{"vertical-align":"-0.666ex"},xmlns:"http://www.w3.org/2000/svg",width:"17.19ex",height:"2.211ex",role:"img",focusable:"false",viewBox:"0 -683 7597.9 977.2","aria-hidden":"true"},u3={class:"MathJax",jax:"SVG",style:{position:"relative"}},L3={style:{"vertical-align":"-0.339ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.307ex",height:"1.885ex",role:"img",focusable:"false",viewBox:"0 -683 1019.6 833","aria-hidden":"true"},M3={class:"MathJax",jax:"SVG",style:{position:"relative"}},w3={style:{"vertical-align":"-0.666ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.72ex",height:"2.211ex",role:"img",focusable:"false",viewBox:"0 -683 1202.3 977.2","aria-hidden":"true"},f3={class:"MathJax",jax:"SVG",style:{position:"relative"}},x3={style:{"vertical-align":"-0.666ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.877ex",height:"2.211ex",role:"img",focusable:"false",viewBox:"0 -683 6133.7 977.2","aria-hidden":"true"},Z3={class:"MathJax",jax:"SVG",style:{position:"relative"}},v3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"},c3={class:"MathJax",jax:"SVG",style:{position:"relative"}},y3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.198ex",height:"1.927ex",role:"img",focusable:"false",viewBox:"0 -694 5833.5 851.8","aria-hidden":"true"},b3={class:"MathJax",jax:"SVG",style:{position:"relative"}},D3={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"18.261ex",height:"2.009ex",role:"img",focusable:"false",viewBox:"0 -694 8071.6 888","aria-hidden":"true"},V3={class:"MathJax",jax:"SVG",style:{position:"relative"}},C3={style:{"vertical-align":"0"},xmlns:"http://www.w3.org/2000/svg",width:"1.541ex",height:"1.545ex",role:"img",focusable:"false",viewBox:"0 -683 681 683","aria-hidden":"true"},j3={class:"MathJax",jax:"SVG",style:{position:"relative"}},k3={style:{"vertical-align":"-0.439ex"},xmlns:"http://www.w3.org/2000/svg",width:"18.261ex",height:"2.009ex",role:"img",focusable:"false",viewBox:"0 -694 8071.6 888","aria-hidden":"true"},B3={class:"MathJax",jax:"SVG",style:{position:"relative"}},S3={style:{"vertical-align":"-0.666ex"},xmlns:"http://www.w3.org/2000/svg",width:"17.19ex",height:"2.211ex",role:"img",focusable:"false",viewBox:"0 -683 7597.9 977.2","aria-hidden":"true"},J3={class:"MathJax",jax:"SVG",style:{position:"relative"}},G3={style:{"vertical-align":"-0.339ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.307ex",height:"1.885ex",role:"img",focusable:"false",viewBox:"0 -683 1019.6 833","aria-hidden":"true"},E3={class:"MathJax",jax:"SVG",style:{position:"relative"}},F3={style:{"vertical-align":"-0.666ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.72ex",height:"2.211ex",role:"img",focusable:"false",viewBox:"0 -683 1202.3 977.2","aria-hidden":"true"},A3={class:"MathJax",jax:"SVG",style:{position:"relative"}},X3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"},R3={class:"MathJax",jax:"SVG",style:{position:"relative"}},z3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},I3={class:"MathJax",jax:"SVG",style:{position:"relative"}},P3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.743ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 6958.5 834.8","aria-hidden":"true"},N3={class:"MathJax",jax:"SVG",style:{position:"relative"}},O3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.198ex",height:"1.927ex",role:"img",focusable:"false",viewBox:"0 -694 5833.5 851.8","aria-hidden":"true"},q3={class:"MathJax",jax:"SVG",style:{position:"relative"}},K3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},W3={class:"MathJax",jax:"SVG",style:{position:"relative"}},U3={style:{"vertical-align":"-0.666ex"},xmlns:"http://www.w3.org/2000/svg",width:"17.19ex",height:"2.211ex",role:"img",focusable:"false",viewBox:"0 -683 7597.9 977.2","aria-hidden":"true"},Y3={class:"MathJax",jax:"SVG",style:{position:"relative"}},$3={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},_3={class:"MathJax",jax:"SVG",style:{position:"relative"}},Q6={style:{"vertical-align":"-0.05ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.871ex",height:"1.595ex",role:"img",focusable:"false",viewBox:"0 -683 1269 705","aria-hidden":"true"},T6={class:"MathJax",jax:"SVG",style:{position:"relative"}},t6={style:{"vertical-align":"-0.462ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.86ex",height:"2.007ex",role:"img",focusable:"false",viewBox:"0 -683 1264 887","aria-hidden":"true"},a6={class:"MathJax",jax:"SVG",style:{position:"relative"}},l6={style:{"vertical-align":"-0.666ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.877ex",height:"2.211ex",role:"img",focusable:"false",viewBox:"0 -683 6133.7 977.2","aria-hidden":"true"},m6={class:"MathJax",jax:"SVG",style:{position:"relative"}},n6={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"},s6={class:"MathJax",jax:"SVG",style:{position:"relative"}},e6={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},o6={class:"MathJax",jax:"SVG",style:{position:"relative"}},d6={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.198ex",height:"1.927ex",role:"img",focusable:"false",viewBox:"0 -694 5833.5 851.8","aria-hidden":"true"},r6={class:"MathJax",jax:"SVG",style:{position:"relative"}},i6={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.061ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 911 834.8","aria-hidden":"true"},g6={class:"MathJax",jax:"SVG",style:{position:"relative"}},h6={style:{"vertical-align":"-0.357ex"},xmlns:"http://www.w3.org/2000/svg",width:"13.008ex",height:"1.889ex",role:"img",focusable:"false",viewBox:"0 -677 5749.5 834.8","aria-hidden":"true"};function p6(H6,T){return l(),a("div",null,[T[512]||(T[512]=m('

故障分类

恢复算法

',3)),Q("ul",null,[Q("li",null,[T[2]||(T[2]=t("考虑一个将 50 美元从账户 A 转账到账户 B 的事务")),Q("mjx-container",g,[(l(),a("svg",h,T[0]||(T[0]=[m('',1)]))),T[1]||(T[1]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[3]||(T[3]=t(": ")),T[4]||(T[4]=Q("ol",null,[Q("li",null,"读取(A)"),Q("li",null,"A := A - 50"),Q("li",null,"写入(A)"),Q("li",null,"读取(B)"),Q("li",null,"B := B + 50"),Q("li",null,"写入(B)")],-1))]),Q("li",null,[T[7]||(T[7]=t("事务")),Q("mjx-container",p,[(l(),a("svg",H,T[5]||(T[5]=[m('',1)]))),T[6]||(T[6]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[8]||(T[8]=t("需要将对 A 和 B 的更新输出到数据库。"))]),T[9]||(T[9]=Q("li",null,"在这些修改中的某个修改完成之后,但两者都未完成之前,可能发生故障。",-1)),T[10]||(T[10]=Q("li",null,"在没有确保事务将提交的情况下修改数据库可能会导致数据库处于不一致的状态。",-1)),T[11]||(T[11]=Q("li",null,"如果在事务提交后发生故障,不修改数据库可能会导致更新丢失。",-1)),T[12]||(T[12]=Q("li",null,[t("恢复算法分为两个部分: "),Q("ol",null,[Q("li",null,"在正常事务处理期间采取的操作,以确保存在足够的信息以从故障中恢复。"),Q("li",null,"在发生故障后采取的操作,将数据库内容恢复到确保原子性、一致性和持久性的状态。")])],-1))]),T[513]||(T[513]=m('

存储结构

实现稳定存储(Stable-Storage Implementation)

在单独的磁盘上维护每个块的多个副本:

保护存储介质免受数据传输期间的故障(一种解决方案):

数据访问(Data Access)

恢复与原子性

为了确保在发生故障时实现原子性,我们首先将描述修改的信息输出到稳定存储中,而不修改数据库本身。

基于日志的恢复

',13)),Q("ul",null,[T[46]||(T[46]=Q("li",null,"在稳定存储中保留一个日志。",-1)),T[47]||(T[47]=Q("li",null,"日志是一系列日志记录,用于记录数据库上的更新活动。",-1)),Q("li",null,[T[17]||(T[17]=t("当事务")),Q("mjx-container",u,[(l(),a("svg",L,T[13]||(T[13]=[m('',1)]))),T[14]||(T[14]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[18]||(T[18]=t("启动时,它通过写入")),Q("mjx-container",M,[(l(),a("svg",w,T[15]||(T[15]=[m('',1)]))),T[16]||(T[16]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[19]||(T[19]=t("日志记录来注册自己。"))]),Q("li",null,[T[32]||(T[32]=t("在")),Q("mjx-container",f,[(l(),a("svg",x,T[20]||(T[20]=[m('',1)]))),T[21]||(T[21]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[33]||(T[33]=t("执行")),Q("mjx-container",Z,[(l(),a("svg",v,T[22]||(T[22]=[m('',1)]))),T[23]||(T[23]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"w"),Q("mi",null,"r"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mi",null,"e"),Q("mo",{stretchy:"false"},"("),Q("mi",null,"X"),Q("mo",{stretchy:"false"},")")])],-1))]),T[34]||(T[34]=t("之前,会写入一个日志记录")),Q("mjx-container",c,[(l(),a("svg",y,T[24]||(T[24]=[m('',1)]))),T[25]||(T[25]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",null,","),Q("mi",null,"X"),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"2")]),Q("mo",null,">")])],-1))]),T[35]||(T[35]=t(",其中")),Q("mjx-container",b,[(l(),a("svg",D,T[26]||(T[26]=[m('',1)]))),T[27]||(T[27]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")])])],-1))]),T[36]||(T[36]=t("是写入前")),Q("mjx-container",V,[(l(),a("svg",C,T[28]||(T[28]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D44B",d:"M42 0H40Q26 0 26 11Q26 15 29 27Q33 41 36 43T55 46Q141 49 190 98Q200 108 306 224T411 342Q302 620 297 625Q288 636 234 637H206Q200 643 200 645T202 664Q206 677 212 683H226Q260 681 347 681Q380 681 408 681T453 682T473 682Q490 682 490 671Q490 670 488 658Q484 643 481 640T465 637Q434 634 411 620L488 426L541 485Q646 598 646 610Q646 628 622 635Q617 635 609 637Q594 637 594 648Q594 650 596 664Q600 677 606 683H618Q619 683 643 683T697 681T738 680Q828 680 837 683H845Q852 676 852 672Q850 647 840 637H824Q790 636 763 628T722 611T698 593L687 584Q687 585 592 480L505 384Q505 383 536 304T601 142T638 56Q648 47 699 46Q734 46 734 37Q734 35 732 23Q728 7 725 4T711 1Q708 1 678 1T589 2Q528 2 496 2T461 1Q444 1 444 10Q444 11 446 25Q448 35 450 39T455 44T464 46T480 47T506 54Q523 62 523 64Q522 64 476 181L429 299Q241 95 236 84Q232 76 232 72Q232 53 261 47Q262 47 267 47T273 46Q276 46 277 46T280 45T283 42T284 35Q284 26 282 19Q279 6 276 4T261 1Q258 1 243 1T201 2T142 2Q64 2 42 0Z"})])])],-1)]))),T[29]||(T[29]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"X")])],-1))]),T[37]||(T[37]=t("的值(旧值),")),Q("mjx-container",j,[(l(),a("svg",k,T[30]||(T[30]=[m('',1)]))),T[31]||(T[31]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"2")])])],-1))]),T[38]||(T[38]=t("是要写入 X 的值(新值)。"))]),Q("li",null,[T[43]||(T[43]=t("当")),Q("mjx-container",B,[(l(),a("svg",S,T[39]||(T[39]=[m('',1)]))),T[40]||(T[40]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[44]||(T[44]=t("完成最后一条语句时,会写入日志记录")),Q("mjx-container",J,[(l(),a("svg",G,T[41]||(T[41]=[m('',1)]))),T[42]||(T[42]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"c"),Q("mi",null,"o"),Q("mi",null,"m"),Q("mi",null,"m"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[45]||(T[45]=t("。"))]),T[48]||(T[48]=Q("li",null,[t("使用日志的两种方法: "),Q("ul",null,[Q("li",null,"延迟数据库修改(Deferred database modification):需要更大的内存开销。"),Q("li",null,"立即数据库修改(Immediate database modification):重点掌握。")])],-1))]),T[514]||(T[514]=Q("h3",{id:"事务提交",tabindex:"-1"},[Q("a",{class:"header-anchor",href:"#事务提交"},[Q("span",null,"事务提交")])],-1)),Q("ul",null,[Q("li",null,[T[51]||(T[51]=t("日志部分:当事务的提交日志记录")),Q("mjx-container",E,[(l(),a("svg",F,T[49]||(T[49]=[m('',1)]))),T[50]||(T[50]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"c"),Q("mi",null,"o"),Q("mi",null,"m"),Q("mi",null,"m"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[52]||(T[52]=t("被输出到稳定存储时,称该事务已提交。"))]),T[53]||(T[53]=Q("li",null,"该事务的所有先前的日志记录必须已经输出。",-1)),T[54]||(T[54]=Q("li",null,"数据更新部分:当事务提交时,事务执行的写操作可能仍然在缓冲区中,并且可能稍后才被输出。",-1))]),T[515]||(T[515]=Q("h3",{id:"方法-1-延迟数据库修改-deferred-database-modification",tabindex:"-1"},[Q("a",{class:"header-anchor",href:"#方法-1-延迟数据库修改-deferred-database-modification"},[Q("span",null,"方法 1: 延迟数据库修改(Deferred Database Modification)")])],-1)),Q("ul",null,[T[105]||(T[105]=Q("li",null,"延迟数据库修改方案将所有修改记录到日志中,但将所有写操作推迟到部分提交之后执行。",-1)),Q("li",null,[T[76]||(T[76]=t("假设事务按顺序执行: ")),Q("ul",null,[Q("li",null,[T[57]||(T[57]=t("开始时:事务通过向日志写入")),Q("mjx-container",A,[(l(),a("svg",X,T[55]||(T[55]=[m('',1)]))),T[56]||(T[56]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[58]||(T[58]=t("记录开始。"))]),Q("li",null,[T[67]||(T[67]=t("过程中:执行")),Q("mjx-container",R,[(l(),a("svg",z,T[59]||(T[59]=[m('',1)]))),T[60]||(T[60]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"w"),Q("mi",null,"r"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mi",null,"e"),Q("mo",{stretchy:"false"},"("),Q("mi",null,"X"),Q("mo",{stretchy:"false"},")")])],-1))]),T[68]||(T[68]=t("操作(但不实际执行),会写入日志记录")),Q("mjx-container",I,[(l(),a("svg",P,T[61]||(T[61]=[m('',1)]))),T[62]||(T[62]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",null,","),Q("mi",null,"X"),Q("mo",null,","),Q("mi",null,"V"),Q("mo",null,">")])],-1))]),T[69]||(T[69]=t(",其中")),Q("mjx-container",N,[(l(),a("svg",O,T[63]||(T[63]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D449",d:"M52 648Q52 670 65 683H76Q118 680 181 680Q299 680 320 683H330Q336 677 336 674T334 656Q329 641 325 637H304Q282 635 274 635Q245 630 242 620Q242 618 271 369T301 118L374 235Q447 352 520 471T595 594Q599 601 599 609Q599 633 555 637Q537 637 537 648Q537 649 539 661Q542 675 545 679T558 683Q560 683 570 683T604 682T668 681Q737 681 755 683H762Q769 676 769 672Q769 655 760 640Q757 637 743 637Q730 636 719 635T698 630T682 623T670 615T660 608T652 599T645 592L452 282Q272 -9 266 -16Q263 -18 259 -21L241 -22H234Q216 -22 216 -15Q213 -9 177 305Q139 623 138 626Q133 637 76 637H59Q52 642 52 648Z"})])])],-1)]))),T[64]||(T[64]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"V")])],-1))]),T[70]||(T[70]=t("是")),Q("mjx-container",q,[(l(),a("svg",K,T[65]||(T[65]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D44B",d:"M42 0H40Q26 0 26 11Q26 15 29 27Q33 41 36 43T55 46Q141 49 190 98Q200 108 306 224T411 342Q302 620 297 625Q288 636 234 637H206Q200 643 200 645T202 664Q206 677 212 683H226Q260 681 347 681Q380 681 408 681T453 682T473 682Q490 682 490 671Q490 670 488 658Q484 643 481 640T465 637Q434 634 411 620L488 426L541 485Q646 598 646 610Q646 628 622 635Q617 635 609 637Q594 637 594 648Q594 650 596 664Q600 677 606 683H618Q619 683 643 683T697 681T738 680Q828 680 837 683H845Q852 676 852 672Q850 647 840 637H824Q790 636 763 628T722 611T698 593L687 584Q687 585 592 480L505 384Q505 383 536 304T601 142T638 56Q648 47 699 46Q734 46 734 37Q734 35 732 23Q728 7 725 4T711 1Q708 1 678 1T589 2Q528 2 496 2T461 1Q444 1 444 10Q444 11 446 25Q448 35 450 39T455 44T464 46T480 47T506 54Q523 62 523 64Q522 64 476 181L429 299Q241 95 236 84Q232 76 232 72Q232 53 261 47Q262 47 267 47T273 46Q276 46 277 46T280 45T283 42T284 35Q284 26 282 19Q279 6 276 4T261 1Q258 1 243 1T201 2T142 2Q64 2 42 0Z"})])])],-1)]))),T[66]||(T[66]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"X")])],-1))]),T[71]||(T[71]=t("的新值。注意:该方案不需要旧值。"))]),Q("li",null,[T[74]||(T[74]=t("结束时:当事务部分提交(即执行完所有语句),")),Q("mjx-container",W,[(l(),a("svg",U,T[72]||(T[72]=[m('',1)]))),T[73]||(T[73]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"c"),Q("mi",null,"o"),Q("mi",null,"m"),Q("mi",null,"m"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[75]||(T[75]=t("被写入日志;读取日志记录并用于实际执行之前推迟的写操作。"))])])]),T[106]||(T[106]=Q("li",null,[t("在以下情况下可能发生故障: "),Q("ul",null,[Q("li",null,"事务正在执行原始的更新操作时"),Q("li",null,"正在进行恢复操作时")])],-1)),Q("li",null,[T[86]||(T[86]=t("故障发生后的处理方法: ")),Q("ul",null,[Q("li",null,[T[81]||(T[81]=t("只有在日志中同时存在")),Q("mjx-container",Y,[(l(),a("svg",$,T[77]||(T[77]=[m('',1)]))),T[78]||(T[78]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[82]||(T[82]=t("和")),Q("mjx-container",_,[(l(),a("svg",Q1,T[79]||(T[79]=[m('',1)]))),T[80]||(T[80]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"c"),Q("mi",null,"o"),Q("mi",null,"m"),Q("mi",null,"m"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[83]||(T[83]=t("记录时,才需要重新执行事务。")),T[84]||(T[84]=Q("br",null,null,-1)),T[85]||(T[85]=Q("img",{src:n,alt:"错误恢复示例",loading:"lazy"},null,-1))])])]),T[107]||(T[107]=Q("li",null,"(a) 无需执行重做操作",-1)),Q("li",null,[T[91]||(T[91]=t("(b) 由于存在 ")),Q("mjx-container",T1,[(l(),a("svg",t1,T[87]||(T[87]=[m('',1)]))),T[88]||(T[88]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"0")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"c"),Q("mi",null,"o"),Q("mi",null,"m"),Q("mi",null,"m"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[92]||(T[92]=t(",因此必须执行 ")),Q("mjx-container",a1,[(l(),a("svg",l1,T[89]||(T[89]=[m('',1)]))),T[90]||(T[90]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"r"),Q("mi",null,"e"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"0")]),Q("mo",{stretchy:"false"},")")])],-1))])]),Q("li",null,[T[101]||(T[101]=t("(c) 由于 ")),Q("mjx-container",m1,[(l(),a("svg",n1,T[93]||(T[93]=[m('',1)]))),T[94]||(T[94]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"0")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"c"),Q("mi",null,"o"),Q("mi",null,"m"),Q("mi",null,"m"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[102]||(T[102]=t(" 和 ")),Q("mjx-container",s1,[(l(),a("svg",e1,T[95]||(T[95]=[m('',1)]))),T[96]||(T[96]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"1")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"c"),Q("mi",null,"o"),Q("mi",null,"m"),Q("mi",null,"m"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[103]||(T[103]=t(" 存在,必须执行 ")),Q("mjx-container",o1,[(l(),a("svg",d1,T[97]||(T[97]=[m('',1)]))),T[98]||(T[98]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"r"),Q("mi",null,"e"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"0")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[104]||(T[104]=t(",然后执行 ")),Q("mjx-container",r1,[(l(),a("svg",i1,T[99]||(T[99]=[m('',1)]))),T[100]||(T[100]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"r"),Q("mi",null,"e"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"1")]),Q("mo",{stretchy:"false"},")")])],-1))])])]),T[516]||(T[516]=m('

方法 2: 立即数据库修改(Immediate Database Modification)

在故障发生前的常规做法:

  1. 先写日志,后执行写操作:
  2. 写操作立即执行:
  3. 输出可能发生在任意时刻:
  4. 输出的顺序是任意的:
',3)),Q("ul",null,[Q("li",null,[T[126]||(T[126]=t("恢复过程需要两个操作而不是一个: ")),Q("ul",null,[Q("li",null,[Q("mjx-container",g1,[(l(),a("svg",h1,T[108]||(T[108]=[m('',1)]))),T[109]||(T[109]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"u"),Q("mi",null,"n"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[114]||(T[114]=t("将事务")),Q("mjx-container",p1,[(l(),a("svg",H1,T[110]||(T[110]=[m('',1)]))),T[111]||(T[111]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[115]||(T[115]=t("更新的所有数据项的值恢复为旧值,从")),Q("mjx-container",u1,[(l(),a("svg",L1,T[112]||(T[112]=[m('',1)]))),T[113]||(T[113]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[116]||(T[116]=t("的最后一个日志记录开始向后执行。"))]),Q("li",null,[Q("mjx-container",M1,[(l(),a("svg",w1,T[117]||(T[117]=[m('',1)]))),T[118]||(T[118]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"r"),Q("mi",null,"e"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[123]||(T[123]=t("将事务")),Q("mjx-container",f1,[(l(),a("svg",x1,T[119]||(T[119]=[m('',1)]))),T[120]||(T[120]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[124]||(T[124]=t("更新的所有数据项的值设置为新值,从")),Q("mjx-container",Z1,[(l(),a("svg",v1,T[121]||(T[121]=[m('',1)]))),T[122]||(T[122]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[125]||(T[125]=t("的第一个日志记录开始向前执行。"))])])]),T[168]||(T[168]=Q("li",null,[t("这两个操作必须是"),Q("code",null,"幂等(idempotent)"),t("的,即使操作执行多次,效果与执行一次相同。")],-1)),Q("li",null,[T[149]||(T[149]=t("在故障后进行恢复时: ")),Q("ul",null,[Q("li",null,[T[133]||(T[133]=t("如果日志中包含记录")),Q("mjx-container",c1,[(l(),a("svg",y1,T[127]||(T[127]=[m('',1)]))),T[128]||(T[128]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[134]||(T[134]=t(",但不包含记录")),Q("mjx-container",b1,[(l(),a("svg",D1,T[129]||(T[129]=[m('',1)]))),T[130]||(T[130]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"c"),Q("mi",null,"o"),Q("mi",null,"m"),Q("mi",null,"m"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mrow",{"data-mjx-texclass":"ORD"},[Q("mo",null,"/")]),Q("mi",null,"a"),Q("mi",null,"b"),Q("mi",null,"o"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[135]||(T[135]=t(",则需要撤销事务")),Q("mjx-container",V1,[(l(),a("svg",C1,T[131]||(T[131]=[m('',1)]))),T[132]||(T[132]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[136]||(T[136]=t("。"))]),Q("li",null,[T[143]||(T[143]=t("如果日志中同时包含记录")),Q("mjx-container",j1,[(l(),a("svg",k1,T[137]||(T[137]=[m('',1)]))),T[138]||(T[138]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[144]||(T[144]=t("和")),Q("mjx-container",B1,[(l(),a("svg",S1,T[139]||(T[139]=[m('',1)]))),T[140]||(T[140]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"c"),Q("mi",null,"o"),Q("mi",null,"m"),Q("mi",null,"m"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mrow",{"data-mjx-texclass":"ORD"},[Q("mo",null,"/")]),Q("mi",null,"a"),Q("mi",null,"b"),Q("mi",null,"o"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[145]||(T[145]=t(",则需要重做事务")),Q("mjx-container",J1,[(l(),a("svg",G1,T[141]||(T[141]=[m('',1)]))),T[142]||(T[142]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[146]||(T[146]=t("。")),T[147]||(T[147]=Q("br",null,null,-1)),T[148]||(T[148]=Q("img",{src:n,alt:"错误恢复示例",loading:"lazy"},null,-1))])])]),Q("li",null,[T[152]||(T[152]=t("(a) ")),Q("mjx-container",E1,[(l(),a("svg",F1,T[150]||(T[150]=[m('',1)]))),T[151]||(T[151]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"u"),Q("mi",null,"n"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"0")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[153]||(T[153]=t(":B 恢复为 2000,A 恢复为 1000。"))]),Q("li",null,[T[158]||(T[158]=t("(b) ")),Q("mjx-container",A1,[(l(),a("svg",X1,T[154]||(T[154]=[m('',1)]))),T[155]||(T[155]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"u"),Q("mi",null,"n"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"1")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[159]||(T[159]=t("和")),Q("mjx-container",R1,[(l(),a("svg",z1,T[156]||(T[156]=[m('',1)]))),T[157]||(T[157]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"r"),Q("mi",null,"e"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"0")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[160]||(T[160]=t(":C 恢复为 700,然后 A 和 B 恢复分别设置为 950 和 2050。"))]),Q("li",null,[T[165]||(T[165]=t("(c) ")),Q("mjx-container",I1,[(l(),a("svg",P1,T[161]||(T[161]=[m('',1)]))),T[162]||(T[162]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"r"),Q("mi",null,"e"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"0")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[166]||(T[166]=t("和")),Q("mjx-container",N1,[(l(),a("svg",O1,T[163]||(T[163]=[m('',1)]))),T[164]||(T[164]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"r"),Q("mi",null,"e"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"1")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[167]||(T[167]=t(":A 和 B 分别设置为 950 和 2050。然后 C 设置为 600"))])]),T[517]||(T[517]=Q("h3",{id:"对比",tabindex:"-1"},[Q("a",{class:"header-anchor",href:"#对比"},[Q("span",null,"对比")])],-1)),T[518]||(T[518]=Q("ul",null,[Q("li",null,"延迟修改方案仅在事务提交时或之后才对缓冲区/磁盘执行更新,简化了恢复的某些方面,但有存储本地副本的开销"),Q("li",null,"接下来介绍的算法都采用立即数据库修改(Immediate Database Modification)")],-1)),T[519]||(T[519]=Q("h3",{id:"并发控制和恢复",tabindex:"-1"},[Q("a",{class:"header-anchor",href:"#并发控制和恢复"},[Q("span",null,"并发控制和恢复")])],-1)),Q("ul",null,[T[187]||(T[187]=Q("li",null,"在并发事务中,所有事务共享一个单一的磁盘缓冲区和一个单一的日志。",-1)),T[188]||(T[188]=Q("li",null,"一个缓冲块可以包含被一个或多个事务更新的数据项。",-1)),Q("li",null,[T[173]||(T[173]=t("我们假设如果事务")),Q("mjx-container",q1,[(l(),a("svg",K1,T[169]||(T[169]=[m('',1)]))),T[170]||(T[170]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[174]||(T[174]=t("修改了一个项,其他事务在")),Q("mjx-container",W1,[(l(),a("svg",U1,T[171]||(T[171]=[m('',1)]))),T[172]||(T[172]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[175]||(T[175]=t("提交或中止之前不能修改同一项。"))]),Q("li",null,[T[186]||(T[186]=t("也就是说,未提交事务的更新对其他事务不可见。 ")),Q("ul",null,[Q("li",null,[T[182]||(T[182]=t("否则,如果")),Q("mjx-container",Y1,[(l(),a("svg",$1,T[176]||(T[176]=[m('',1)]))),T[177]||(T[177]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"1")])])],-1))]),T[183]||(T[183]=t("更新了 A,然后")),Q("mjx-container",_1,[(l(),a("svg",Q2,T[178]||(T[178]=[m('',1)]))),T[179]||(T[179]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"2")])])],-1))]),T[184]||(T[184]=t("更新了 A 并提交,最后")),Q("mjx-container",T2,[(l(),a("svg",t2,T[180]||(T[180]=[m('',1)]))),T[181]||(T[181]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"1")])])],-1))]),T[185]||(T[185]=t("必须中止,那么如何执行撤销操作?"))])])]),T[189]||(T[189]=Q("li",null,"可以通过对更新的项获取独占锁,并在事务结束前保持这些锁(严格的两阶段锁定)来确保这一点。",-1)),T[190]||(T[190]=Q("li",null,"不同事务的日志记录可能会交错在日志中。",-1))]),T[520]||(T[520]=Q("h3",{id:"撤销和重做操作",tabindex:"-1"},[Q("a",{class:"header-anchor",href:"#撤销和重做操作"},[Q("span",null,"撤销和重做操作")])],-1)),Q("ul",null,[Q("li",null,[Q("p",null,[T[197]||(T[197]=t("对于日志记录")),Q("mjx-container",a2,[(l(),a("svg",l2,T[191]||(T[191]=[m('',1)]))),T[192]||(T[192]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",null,","),Q("mi",null,"X"),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"2")]),Q("mo",null,">")])],-1))]),T[198]||(T[198]=t(",撤销操作将旧值")),Q("mjx-container",m2,[(l(),a("svg",n2,T[193]||(T[193]=[m('',1)]))),T[194]||(T[194]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")])])],-1))]),T[199]||(T[199]=t("写入")),Q("mjx-container",s2,[(l(),a("svg",e2,T[195]||(T[195]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D44B",d:"M42 0H40Q26 0 26 11Q26 15 29 27Q33 41 36 43T55 46Q141 49 190 98Q200 108 306 224T411 342Q302 620 297 625Q288 636 234 637H206Q200 643 200 645T202 664Q206 677 212 683H226Q260 681 347 681Q380 681 408 681T453 682T473 682Q490 682 490 671Q490 670 488 658Q484 643 481 640T465 637Q434 634 411 620L488 426L541 485Q646 598 646 610Q646 628 622 635Q617 635 609 637Q594 637 594 648Q594 650 596 664Q600 677 606 683H618Q619 683 643 683T697 681T738 680Q828 680 837 683H845Q852 676 852 672Q850 647 840 637H824Q790 636 763 628T722 611T698 593L687 584Q687 585 592 480L505 384Q505 383 536 304T601 142T638 56Q648 47 699 46Q734 46 734 37Q734 35 732 23Q728 7 725 4T711 1Q708 1 678 1T589 2Q528 2 496 2T461 1Q444 1 444 10Q444 11 446 25Q448 35 450 39T455 44T464 46T480 47T506 54Q523 62 523 64Q522 64 476 181L429 299Q241 95 236 84Q232 76 232 72Q232 53 261 47Q262 47 267 47T273 46Q276 46 277 46T280 45T283 42T284 35Q284 26 282 19Q279 6 276 4T261 1Q258 1 243 1T201 2T142 2Q64 2 42 0Z"})])])],-1)]))),T[196]||(T[196]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"X")])],-1))]),T[200]||(T[200]=t("。"))])]),Q("li",null,[T[235]||(T[235]=Q("p",null,"对于事务的撤销操作:",-1)),Q("ul",null,[Q("li",null,[Q("p",null,[Q("mjx-container",o2,[(l(),a("svg",d2,T[201]||(T[201]=[m('',1)]))),T[202]||(T[202]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"u"),Q("mi",null,"n"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[205]||(T[205]=t("将事务")),Q("mjx-container",r2,[(l(),a("svg",i2,T[203]||(T[203]=[m('',1)]))),T[204]||(T[204]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[206]||(T[206]=t("更新的所有数据项的值恢复为旧值,具体步骤如下:"))]),Q("ol",null,[Q("li",null,[T[209]||(T[209]=t("从事务")),Q("mjx-container",g2,[(l(),a("svg",h2,T[207]||(T[207]=[m('',1)]))),T[208]||(T[208]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[210]||(T[210]=t("的最后一个日志记录开始向后执行。"))]),Q("li",null,[T[219]||(T[219]=t("对于每个日志记录")),Q("mjx-container",p2,[(l(),a("svg",H2,T[211]||(T[211]=[m('',1)]))),T[212]||(T[212]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",null,","),Q("mi",null,"X"),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"2")]),Q("mo",null,">")])],-1))]),T[220]||(T[220]=t(",将旧值")),Q("mjx-container",u2,[(l(),a("svg",L2,T[213]||(T[213]=[m('',1)]))),T[214]||(T[214]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")])])],-1))]),T[221]||(T[221]=t("写入")),Q("mjx-container",M2,[(l(),a("svg",w2,T[215]||(T[215]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D44B",d:"M42 0H40Q26 0 26 11Q26 15 29 27Q33 41 36 43T55 46Q141 49 190 98Q200 108 306 224T411 342Q302 620 297 625Q288 636 234 637H206Q200 643 200 645T202 664Q206 677 212 683H226Q260 681 347 681Q380 681 408 681T453 682T473 682Q490 682 490 671Q490 670 488 658Q484 643 481 640T465 637Q434 634 411 620L488 426L541 485Q646 598 646 610Q646 628 622 635Q617 635 609 637Q594 637 594 648Q594 650 596 664Q600 677 606 683H618Q619 683 643 683T697 681T738 680Q828 680 837 683H845Q852 676 852 672Q850 647 840 637H824Q790 636 763 628T722 611T698 593L687 584Q687 585 592 480L505 384Q505 383 536 304T601 142T638 56Q648 47 699 46Q734 46 734 37Q734 35 732 23Q728 7 725 4T711 1Q708 1 678 1T589 2Q528 2 496 2T461 1Q444 1 444 10Q444 11 446 25Q448 35 450 39T455 44T464 46T480 47T506 54Q523 62 523 64Q522 64 476 181L429 299Q241 95 236 84Q232 76 232 72Q232 53 261 47Q262 47 267 47T273 46Q276 46 277 46T280 45T283 42T284 35Q284 26 282 19Q279 6 276 4T261 1Q258 1 243 1T201 2T142 2Q64 2 42 0Z"})])])],-1)]))),T[216]||(T[216]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"X")])],-1))]),T[222]||(T[222]=t(",并写入日志记录")),Q("mjx-container",f2,[(l(),a("svg",x2,T[217]||(T[217]=[m('',1)]))),T[218]||(T[218]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",null,","),Q("mi",null,"X"),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")]),Q("mo",null,">")])],-1))]),T[223]||(T[223]=t("。"))]),Q("li",null,[T[226]||(T[226]=t("当事务的撤销操作完成时,写入日志记录")),Q("mjx-container",Z2,[(l(),a("svg",v2,T[224]||(T[224]=[m('',1)]))),T[225]||(T[225]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"a"),Q("mi",null,"b"),Q("mi",null,"o"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[227]||(T[227]=t("。"))])])]),Q("li",null,[Q("p",null,[T[232]||(T[232]=t("注意:这里的")),Q("mjx-container",c2,[(l(),a("svg",y2,T[228]||(T[228]=[m('',1)]))),T[229]||(T[229]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")])])],-1))]),T[233]||(T[233]=t("表示旧值,")),Q("mjx-container",b2,[(l(),a("svg",D2,T[230]||(T[230]=[m('',1)]))),T[231]||(T[231]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"2")])])],-1))]),T[234]||(T[234]=t("表示新值。"))])])])]),Q("li",null,[T[265]||(T[265]=Q("p",null,"重做操作:",-1)),Q("ul",null,[Q("li",null,[T[242]||(T[242]=t("对于日志记录")),Q("mjx-container",V2,[(l(),a("svg",C2,T[236]||(T[236]=[m('',1)]))),T[237]||(T[237]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",null,","),Q("mi",null,"X"),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"2")]),Q("mo",null,">")])],-1))]),T[243]||(T[243]=t(",重做操作将新值")),Q("mjx-container",j2,[(l(),a("svg",k2,T[238]||(T[238]=[m('',1)]))),T[239]||(T[239]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"V"),Q("mn",null,"2")])],-1))]),T[244]||(T[244]=t("写入")),Q("mjx-container",B2,[(l(),a("svg",S2,T[240]||(T[240]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D44B",d:"M42 0H40Q26 0 26 11Q26 15 29 27Q33 41 36 43T55 46Q141 49 190 98Q200 108 306 224T411 342Q302 620 297 625Q288 636 234 637H206Q200 643 200 645T202 664Q206 677 212 683H226Q260 681 347 681Q380 681 408 681T453 682T473 682Q490 682 490 671Q490 670 488 658Q484 643 481 640T465 637Q434 634 411 620L488 426L541 485Q646 598 646 610Q646 628 622 635Q617 635 609 637Q594 637 594 648Q594 650 596 664Q600 677 606 683H618Q619 683 643 683T697 681T738 680Q828 680 837 683H845Q852 676 852 672Q850 647 840 637H824Q790 636 763 628T722 611T698 593L687 584Q687 585 592 480L505 384Q505 383 536 304T601 142T638 56Q648 47 699 46Q734 46 734 37Q734 35 732 23Q728 7 725 4T711 1Q708 1 678 1T589 2Q528 2 496 2T461 1Q444 1 444 10Q444 11 446 25Q448 35 450 39T455 44T464 46T480 47T506 54Q523 62 523 64Q522 64 476 181L429 299Q241 95 236 84Q232 76 232 72Q232 53 261 47Q262 47 267 47T273 46Q276 46 277 46T280 45T283 42T284 35Q284 26 282 19Q279 6 276 4T261 1Q258 1 243 1T201 2T142 2Q64 2 42 0Z"})])])],-1)]))),T[241]||(T[241]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"X")])],-1))]),T[245]||(T[245]=t("。"))]),T[264]||(T[264]=Q("li",null,"对于事务的重做操作:",-1)),Q("li",null,[Q("mjx-container",J2,[(l(),a("svg",G2,T[246]||(T[246]=[m('',1)]))),T[247]||(T[247]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"r"),Q("mi",null,"e"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[262]||(T[262]=t("将事务")),Q("mjx-container",E2,[(l(),a("svg",F2,T[248]||(T[248]=[m('',1)]))),T[249]||(T[249]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[263]||(T[263]=t("更新的所有数据项的值设置为新值,具体步骤如下: ")),Q("ul",null,[T[260]||(T[260]=Q("li",null,"从事务 Ti 的第一个日志记录开始向前执行。",-1)),Q("li",null,[T[256]||(T[256]=t("对于每个日志记录")),Q("mjx-container",A2,[(l(),a("svg",X2,T[250]||(T[250]=[m('',1)]))),T[251]||(T[251]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",null,","),Q("mi",null,"X"),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"2")]),Q("mo",null,">")])],-1))]),T[257]||(T[257]=t(",将新值")),Q("mjx-container",R2,[(l(),a("svg",z2,T[252]||(T[252]=[m('',1)]))),T[253]||(T[253]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"2")])])],-1))]),T[258]||(T[258]=t("写入")),Q("mjx-container",I2,[(l(),a("svg",P2,T[254]||(T[254]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D44B",d:"M42 0H40Q26 0 26 11Q26 15 29 27Q33 41 36 43T55 46Q141 49 190 98Q200 108 306 224T411 342Q302 620 297 625Q288 636 234 637H206Q200 643 200 645T202 664Q206 677 212 683H226Q260 681 347 681Q380 681 408 681T453 682T473 682Q490 682 490 671Q490 670 488 658Q484 643 481 640T465 637Q434 634 411 620L488 426L541 485Q646 598 646 610Q646 628 622 635Q617 635 609 637Q594 637 594 648Q594 650 596 664Q600 677 606 683H618Q619 683 643 683T697 681T738 680Q828 680 837 683H845Q852 676 852 672Q850 647 840 637H824Q790 636 763 628T722 611T698 593L687 584Q687 585 592 480L505 384Q505 383 536 304T601 142T638 56Q648 47 699 46Q734 46 734 37Q734 35 732 23Q728 7 725 4T711 1Q708 1 678 1T589 2Q528 2 496 2T461 1Q444 1 444 10Q444 11 446 25Q448 35 450 39T455 44T464 46T480 47T506 54Q523 62 523 64Q522 64 476 181L429 299Q241 95 236 84Q232 76 232 72Q232 53 261 47Q262 47 267 47T273 46Q276 46 277 46T280 45T283 42T284 35Q284 26 282 19Q279 6 276 4T261 1Q258 1 243 1T201 2T142 2Q64 2 42 0Z"})])])],-1)]))),T[255]||(T[255]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"X")])],-1))]),T[259]||(T[259]=t("。"))]),T[261]||(T[261]=Q("li",null,"在此情况下不进行日志记录。",-1))])])])]),Q("li",null,[T[289]||(T[289]=Q("p",null,"在故障后进行恢复时:",-1)),Q("ul",null,[Q("li",null,[T[272]||(T[272]=t("如果日志包含记录")),Q("mjx-container",N2,[(l(),a("svg",O2,T[266]||(T[266]=[m('',1)]))),T[267]||(T[267]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[273]||(T[273]=t(",但不包含记录")),Q("mjx-container",q2,[(l(),a("svg",K2,T[268]||(T[268]=[m('',1)]))),T[269]||(T[269]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"c"),Q("mi",null,"o"),Q("mi",null,"m"),Q("mi",null,"m"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[274]||(T[274]=t("或")),Q("mjx-container",W2,[(l(),a("svg",U2,T[270]||(T[270]=[m('',1)]))),T[271]||(T[271]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"a"),Q("mi",null,"b"),Q("mi",null,"o"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[275]||(T[275]=t(",则需要撤销事务 Ti。"))]),Q("li",null,[T[284]||(T[284]=t("如果日志包含记录")),Q("mjx-container",Y2,[(l(),a("svg",$2,T[276]||(T[276]=[m('',1)]))),T[277]||(T[277]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[285]||(T[285]=t("并且包含记录")),Q("mjx-container",_2,[(l(),a("svg",Q4,T[278]||(T[278]=[m('',1)]))),T[279]||(T[279]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"c"),Q("mi",null,"o"),Q("mi",null,"m"),Q("mi",null,"m"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[286]||(T[286]=t("或")),Q("mjx-container",T4,[(l(),a("svg",t4,T[280]||(T[280]=[m('',1)]))),T[281]||(T[281]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"a"),Q("mi",null,"b"),Q("mi",null,"o"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[287]||(T[287]=t(",则需要重做事务")),Q("mjx-container",a4,[(l(),a("svg",l4,T[282]||(T[282]=[m('',1)]))),T[283]||(T[283]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[288]||(T[288]=t("。"))])])]),Q("li",null,[Q("p",null,[T[296]||(T[296]=t("注意:如果事务")),Q("mjx-container",m4,[(l(),a("svg",n4,T[290]||(T[290]=[m('',1)]))),T[291]||(T[291]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[297]||(T[297]=t("之前已被撤销并且在日志中写入了")),Q("mjx-container",s4,[(l(),a("svg",e4,T[292]||(T[292]=[m('',1)]))),T[293]||(T[293]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"a"),Q("mi",null,"b"),Q("mi",null,"o"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[298]||(T[298]=t("记录,然后发生故障,在故障恢复时,")),Q("mjx-container",o4,[(l(),a("svg",d4,T[294]||(T[294]=[m('',1)]))),T[295]||(T[295]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[299]||(T[299]=t("会被重做。"))]),T[300]||(T[300]=Q("ul",null,[Q("li",null,"此类重做会重新执行所有原始操作,包括恢复旧值的步骤。"),Q("li",null,[t("这被称为"),Q("code",null,"重复历史(repeating history)"),t("。")]),Q("li",null,[t("首先看起来可能浪费,但大大简化了恢复过程。"),Q("br"),Q("img",{src:n,alt:"错误恢复示例",loading:"lazy"})])],-1))]),Q("li",null,[Q("p",null,[T[313]||(T[313]=t("(a) ")),Q("mjx-container",r4,[(l(),a("svg",i4,T[301]||(T[301]=[m('',1)]))),T[302]||(T[302]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"u"),Q("mi",null,"n"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"0")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[314]||(T[314]=t(":将")),Q("mjx-container",g4,[(l(),a("svg",h4,T[303]||(T[303]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D435",d:"M231 637Q204 637 199 638T194 649Q194 676 205 682Q206 683 335 683Q594 683 608 681Q671 671 713 636T756 544Q756 480 698 429T565 360L555 357Q619 348 660 311T702 219Q702 146 630 78T453 1Q446 0 242 0Q42 0 39 2Q35 5 35 10Q35 17 37 24Q42 43 47 45Q51 46 62 46H68Q95 46 128 49Q142 52 147 61Q150 65 219 339T288 628Q288 635 231 637ZM649 544Q649 574 634 600T585 634Q578 636 493 637Q473 637 451 637T416 636H403Q388 635 384 626Q382 622 352 506Q352 503 351 500L320 374H401Q482 374 494 376Q554 386 601 434T649 544ZM595 229Q595 273 572 302T512 336Q506 337 429 337Q311 337 310 336Q310 334 293 263T258 122L240 52Q240 48 252 48T333 46Q422 46 429 47Q491 54 543 105T595 229Z"})])])],-1)]))),T[304]||(T[304]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"B")])],-1))]),T[315]||(T[315]=t("恢复为 2000,将")),Q("mjx-container",p4,[(l(),a("svg",H4,T[305]||(T[305]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D434",d:"M208 74Q208 50 254 46Q272 46 272 35Q272 34 270 22Q267 8 264 4T251 0Q249 0 239 0T205 1T141 2Q70 2 50 0H42Q35 7 35 11Q37 38 48 46H62Q132 49 164 96Q170 102 345 401T523 704Q530 716 547 716H555H572Q578 707 578 706L606 383Q634 60 636 57Q641 46 701 46Q726 46 726 36Q726 34 723 22Q720 7 718 4T704 0Q701 0 690 0T651 1T578 2Q484 2 455 0H443Q437 6 437 9T439 27Q443 40 445 43L449 46H469Q523 49 533 63L521 213H283L249 155Q208 86 208 74ZM516 260Q516 271 504 416T490 562L463 519Q447 492 400 412L310 260L413 259Q516 259 516 260Z"})])])],-1)]))),T[306]||(T[306]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"A")])],-1))]),T[316]||(T[316]=t("恢复为 1000,并写入日志记录")),Q("mjx-container",u4,[(l(),a("svg",L4,T[307]||(T[307]=[m('',1)]))),T[308]||(T[308]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"0")]),Q("mo",null,","),Q("mi",null,"B"),Q("mo",null,","),Q("mn",null,"2000"),Q("mo",null,">")])],-1))]),T[317]||(T[317]=t("、")),Q("mjx-container",M4,[(l(),a("svg",w4,T[309]||(T[309]=[m('',1)]))),T[310]||(T[310]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"0")]),Q("mo",null,","),Q("mi",null,"A"),Q("mo",null,","),Q("mn",null,"1000"),Q("mo",null,">")])],-1))]),T[318]||(T[318]=t("、")),Q("mjx-container",f4,[(l(),a("svg",x4,T[311]||(T[311]=[m('',1)]))),T[312]||(T[312]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"0")]),Q("mo",null,","),Q("mi",null,"a"),Q("mi",null,"b"),Q("mi",null,"o"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[319]||(T[319]=t("。"))])]),Q("li",null,[Q("p",null,[T[334]||(T[334]=t("(b) ")),Q("mjx-container",Z4,[(l(),a("svg",v4,T[320]||(T[320]=[m('',1)]))),T[321]||(T[321]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"r"),Q("mi",null,"e"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"0")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[335]||(T[335]=t("和")),Q("mjx-container",c4,[(l(),a("svg",y4,T[322]||(T[322]=[m('',1)]))),T[323]||(T[323]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"u"),Q("mi",null,"n"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"1")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[336]||(T[336]=t(":将")),Q("mjx-container",b4,[(l(),a("svg",D4,T[324]||(T[324]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D434",d:"M208 74Q208 50 254 46Q272 46 272 35Q272 34 270 22Q267 8 264 4T251 0Q249 0 239 0T205 1T141 2Q70 2 50 0H42Q35 7 35 11Q37 38 48 46H62Q132 49 164 96Q170 102 345 401T523 704Q530 716 547 716H555H572Q578 707 578 706L606 383Q634 60 636 57Q641 46 701 46Q726 46 726 36Q726 34 723 22Q720 7 718 4T704 0Q701 0 690 0T651 1T578 2Q484 2 455 0H443Q437 6 437 9T439 27Q443 40 445 43L449 46H469Q523 49 533 63L521 213H283L249 155Q208 86 208 74ZM516 260Q516 271 504 416T490 562L463 519Q447 492 400 412L310 260L413 259Q516 259 516 260Z"})])])],-1)]))),T[325]||(T[325]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"A")])],-1))]),T[337]||(T[337]=t("和")),Q("mjx-container",V4,[(l(),a("svg",C4,T[326]||(T[326]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D435",d:"M231 637Q204 637 199 638T194 649Q194 676 205 682Q206 683 335 683Q594 683 608 681Q671 671 713 636T756 544Q756 480 698 429T565 360L555 357Q619 348 660 311T702 219Q702 146 630 78T453 1Q446 0 242 0Q42 0 39 2Q35 5 35 10Q35 17 37 24Q42 43 47 45Q51 46 62 46H68Q95 46 128 49Q142 52 147 61Q150 65 219 339T288 628Q288 635 231 637ZM649 544Q649 574 634 600T585 634Q578 636 493 637Q473 637 451 637T416 636H403Q388 635 384 626Q382 622 352 506Q352 503 351 500L320 374H401Q482 374 494 376Q554 386 601 434T649 544ZM595 229Q595 273 572 302T512 336Q506 337 429 337Q311 337 310 336Q310 334 293 263T258 122L240 52Q240 48 252 48T333 46Q422 46 429 47Q491 54 543 105T595 229Z"})])])],-1)]))),T[327]||(T[327]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"B")])],-1))]),T[338]||(T[338]=t("分别设置为 950 和 2050,将")),Q("mjx-container",j4,[(l(),a("svg",k4,T[328]||(T[328]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D436",d:"M50 252Q50 367 117 473T286 641T490 704Q580 704 633 653Q642 643 648 636T656 626L657 623Q660 623 684 649Q691 655 699 663T715 679T725 690L740 705H746Q760 705 760 698Q760 694 728 561Q692 422 692 421Q690 416 687 415T669 413H653Q647 419 647 422Q647 423 648 429T650 449T651 481Q651 552 619 605T510 659Q484 659 454 652T382 628T299 572T226 479Q194 422 175 346T156 222Q156 108 232 58Q280 24 350 24Q441 24 512 92T606 240Q610 253 612 255T628 257Q648 257 648 248Q648 243 647 239Q618 132 523 55T319 -22Q206 -22 128 53T50 252Z"})])])],-1)]))),T[329]||(T[329]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"C")])],-1))]),T[339]||(T[339]=t("恢复为 700,并写入日志记录")),Q("mjx-container",B4,[(l(),a("svg",S4,T[330]||(T[330]=[m('',1)]))),T[331]||(T[331]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"1")]),Q("mo",null,","),Q("mi",null,"C"),Q("mo",null,","),Q("mn",null,"700"),Q("mo",null,">")])],-1))]),T[340]||(T[340]=t("、")),Q("mjx-container",J4,[(l(),a("svg",G4,T[332]||(T[332]=[m('',1)]))),T[333]||(T[333]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"1")]),Q("mo",null,","),Q("mi",null,"a"),Q("mi",null,"b"),Q("mi",null,"o"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[341]||(T[341]=t("。"))])]),Q("li",null,[Q("p",null,[T[352]||(T[352]=t("(c) ")),Q("mjx-container",E4,[(l(),a("svg",F4,T[342]||(T[342]=[m('',1)]))),T[343]||(T[343]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"r"),Q("mi",null,"e"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"0")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[353]||(T[353]=t("和")),Q("mjx-container",A4,[(l(),a("svg",X4,T[344]||(T[344]=[m('',1)]))),T[345]||(T[345]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"r"),Q("mi",null,"e"),Q("mi",null,"d"),Q("mi",null,"o"),Q("mo",{stretchy:"false"},"("),Q("msub",null,[Q("mi",null,"T"),Q("mn",null,"1")]),Q("mo",{stretchy:"false"},")")])],-1))]),T[354]||(T[354]=t(":将")),Q("mjx-container",R4,[(l(),a("svg",z4,T[346]||(T[346]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D434",d:"M208 74Q208 50 254 46Q272 46 272 35Q272 34 270 22Q267 8 264 4T251 0Q249 0 239 0T205 1T141 2Q70 2 50 0H42Q35 7 35 11Q37 38 48 46H62Q132 49 164 96Q170 102 345 401T523 704Q530 716 547 716H555H572Q578 707 578 706L606 383Q634 60 636 57Q641 46 701 46Q726 46 726 36Q726 34 723 22Q720 7 718 4T704 0Q701 0 690 0T651 1T578 2Q484 2 455 0H443Q437 6 437 9T439 27Q443 40 445 43L449 46H469Q523 49 533 63L521 213H283L249 155Q208 86 208 74ZM516 260Q516 271 504 416T490 562L463 519Q447 492 400 412L310 260L413 259Q516 259 516 260Z"})])])],-1)]))),T[347]||(T[347]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"A")])],-1))]),T[355]||(T[355]=t("和")),Q("mjx-container",I4,[(l(),a("svg",P4,T[348]||(T[348]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D435",d:"M231 637Q204 637 199 638T194 649Q194 676 205 682Q206 683 335 683Q594 683 608 681Q671 671 713 636T756 544Q756 480 698 429T565 360L555 357Q619 348 660 311T702 219Q702 146 630 78T453 1Q446 0 242 0Q42 0 39 2Q35 5 35 10Q35 17 37 24Q42 43 47 45Q51 46 62 46H68Q95 46 128 49Q142 52 147 61Q150 65 219 339T288 628Q288 635 231 637ZM649 544Q649 574 634 600T585 634Q578 636 493 637Q473 637 451 637T416 636H403Q388 635 384 626Q382 622 352 506Q352 503 351 500L320 374H401Q482 374 494 376Q554 386 601 434T649 544ZM595 229Q595 273 572 302T512 336Q506 337 429 337Q311 337 310 336Q310 334 293 263T258 122L240 52Q240 48 252 48T333 46Q422 46 429 47Q491 54 543 105T595 229Z"})])])],-1)]))),T[349]||(T[349]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"B")])],-1))]),T[356]||(T[356]=t("分别设置为 950 和 2050,然后将")),Q("mjx-container",N4,[(l(),a("svg",O4,T[350]||(T[350]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D436",d:"M50 252Q50 367 117 473T286 641T490 704Q580 704 633 653Q642 643 648 636T656 626L657 623Q660 623 684 649Q691 655 699 663T715 679T725 690L740 705H746Q760 705 760 698Q760 694 728 561Q692 422 692 421Q690 416 687 415T669 413H653Q647 419 647 422Q647 423 648 429T650 449T651 481Q651 552 619 605T510 659Q484 659 454 652T382 628T299 572T226 479Q194 422 175 346T156 222Q156 108 232 58Q280 24 350 24Q441 24 512 92T606 240Q610 253 612 255T628 257Q648 257 648 248Q648 243 647 239Q618 132 523 55T319 -22Q206 -22 128 53T50 252Z"})])])],-1)]))),T[351]||(T[351]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"C")])],-1))]),T[357]||(T[357]=t("设置为 600。"))])])]),T[521]||(T[521]=Q("h3",{id:"检查点-checkpoints",tabindex:"-1"},[Q("a",{class:"header-anchor",href:"#检查点-checkpoints"},[Q("span",null,"检查点(Checkpoints)")])],-1)),Q("ul",null,[T[388]||(T[388]=Q("li",null,[Q("p",null,"在日志中重做/撤销所有记录的事务可能非常缓慢:"),Q("ol",null,[Q("li",null,"如果系统运行时间很长,处理整个日志会耗费时间。"),Q("li",null,"我们可能会不必要地重做已经将更新输出到数据库的事务。")])],-1)),Q("li",null,[T[364]||(T[364]=Q("p",null,"通过定期执行检查点来简化恢复过程:",-1)),T[365]||(T[365]=Q("ul",null,[Q("li",null,"在执行检查点期间停止所有更新操作。")],-1)),Q("ol",null,[T[362]||(T[362]=Q("li",null,"将当前驻留在主内存中的所有日志记录输出到稳定存储介质。",-1)),T[363]||(T[363]=Q("li",null,"将所有修改的缓冲块输出到磁盘。",-1)),Q("li",null,[T[360]||(T[360]=t("在稳定存储中写入日志记录")),Q("mjx-container",q4,[(l(),a("svg",K4,T[358]||(T[358]=[m('',1)]))),T[359]||(T[359]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("mi",null,"c"),Q("mi",null,"h"),Q("mi",null,"e"),Q("mi",null,"c"),Q("mi",null,"k"),Q("mi",null,"p"),Q("mi",null,"o"),Q("mi",null,"i"),Q("mi",null,"n"),Q("mi",null,"t"),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"L"),Q("mo",null,">")])],-1))]),T[361]||(T[361]=t(",其中 L 是检查点时活动的所有事务的列表。"))])])]),Q("li",null,[T[387]||(T[387]=Q("p",null,"在恢复过程中:",-1)),Q("ol",null,[Q("li",null,[T[368]||(T[368]=t("从日志的末尾开始向后扫描,找到最近的")),Q("mjx-container",W4,[(l(),a("svg",U4,T[366]||(T[366]=[m('',1)]))),T[367]||(T[367]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("mi",null,"c"),Q("mi",null,"h"),Q("mi",null,"e"),Q("mi",null,"c"),Q("mi",null,"k"),Q("mi",null,"p"),Q("mi",null,"o"),Q("mi",null,"i"),Q("mi",null,"n"),Q("mi",null,"t"),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"L"),Q("mo",null,">")])],-1))]),T[369]||(T[369]=t("记录。"))]),T[370]||(T[370]=Q("li",null,[t("需要处理的事务:"),Q("code",null,"L中的事务+检查点之后启动的事务"),t(",只需要重做或撤销最近在检查点之前启动的事务和检查点之后启动的事务。")],-1))]),Q("ul",null,[T[386]||(T[386]=Q("li",null,"注:在检查点之前提交或中止的事务已经将所有更新输出到稳定存储介质。",-1)),Q("li",null,[T[379]||(T[379]=t("一些日志中早期的部分可能需要用于撤销操作。 - 继续向后扫描,直到找到")),Q("mjx-container",Y4,[(l(),a("svg",$4,T[371]||(T[371]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D43F",d:"M228 637Q194 637 192 641Q191 643 191 649Q191 673 202 682Q204 683 217 683Q271 680 344 680Q485 680 506 683H518Q524 677 524 674T522 656Q517 641 513 637H475Q406 636 394 628Q387 624 380 600T313 336Q297 271 279 198T252 88L243 52Q243 48 252 48T311 46H328Q360 46 379 47T428 54T478 72T522 106T564 161Q580 191 594 228T611 270Q616 273 628 273H641Q647 264 647 262T627 203T583 83T557 9Q555 4 553 3T537 0T494 -1Q483 -1 418 -1T294 0H116Q32 0 32 10Q32 17 34 24Q39 43 44 45Q48 46 59 46H65Q92 46 125 49Q139 52 144 61Q147 65 216 339T285 628Q285 635 228 637Z"})])])],-1)]))),T[372]||(T[372]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"L")])],-1))]),T[380]||(T[380]=t("中每个事务")),Q("mjx-container",_4,[(l(),a("svg",Q3,T[373]||(T[373]=[m('',1)]))),T[374]||(T[374]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[381]||(T[381]=t("的记录")),Q("mjx-container",T3,[(l(),a("svg",t3,T[375]||(T[375]=[m('',1)]))),T[376]||(T[376]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[382]||(T[382]=t(" - 恢复不需要的是最早的")),Q("mjx-container",a3,[(l(),a("svg",l3,T[377]||(T[377]=[m('',1)]))),T[378]||(T[378]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[383]||(T[383]=t("记录之前的日志部分,可以根据需要擦除。")),T[384]||(T[384]=Q("br",null,null,-1)),T[385]||(T[385]=Q("img",{src:d,alt:"检查点示例",loading:"lazy"},null,-1))])])])]),T[522]||(T[522]=Q("h3",{id:"基于日志的恢复算法",tabindex:"-1"},[Q("a",{class:"header-anchor",href:"#基于日志的恢复算法"},[Q("span",null,"基于日志的恢复算法")])],-1)),Q("ul",null,[Q("li",null,[T[401]||(T[401]=Q("p",null,"日志记录(在正常操作期间):",-1)),Q("ul",null,[Q("li",null,[T[391]||(T[391]=t("事务开始时记录")),Q("mjx-container",m3,[(l(),a("svg",n3,T[389]||(T[389]=[m('',1)]))),T[390]||(T[390]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[392]||(T[392]=t("。"))]),Q("li",null,[T[395]||(T[395]=t("每次更新操作都记录")),Q("mjx-container",s3,[(l(),a("svg",e3,T[393]||(T[393]=[m('',1)]))),T[394]||(T[394]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"X"),Q("mi",null,"j")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"2")]),Q("mo",null,">")])],-1))]),T[396]||(T[396]=t("。"))]),Q("li",null,[T[399]||(T[399]=t("事务结束时记录")),Q("mjx-container",o3,[(l(),a("svg",d3,T[397]||(T[397]=[m('',1)]))),T[398]||(T[398]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"c"),Q("mi",null,"o"),Q("mi",null,"m"),Q("mi",null,"m"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[400]||(T[400]=t("。"))])])]),Q("li",null,[T[431]||(T[431]=Q("p",null,"事务回滚(在正常操作期间):",-1)),Q("ul",null,[Q("li",null,[T[404]||(T[404]=t("假设要回滚的事务为")),Q("mjx-container",r3,[(l(),a("svg",i3,T[402]||(T[402]=[m('',1)]))),T[403]||(T[403]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[405]||(T[405]=t("。"))]),Q("li",null,[T[421]||(T[421]=t("从日志的末尾开始向后扫描,并对于")),Q("mjx-container",g3,[(l(),a("svg",h3,T[406]||(T[406]=[m('',1)]))),T[407]||(T[407]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[422]||(T[422]=t("的每个形如")),Q("mjx-container",p3,[(l(),a("svg",H3,T[408]||(T[408]=[m('',1)]))),T[409]||(T[409]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"X"),Q("mi",null,"j")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"2")]),Q("mo",null,">")])],-1))]),T[423]||(T[423]=t("的日志记录执行撤销操作: ")),Q("ul",null,[Q("li",null,[T[414]||(T[414]=t("通过将")),Q("mjx-container",u3,[(l(),a("svg",L3,T[410]||(T[410]=[m('',1)]))),T[411]||(T[411]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")])])],-1))]),T[415]||(T[415]=t("写入")),Q("mjx-container",M3,[(l(),a("svg",w3,T[412]||(T[412]=[m('',1)]))),T[413]||(T[413]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"X"),Q("mi",null,"j")])])],-1))]),T[416]||(T[416]=t("执行撤销操作。"))]),Q("li",null,[T[419]||(T[419]=t("写入日志记录")),Q("mjx-container",f3,[(l(),a("svg",x3,T[417]||(T[417]=[m('',1)]))),T[418]||(T[418]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"X"),Q("mi",null,"j")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")]),Q("mo",null,">")])],-1))]),T[420]||(T[420]=t(",这些日志记录称为补偿日志记录。"))])])]),Q("li",null,[T[428]||(T[428]=t("一旦找到记录")),Q("mjx-container",Z3,[(l(),a("svg",v3,T[424]||(T[424]=[m('',1)]))),T[425]||(T[425]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[429]||(T[429]=t(",停止扫描并写入日志记录")),Q("mjx-container",c3,[(l(),a("svg",y3,T[426]||(T[426]=[m('',1)]))),T[427]||(T[427]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"a"),Q("mi",null,"b"),Q("mi",null,"o"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[430]||(T[430]=t("。"))])])]),Q("li",null,[T[510]||(T[510]=Q("p",null,"故障恢复:分为两个阶段:",-1)),Q("ul",null,[Q("li",null,[T[470]||(T[470]=Q("p",null,"第一阶段,重做阶段:重放所有事务的更新操作,无论它们是已提交、已中止还是未完成的。",-1)),Q("ol",null,[Q("li",null,[T[436]||(T[436]=t("找到最后一个")),Q("mjx-container",b3,[(l(),a("svg",D3,T[432]||(T[432]=[m('',1)]))),T[433]||(T[433]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("mi",null,"c"),Q("mi",null,"h"),Q("mi",null,"e"),Q("mi",null,"c"),Q("mi",null,"k"),Q("mi",null,"p"),Q("mi",null,"o"),Q("mi",null,"i"),Q("mi",null,"n"),Q("mi",null,"t"),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"L"),Q("mo",null,">")])],-1))]),T[437]||(T[437]=t("记录,并将 undo-list 设置为")),Q("mjx-container",V3,[(l(),a("svg",C3,T[434]||(T[434]=[Q("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[Q("g",{"data-mml-node":"math"},[Q("g",{"data-mml-node":"mi"},[Q("path",{"data-c":"1D43F",d:"M228 637Q194 637 192 641Q191 643 191 649Q191 673 202 682Q204 683 217 683Q271 680 344 680Q485 680 506 683H518Q524 677 524 674T522 656Q517 641 513 637H475Q406 636 394 628Q387 624 380 600T313 336Q297 271 279 198T252 88L243 52Q243 48 252 48T311 46H328Q360 46 379 47T428 54T478 72T522 106T564 161Q580 191 594 228T611 270Q616 273 628 273H641Q647 264 647 262T627 203T583 83T557 9Q555 4 553 3T537 0T494 -1Q483 -1 418 -1T294 0H116Q32 0 32 10Q32 17 34 24Q39 43 44 45Q48 46 59 46H65Q92 46 125 49Q139 52 144 61Q147 65 216 339T285 628Q285 635 228 637Z"})])])],-1)]))),T[435]||(T[435]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"L")])],-1))]),T[438]||(T[438]=t("。"))]),Q("li",null,[T[468]||(T[468]=t("从上述")),Q("mjx-container",j3,[(l(),a("svg",k3,T[439]||(T[439]=[m('',1)]))),T[440]||(T[440]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("mi",null,"c"),Q("mi",null,"h"),Q("mi",null,"e"),Q("mi",null,"c"),Q("mi",null,"k"),Q("mi",null,"p"),Q("mi",null,"o"),Q("mi",null,"i"),Q("mi",null,"n"),Q("mi",null,"t"),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"L"),Q("mo",null,">")])],-1))]),T[469]||(T[469]=t("记录开始向前扫描: ")),Q("ul",null,[Q("li",null,[T[447]||(T[447]=t("每当找到记录")),Q("mjx-container",B3,[(l(),a("svg",S3,T[441]||(T[441]=[m('',1)]))),T[442]||(T[442]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"X"),Q("mi",null,"j")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"2")]),Q("mo",null,">")])],-1))]),T[448]||(T[448]=t("时,通过将")),Q("mjx-container",J3,[(l(),a("svg",G3,T[443]||(T[443]=[m('',1)]))),T[444]||(T[444]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"2")])])],-1))]),T[449]||(T[449]=t("写入")),Q("mjx-container",E3,[(l(),a("svg",F3,T[445]||(T[445]=[m('',1)]))),T[446]||(T[446]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"X"),Q("mi",null,"j")])])],-1))]),T[450]||(T[450]=t("来重做该操作。"))]),Q("li",null,[T[455]||(T[455]=t("每当找到记录")),Q("mjx-container",A3,[(l(),a("svg",X3,T[451]||(T[451]=[m('',1)]))),T[452]||(T[452]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[456]||(T[456]=t("时,将")),Q("mjx-container",R3,[(l(),a("svg",z3,T[453]||(T[453]=[m('',1)]))),T[454]||(T[454]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[457]||(T[457]=t("添加到 undo-list。"))]),Q("li",null,[T[464]||(T[464]=t("每当找到记录")),Q("mjx-container",I3,[(l(),a("svg",P3,T[458]||(T[458]=[m('',1)]))),T[459]||(T[459]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"c"),Q("mi",null,"o"),Q("mi",null,"m"),Q("mi",null,"m"),Q("mi",null,"i"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[465]||(T[465]=t("或")),Q("mjx-container",N3,[(l(),a("svg",O3,T[460]||(T[460]=[m('',1)]))),T[461]||(T[461]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"a"),Q("mi",null,"b"),Q("mi",null,"o"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[466]||(T[466]=t("时,从 undo-list 中移除")),Q("mjx-container",q3,[(l(),a("svg",K3,T[462]||(T[462]=[m('',1)]))),T[463]||(T[463]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[467]||(T[467]=t("。"))])])])])]),Q("li",null,[T[509]||(T[509]=Q("p",null,"第二阶段,撤销阶段:撤销所有未完成的事务。",-1)),Q("ol",null,[Q("li",null,[T[504]||(T[504]=t("从日志的末尾开始向后扫描: ")),Q("ul",null,[Q("li",null,[T[486]||(T[486]=t("每当找到记录")),Q("mjx-container",W3,[(l(),a("svg",U3,T[471]||(T[471]=[m('',1)]))),T[472]||(T[472]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"X"),Q("mi",null,"j")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"2")]),Q("mo",null,">")])],-1))]),T[487]||(T[487]=t(",其中")),Q("mjx-container",Y3,[(l(),a("svg",$3,T[473]||(T[473]=[m('',1)]))),T[474]||(T[474]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[488]||(T[488]=t("在 undo-list 中,执行与事务回滚相同的操作: ")),Q("ul",null,[Q("li",null,[T[479]||(T[479]=t("通过将")),Q("mjx-container",_3,[(l(),a("svg",Q6,T[475]||(T[475]=[m('',1)]))),T[476]||(T[476]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"V"),Q("mn",null,"1")])],-1))]),T[480]||(T[480]=t("写入")),Q("mjx-container",T6,[(l(),a("svg",t6,T[477]||(T[477]=[m('',1)]))),T[478]||(T[478]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mi",null,"X"),Q("mi",null,"j")])],-1))]),T[481]||(T[481]=t("执行撤销操作。"))]),Q("li",null,[T[484]||(T[484]=t("写入日志记录")),Q("mjx-container",a6,[(l(),a("svg",l6,T[482]||(T[482]=[m('',1)]))),T[483]||(T[483]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"X"),Q("mi",null,"j")]),Q("mo",null,","),Q("msub",null,[Q("mi",null,"V"),Q("mn",null,"1")]),Q("mo",null,">")])],-1))]),T[485]||(T[485]=t("。"))])])]),Q("li",null,[T[501]||(T[501]=t("每当找到记录")),Q("mjx-container",m6,[(l(),a("svg",n6,T[489]||(T[489]=[m('',1)]))),T[490]||(T[490]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[502]||(T[502]=t(",其中")),Q("mjx-container",s6,[(l(),a("svg",e6,T[491]||(T[491]=[m('',1)]))),T[492]||(T[492]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[503]||(T[503]=t("在 undo-list 中(即 undo-list 中的事务为有始无终的事务): ")),Q("ul",null,[Q("li",null,[T[495]||(T[495]=t("写入日志记录")),Q("mjx-container",o6,[(l(),a("svg",d6,T[493]||(T[493]=[m('',1)]))),T[494]||(T[494]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"a"),Q("mi",null,"b"),Q("mi",null,"o"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[496]||(T[496]=t("。"))]),Q("li",null,[T[499]||(T[499]=t("从 undo-list 中移除")),Q("mjx-container",r6,[(l(),a("svg",i6,T[497]||(T[497]=[m('',1)]))),T[498]||(T[498]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")])])],-1))]),T[500]||(T[500]=t("。"))])])])])]),Q("li",null,[T[507]||(T[507]=t("当 undo-list 为空时停止(即已为 undo-list 中的每个事务找到")),Q("mjx-container",g6,[(l(),a("svg",h6,T[505]||(T[505]=[m('',1)]))),T[506]||(T[506]=Q("mjx-assistive-mml",{unselectable:"on",display:"inline"},[Q("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[Q("mo",null,"<"),Q("msub",null,[Q("mi",null,"T"),Q("mi",null,"i")]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mstyle",{scriptlevel:"0"},[Q("mspace",{width:"0.278em"})]),Q("mi",null,"s"),Q("mi",null,"t"),Q("mi",null,"a"),Q("mi",null,"r"),Q("mi",null,"t"),Q("mo",null,">")])],-1))]),T[508]||(T[508]=t("记录)。"))])])])])]),T[511]||(T[511]=Q("li",null,[Q("p",null,[t("在撤销阶段完成后,可以开始正常的事务处理。"),Q("br"),Q("img",{src:r,alt:"恢复算法示例",loading:"lazy"})])],-1))])])}const M6=s(i,[["render",p6]]),w6=JSON.parse(`{"path":"/notes/Database/Chapter16-Recovery-System.html","title":"Chapter16 Recovery System","lang":"zh-CN","frontmatter":{"title":"Chapter16 Recovery System","icon":"page","order":1,"author":"chiichen","date":"2024-01-01T00:00:00.000Z","category":["课程笔记"],"tag":["数据库"],"sticky":false,"star":false,"footer":null,"isOriginal":true,"copyright":"转载请注明出处","description":"故障分类 事务故障: 逻辑错误:由于某些内部错误条件(例如 A 的余额不足,无法扣款),事务无法完成。 系统错误:数据库系统必须由于错误条件(例如死锁)终止活动事务。 系统崩溃: 由于电源故障或其他硬件或软件故障,系统崩溃。 停止故障假设: 假设非易失性存储内容在系统崩溃时不会被破坏。 数据库系统具有许多完整性检查来防止磁盘数据的损坏。 磁盘故障: 磁...","head":[["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"Chapter16 Recovery System\\",\\"image\\":[\\"\\"],\\"datePublished\\":\\"2024-01-01T00:00:00.000Z\\",\\"dateModified\\":\\"2025-01-30T06:51:55.000Z\\",\\"author\\":[{\\"@type\\":\\"Person\\",\\"name\\":\\"chiichen\\"}]}"],["meta",{"property":"og:url","content":"https://chiichen.github.io/notes/Database/Chapter16-Recovery-System.html"}],["meta",{"property":"og:site_name","content":"chiichen's Blog"}],["meta",{"property":"og:title","content":"Chapter16 Recovery System"}],["meta",{"property":"og:description","content":"故障分类 事务故障: 逻辑错误:由于某些内部错误条件(例如 A 的余额不足,无法扣款),事务无法完成。 系统错误:数据库系统必须由于错误条件(例如死锁)终止活动事务。 系统崩溃: 由于电源故障或其他硬件或软件故障,系统崩溃。 停止故障假设: 假设非易失性存储内容在系统崩溃时不会被破坏。 数据库系统具有许多完整性检查来防止磁盘数据的损坏。 磁盘故障: 磁..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2025-01-30T06:51:55.000Z"}],["meta",{"property":"article:author","content":"chiichen"}],["meta",{"property":"article:tag","content":"数据库"}],["meta",{"property":"article:published_time","content":"2024-01-01T00:00:00.000Z"}],["meta",{"property":"article:modified_time","content":"2025-01-30T06:51:55.000Z"}]]},"git":{"createdTime":1704096785000,"updatedTime":1738219915000,"contributors":[{"name":"chiichen","username":"chiichen","email":"chiichen@qq.com","commits":3,"url":"https://github.com/chiichen"},{"name":"Chiichen","username":"Chiichen","email":"chiichen@qq.com","commits":1,"url":"https://github.com/Chiichen"}]},"readingTime":{"minutes":13.34,"words":4001},"filePathRelative":"notes/Database/Chapter16-Recovery-System.md","excerpt":"

故障分类

\\n","autoDesc":true}`);export{M6 as comp,w6 as data};