From b397a2837850c0927528c41ce1e395ffccfa67d7 Mon Sep 17 00:00:00 2001 From: kennytm Date: Tue, 26 May 2020 16:28:32 +0800 Subject: [PATCH 01/10] sql-statements: document BACKUP, RESTORE and SHOW [BACKUPS|RESTORES] --- br/storages.md | 80 ++++++++ media/sqlgram/BRIETables.png | Bin 0 -> 4898 bytes media/sqlgram/BackupOption.png | Bin 0 -> 11980 bytes media/sqlgram/BackupStmt.png | Bin 0 -> 3034 bytes media/sqlgram/BackupTSO.png | Bin 0 -> 1418 bytes media/sqlgram/Boolean.png | Bin 0 -> 2919 bytes media/sqlgram/RestoreOption.png | Bin 0 -> 7323 bytes media/sqlgram/RestoreStmt.png | Bin 0 -> 2860 bytes media/sqlgram/ShowBRIEStmt.png | Bin 0 -> 3370 bytes media/sqlgram/ShowLikeOrWhereOpt.png | Bin 4930 -> 2687 bytes sql-statements/sql-statement-backup.md | 188 +++++++++++++++++++ sql-statements/sql-statement-restore.md | 156 +++++++++++++++ sql-statements/sql-statement-show-backups.md | 88 +++++++++ 13 files changed, 512 insertions(+) create mode 100644 br/storages.md create mode 100644 media/sqlgram/BRIETables.png create mode 100644 media/sqlgram/BackupOption.png create mode 100644 media/sqlgram/BackupStmt.png create mode 100644 media/sqlgram/BackupTSO.png create mode 100644 media/sqlgram/Boolean.png create mode 100644 media/sqlgram/RestoreOption.png create mode 100644 media/sqlgram/RestoreStmt.png create mode 100644 media/sqlgram/ShowBRIEStmt.png create mode 100644 sql-statements/sql-statement-backup.md create mode 100644 sql-statements/sql-statement-restore.md create mode 100644 sql-statements/sql-statement-show-backups.md diff --git a/br/storages.md b/br/storages.md new file mode 100644 index 0000000000000..7e7a7b5e24141 --- /dev/null +++ b/br/storages.md @@ -0,0 +1,80 @@ +--- +title: BR storages +summary: Describes the storage URL format used in BR. +category: reference +--- + +# BR storages + +BR supports reading and writing data on the local filesystem, as well as Amazon S3 and Google Cloud Storage. These are distinguished by the URL scheme in the `--storage` parameter passed into BR. + +## Schemes + +The following services are supported: + +| Service | Schemes | Example URL | +|---------|---------|-------------| +| Local filesystem, distributed on every node | local | `local:///path/to/dest/` | +| Amazon S3 and compatible services | s3 | `s3://bucket-name/prefix/of/dest/` | +| Google Cloud Storage (GCS) | gcs, gs | `gcs://bucket-name/prefix/of/dest/` | +| Write to nowhere (for benchmarking only) | noop | `noop://` | + +## Parameters + +Cloud storages such as S3 and GCS sometimes require additional configuration on how to connect to them. These are provided via query parameters e.g. + +{{< copyable "shell-regular" >}} + +```shell +./br backup full -u 127.0.0.1:2379 -s 's3://bucket-name/prefix?region=us-west-2' +``` + +### S3 parameters + +| Parameter | Meaning | +|----------:|---------| +| `access-key` | The access key | +| `secret-access-key` | The secret access key | +| `region` | Service region for Amazon S3 (default to `us-east-1`) | +| `use-accelerate-endpoint` | Whether to use the accelerate endpoint on Amazon S3 (default to `false`) | +| `endpoint` | URL of custom endpoint for S3-compatible services (e.g. `https://s3.example.com/`) | +| `force-path-style` | Use path style access rather than virtual hosted style access (default to `false`) | +| `storage-class` | Storage class of the uploaded objects (e.g. `STANDARD`, `STANDARD_IA`, etc.) | +| `sse` | Server-side encryption algorithm used to encrypt the upload (empty, `AES256` or `aws:kms`) | +| `sse-kms-key-id` | If `sse` is set to `aws:kms`, specifies the KMS ID | +| `acl` | Canned ACL of the uploaded objects (e.g. `private`, `authenticated-read`, etc.) | + +Note: we do not recommend passing in the access key and secret access key directly in the storage URL, as they will be logged in plain text. BR will try to infer these from the environment, in the following order: + +1. `$AWS_ACCESS_KEY_ID` and `$AWS_SECRET_ACCESS_KEY` environment variables +2. `$AWS_ACCESS_KEY` and `$AWS_SECRET_KEY` environment variables +3. Shared credentials file on the BR node at the path specified by the `$AWS_SHARED_CREDENTIALS_FILE` environment variable +4. Shared credentials file on the BR node at `~/.aws/credentials` +5. Current IAM role of the Amazon EC2 container +6. Current IAM role of the Amazon ECS task + +### GCS parameters + +| Parameter | Meaning | +|----------:|---------| +| `credentials-file` | The path to the credentials JSON file on the TiDB node | +| `storage-class` | Storage class of the uploaded objects (e.g. `STANDARD`, `COLDLINE`, etc.) | +| `predefined-acl` | Predefined ACL of the uploaded objects (e.g. `private`, `project-private`, etc.) | + +When `credentials-file` is not specified, BR will try to infer the credentials from the environment, in the following order: + +1. Content of the file on the BR node at the path specified by the `$GOOGLE_APPLICATION_CREDENTIALS` environment variable +2. Content of the file on the BR node at `~/.config/gcloud/application_default_credentials.json` +3. When running in GCE or GAE, the credentials fetched from the metadata server. + +## Sending credentials to TiKV + +By default, when using S3 and GCS destinations, BR will send the credentials to every TiKV nodes to reduce setup complexity. + +However, this is unsuitable on cloud environment, where every node has their own role and permission. In such cases, you need to disable credentials sending with `--send-credentials-to-tikv=false` (or the short form `-c=0`): + +{{< copyable "shell-regular" >}} + +```shell +./br backup full -c=0 -u pd-service:2379 -s 's3://bucket-name/prefix' +``` diff --git a/media/sqlgram/BRIETables.png b/media/sqlgram/BRIETables.png new file mode 100644 index 0000000000000000000000000000000000000000..f737423edcb11f951ebc96be1ab9cd12ae9473f0 GIT binary patch literal 4898 zcmZ{ocTm$$x5iOG1q1{H1yqnGEg&t@5s(t9AOaddl!W>Xy*KHKv_L372)&B*1VU2* z5lo~>3kd-MLy_JDrC;BB=gz$|_q{XE>~qfUKRbKQes*T#ADZYfGx9Lf(9keL^dFeh z(452ljn6L8{vF@_rv2B1??WRCowKtuMn*;gfe;!R3WY*ZD3q|Uu!x8V9*<8;OJinc z9vvN(lat%t-X;=>W@ct4CMFdX6{n}CHa0djH8sh}$==@HZ{NOMU0tP8sg;$LQc_YW zDJkvk?GqCdot>Tj{{DCG-Ze5ZDkvyeSy>Sm7nhZly?_6HS67#(r)Nw|jI^{g2n5p9 z)RdHzl#q}R6BDbgt#xs62?z*?jg1u*6}@xkj;pJyii(P=s%l|jp}M-dv9Ym?jEug% z{^Q4w)zs9GNTipS*OMntQd3ivm6a_mEfp0N9UUDF3=9kn4Wpx@qoSf-ym%omFK=OC zp{J*(q@-kPYYT(H>g($r92~;K!=FBV3V}e}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F;WZvThA=`FAMCP_IPKsQ#P0$l)+D?%8KdcKFE`a?aDN=e{Ssj7|=y zT#)Dj*01%swdBVP3E_T>_>vN-)L_SVy8Ks-$#cy~1MdnBn!yW6J;S!R$EcXwO_WZY zcoQM>N6x%x1Yskmrm{iX+FJZ8F%kTLPYgZRtSextH~WtY z@67&l;mW3C5eCtww%jCR(yF-`uAU_5$P_wQB#a>oMYiZGPIEnk;AXez0MA@k9TOUP z4GQUUh^=chNEH+q17u6N!yS(JY9Rvu`6x_t#OHC206Z{MugJ~@7(-yRB^APm>4QjP z%S-KHr<`RDFcfEIVKkbScJv8eL?W&(_Wgh<(_*AlF_A45JU$hQ&-!A_>dE>NjY?N~1vo{Z`)K83t3AP=| z?3IhnI@TI?7)@+1Tqo1T3|l>l&A_Sct~Y%C6KQXM>Gc_nlFx$3Tiz|fzkgpe5FL{T JwOaO3{{h~DnRoyI literal 0 HcmV?d00001 diff --git a/media/sqlgram/BackupOption.png b/media/sqlgram/BackupOption.png new file mode 100644 index 0000000000000000000000000000000000000000..4425d81c996e06d6d8f3d2cd8e70a826456bba40 GIT binary patch literal 11980 zcmZ9S2{@GB`|ybr5oOCZ#=gZQqB8bn>_W(%J=v0F41bcfP;(|9}7Q`(D>`u50f5oadbTKF^%beb3xa;yq&o69YE`6%`eep01V| z71cSAii+CvA`L}DV1&C+gw}h8_qET?&hU6V6BCoIt*wZNNM>dx8jThe70t-VU|?V% z5C~&qW4gM!Z{NPPv$K2p^y%p6XnK0Ov9WPlTAG}koS~tijEv00#Ke;)Pbw=b*VfkV z-Mjbc)2GSF$v=Pon3|eaR8(wlZ-4&$*~rMKrlw|baj~tfO+rGVsHo`X&704kKbMr0 zym8}3aB#4?y1JU0nv|53xVShB2D^U!IueN#6BG0F^puvCe*F0H>({SqYiq5ntPlu< ztgNi1rRDwm_k)6hl$4Zi-@c8-V)ga)b#!$6{r%nD-Bnan0s{l@+___BW)>S88xyLbQo{rl+ABMb&(Vq#KQSm^BR93CDX6B82< z5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K?zYqBjZHazQv!lcz3c01j89*4klD(8xK zVj%m1n%IOmD4zX;_1RUcJ^Qf2^SQ@_lvm_Sh2uSbqId`ol^}RZ(pI6cC0OM>Mey6E zuebOGb=H+GJiGLD;TCv0d3X$##6%Ol>etJ$SkEnSABtOW+l?pO4o`1QT@VUSNn4*i zhab$waSn$9&WCVF@l@3wJ5k(G!3$6iJhyH0$xMoEUs!+DIi6db+F3jW)#35vd3c5t;sdp-NdK3B%wgI}fI-cA1Xi;~Y&tQ0pO7M!aYO<68A|DXj2HSAq8Pa;v zJ=GSb^!1~S?+soa8uIZ2yRb#V;d7E)5Ch2xAZ+J zS`1Iwa9K;44eQR}-qfbk@z`l2w5I3MM;7-26k=LiFGocZ$gb$vzzOTCeMSV|l z`qEnNdvZKEeaw)GPRbc zr5PHD+stopudP0~udf^q$+2}gR2@9kL-?>oBX@H8(h3r}Gizz`A)Jv)=Zt11mO5-G zG^xSaS{+YawtdeUHIiO@8c(MZEV}c+lg4!wcjRtg zn-4r~4wk$T6OSd#gaj%Roj8c&~T`9P7osD#cZmS*v!&a=j>CvO>RfF5RIX|3@T911}9 zdixa5j$K&1{4Bt)Mp6E(6$sCG71fWL5Y>;GhH>jUuQ{Hb*(tHlF3Feb6#7k=A)X20 z*{n)Z#q(FrJmA?1ScZ6}g{L!dmPb5qD^&c@@&`BX6;=Tq-N zb{BIPA%)`opygkY447#C0^{myQSoGe_5kX^pCw;@~?-*Wt-IgC!IQ@ cP^j4Te`c~V<`K0bkpKVy07*qoM6N<$f}OnYVE_OC literal 0 HcmV?d00001 diff --git a/media/sqlgram/BackupTSO.png b/media/sqlgram/BackupTSO.png new file mode 100644 index 0000000000000000000000000000000000000000..29ea0bf28a549b892ca0a08eccd0271178ae4e84 GIT binary patch literal 1418 zcmV;51$Fv~P)+9>Osj0}w z$WBg9t*x!s*Vn5=NEG#T3DJeieK-SjQpP!#xTwEt7CoeBA zJUl!zGc&upyRNRTDk>^!YHB$-Igyc(FfcH8cXvNOKTAt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E-|ni@@#$e(RrzJu+oa7EaSI%QI&jhhGwkwA1E!vo`D^) z27g7lEYcU0U1i_KlGWySYGMukigH<`@0anjiHg!aNlMDtT@j^7f3KC1i}d$f8MR1% z|1-8Gl~O5{QYn>EDV0*Wx5}KVC#t1<+HU7jx7~wEDQkIE=T}adPgG2q(+^}`)np`y Yf5q>DI^O$z&Hw-a07*qoM6N<$f*ugIZU6uP literal 0 HcmV?d00001 diff --git a/media/sqlgram/Boolean.png b/media/sqlgram/Boolean.png new file mode 100644 index 0000000000000000000000000000000000000000..cedd61a77534488a8bf4dabe3f4e2a6e405824a3 GIT binary patch literal 2919 zcmV-t3z+nYP)P)t-s|NsA7 zTwL+-@yW@_$jHcBTU(QplO`r6l9G}N3JTWN){c&jB_$=Tt*tXNGvnjqP*6}#PEIK) zDZ9J7>gwt)E-p+=OmJ{;GBPs2z`&oMpD!;jD=RC6goLQ5sCIUCK|w(M@L6HJ3B^3MpIK$Pft%uN=ijV zMT3KbWo2bLIy#=7o>f&SK>!R8eaQR{_@D0Vhgqg#@wFM;#!#05lfY1&Cbpm1f$qj>eUje}(uoxaQCILVchHZj_ zdIOL#%)tFL z=~viFsPyk`nyGdLGOH55@#PZWWcBMkE*Shnw$gXqSOG@hYP~@qj5?Pc=lBE`UCtC% z2bgpI!afWmcmwc~BNo#MAKH3UT!2n{{)x6jASj*hMXMcH`hT$YaTyk_v#v#W0X=D> z7Mc2U*lGsaMlCY+|4_90qHX;h%VCjiOUAOyZ?pqpYU}Sb<@SnTX6tYMprh^RZ`BUH zyC1=EGQDXKiI?TlzZ;7uMf(jq#r2VS6N2 z1tCFy(=y~edU<9qHvnfw;Ct_AqWjqRsvLIaFQf$F4{1N+m5cAA5fZR;+zW2*H(L}^ z#F(6bp+n$Tl*5pTMbRAOA16AOKuXZ91fTdsfZ3P1CXj+}z?k;RRLnI2>Kz2M1iUmI z50LUrfaS0JPrI6!X3RsBZvrH>zx9LrRDKNGmR z^`NWgFg5{ZOH=>?#7`B_UO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50CWGBQTAix!!M-+w8`)4>J zL4$xmsx@Vr3FNIu!VN*buGP33U-5^B0R&E<-R*X8uuIVSVRgNmOAq=m6cK&ljo$Wt zvU|P+tE6h-Wgv_^wz73a38f)HwdmNZFN)Zbvn4QfUxl8!e+x&@vZG6R>#LR>J6JdZ zJK7z&G1x8SKceM{Af8oG5|D^dcmk$LehDR80&*YCXlF`5VJ6{x1QRAhf_azp3L4Pb z?iADJZW0>shDQ8uTtZ>rk=eT^0Kzg$0K@~44gAQgL}MdU0wi7%)Z(5Mpr+w$3DEP{ zrGTvxAkDo=L;l!k5TsWO$V0OYBiFa4chigTBl2#0|F!pvy*0|;I#2? z6(>mT<6HokJ<{XpG)9=$LjB+Im6D3xVVd#y-{|Dq9)SjEo R`zinc002ovPDHLkV1lXqVsHQe literal 0 HcmV?d00001 diff --git a/media/sqlgram/RestoreOption.png b/media/sqlgram/RestoreOption.png new file mode 100644 index 0000000000000000000000000000000000000000..8ff807478df1590886ae3e39c887093adfec934b GIT binary patch literal 7323 zcmXwbbzIZm7x(B6MZwW1or4h~rKGfiOj0&tGzg3J3@Y3JTKF(x#`UkBp31Sy?eKFboe5 zOG-*Yp->|uBOf21)YMc11B0($zoOCT=g*%T8X7)&^r*MDcVlDY-@kuVRaJX?dz+h^ zD=RB?b#*f{Gktx1j~_pN_wJpjsHlvLOkrW6l$4aXxVXQ+e?>(_OiYZJm>2{CadB}G z78Vu}5xIZ=en3EggoH$Wef@(64}^q-R8>`7U0q=?SW!`tg@wh#hYyvMl%%Dl_4M>) zWo4C>l~E{EY;5e*)YOwFPi$;#yuH1(w6tEmdZnYIV`gUd>(?(|U*E>Y#-~r8+S}W! zsHiwNI5;^u-Me>hb#=9%puo+|O;J%XB_$;)DoQ~?Av!wR(a}*;Q`5x6WOQ^?TU#56 zM7FlJ-o1M_EiKK`(o#-N&d$!x+}ymUr>Cr}EGH*NO-)ThL&Mb6w6?a^*47pPfZW{N z?CfkmKfkQ3ti{DeXJ_Z+aEkb#?XN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 z*0{)et?7a3cY<-|-K`+hl61}dmYu80+3Qlq25%P-29pubbxClYy^XPKtNi7A2m>6Uh-Ocjya_I#fhL{la@4CNH z=}qCV<~#6l^~&5|vG<+;lgI38dJql0YziP<=-1KmpM+)tky!lpV_aAU0ubfoUVc_} ze(MnCuaUl8^-6~B2u8uw=Blkx3ijLMtwY^aRtEz4*!@?7Y2FFaN!!vmY1rK93w_2? z27JP%C9Y2pIN&>Ly5@W7c~kp!aNym>9$b3mqu7ZWQJYh| zuU^YB`?3TIZ#6A4Pwk#v<>M#)MDRDhl_}}0WSZ7M#q#NP8LZ)v-xCi0DgA1&IMx$<(M#!?)zg~@KjcIff)h$ zMbzys#}Iph)%P}q2iFuX-=JUBNk#g|Ya9$L8sC=UcpSi`G_VL6d-QE7R%nX8;*+rA zz-AeQG&H5xrNt_D**|mE%PV>(A>c8^ic$biAH`+9Chyp~a2F%JJ)xV)$f};J**ItG z4`q>VlO{)m2fw7OUTPg8ILswdVxgVHS@A&05V$t~mV`P@3izy9y3$v4tJDUCY;>#V z&^3**L3tKm^U1F@&53V!_n6_FuXRgRAQ^jjoe@J9ja|!JPU4O;HO}pa-7U zO0brdepUM@y!n2f(>MMxu48tOt76R)FPY?Y%s$n7q@uE_cg>IAei?=oJ|QWPEa d7()Ay45U;#pS4q6YzMkpx>`n>_3H4b{{spB8g&2w literal 0 HcmV?d00001 diff --git a/media/sqlgram/RestoreStmt.png b/media/sqlgram/RestoreStmt.png new file mode 100644 index 0000000000000000000000000000000000000000..7fae5bc1152b7463e4ba21b44e4d1194a3f013ac GIT binary patch literal 2860 zcmV+{3)A$8P)f__%OiWCusHj_8TU=aRz`(#NDk?88FQ1>E zEG#T8E-oo4DZ9J7Gcz+XGBU2Nu6A~IC@3g*cXurD=RoSIFpl;JUl!* zJ3B!^L4<^aYHDg#RaH7VIz>fAX=!PtrKLwlN1mRZadB~lg@rdaH*<4yKR-W$f`XTq zmrzhpk&%&*kdTXui(+D8Z*OlTBqX4qpjTH{T3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(!te?c;SF?%IB!xRoUrSUC;lfS690!S{x5I*k6rE(C69zb<=S_4 znHYr4u~!r0u_AA5<5Jg-tw~k=GRzRf?>xGyWGJ9`1%q!lguYY*{IVedarm1nfR>t` KYK`*q*Z&461#3hA diff --git a/sql-statements/sql-statement-backup.md b/sql-statements/sql-statement-backup.md new file mode 100644 index 0000000000000..75d6f283b5210 --- /dev/null +++ b/sql-statements/sql-statement-backup.md @@ -0,0 +1,188 @@ +--- +title: BACKUP | TiDB SQL Statement Reference +summary: An overview of the usage of BACKUP for the TiDB database. +category: reference +aliases: ['/docs/dev/reference/sql/statements/backup/'] +--- + +# BACKUP + +This statement performs a distributed backup of the cluster. + +The `BACKUP` statement uses the same engine as the [BR tool](/br/backup-and-restore-use-cases.md.md), except that the backup process is driven by TiDB itself rather than a separate BR tool. All benefits and caveats of BR also applies here. + +Running `BACKUP` requires `SUPER` privilege. Additionally, both the TiDB node executing the backup and all TiKV nodes in the cluster must have read/write permission to the destination. + +The `BACKUP` statement is blocking, and will finish only after the entire backup task is finished, failed, or canceled. A long-lasting connection should be prepared for running `BACKUP`. The task can be canceled using the [`KILL TIDB QUERY`](/sql-statements/sql-statement-kill.md) statement. + +Only one `BACKUP` and [`RESTORE`](/sql-statements/sql-statement-restore.md) task can be executed at a time. If a `BACKUP` or `RESTORE` task is already running on the same TiDB server, the new `BACKUP` execution will wait until all previous tasks are done. + +`BACKUP` can only be used with "tikv" storage engine. Using `BACKUP` with the "mocktikv" engine will fail. + +## Synopsis + +**BackupStmt:** + +![BackupStmt](/media/sqlgram/BackupStmt.png) + +**BRIETables:** + +![BRIETables](/media/sqlgram/BRIETables.png) + +**BackupOption:** + +![BackupOption](/media/sqlgram/BackupOption.png) + +**Boolean:** + +![Boolean](/media/sqlgram/Boolean.png) + +**BackupTSO:** + +![BackupTSO](/media/sqlgram/BackupTSO.png) + +## Examples + +### Backup databases + +{{< copyable "sql" >}} + +```sql +BACKUP DATABASE `test` TO 'local:///mnt/backup/2020/04/'; +``` + +``` ++------------------------------+-----------+-----------------+---------------------+---------------------+ +| Destination | Size | BackupTS | Queue Time | Execution Time | ++------------------------------+-----------+-----------------+---------------------+---------------------+ +| local:///mnt/backup/2020/04/ | 248665063 | 416099531454472 | 2020-04-12 23:09:48 | 2020-04-12 23:09:48 | ++------------------------------+-----------+-----------------+---------------------+---------------------+ +1 row in set (58.453 sec) +``` + +This will backup the `test` database into local filesystem. The data will be saved as SST files in the `/mnt/backup/2020/04/` folders distributed among all TiDB and TiKV nodes. + +On complete, it will display the result in one row of + +| Column | Meaning | +|--------|---------| +| `Destination` | The destination URL | +| `Size` | The total size of the backup archive, in bytes | +| `BackupTS` | The TSO of the snapshot when the backup is created (useful for [incremental backup](#Incremental-backup)) | +| `Queue Time` | The timestamp (in current time zone) when the `BACKUP` task was queued. | +| `Execution Time` | The timestamp (in current time zone) when the `BACKUP` task starts to run. | + +### Backup tables + +{{< copyable "sql" >}} + +```sql +BACKUP TABLE `test`.`sbtest01` TO 'local:///mnt/backup/sbtest01/'; + +BACKUP TABLE sbtest02, sbtest03, sbtest04 TO 'local:///mnt/backup/sbtest/'; +``` + +### Backup the entire cluster + +{{< copyable "sql" >}} + +```sql +BACKUP DATABASE * TO 'local:///mnt/backup/full/'; +``` + +Note that the system tables (`mysql.*`, `INFORMATION_SCHEMA.*`, `PERFORMANCE_SCHEMA.*`, …) will not be included into the backup. + +### Remote destinations + +BR supports backing up to S3 or GCS: + +{{< copyable "sql" >}} + +```sql +BACKUP DATABASE `test` TO 's3://example-bucket-2020/backup-05/?region=us-west-2'; +``` + +The URL syntax is further explained in [BR storages](/br/storages.md). + +When running on cloud environment where credentials should not be distributed, set the `SEND_CREDENTIALS_TO_TIKV` option to `FALSE`: + +{{< copyable "sql" >}} + +```sql +BACKUP DATABASE `test` TO 's3://example-bucket-2020/backup-05/?region=us-west-2' + SEND_CREDENTIALS_TO_TIKV = FALSE; +``` + +### Performance fine-tuning + +Use `RATE_LIMIT` to limit the average upload speed per TiKV node to reduce network bandwidth. + +By default, every TiKV node would run 4 backup threads. This value can be adjusted with the `CONCURRENCY` option. + +Before backup is completed, `BACKUP` would perform a checksum against the data on the cluster to verify correctness. This step can be disabled with the `CHECKSUM` option if you are confident that this is unnecessary. + + +{{< copyable "sql" >}} + +```sql +BACKUP DATABASE `test` TO 's3://example-bucket-2020/backup-06/' + RATE_LIMIT = 120 MB/SECOND + CONCURRENCY = 8 + CHECKSUM = FALSE; +``` + +### Snapshot + +Specify a timestamp, TSO or relative time to backup historical data. + +{{< copyable "sql" >}} + +```sql +-- relative time +BACKUP DATABASE `test` TO 'local:///mnt/backup/hist01' + SNAPSHOT = 36 HOUR AGO; + +-- timestamp (in current time zone) +BACKUP DATABASE `test` TO 'local:///mnt/backup/hist02' + SNAPSHOT = '2020-04-01 12:00:00'; + +-- timestamp oracle +BACKUP DATABASE `test` TO 'local:///mnt/backup/hist03' + SNAPSHOT = 415685305958400; +``` + +The supported units for relative time are: + +* MICROSECOND +* SECOND +* MINUTE +* HOUR +* DAY +* WEEK + +Note that, following SQL standard, the units are always singular. + +### Incremental backup + +Supply the `LAST_BACKUP` option to only backup the changes between the last backup to the current snapshot. + +{{< copyable "sql" >}} + +```sql +-- timestamp (in current time zone) +BACKUP DATABASE `test` TO 'local:///mnt/backup/hist02' + LAST_BACKUP = '2020-04-01 12:00:00'; + +-- timestamp oracle +BACKUP DATABASE `test` TO 'local:///mnt/backup/hist03' + LAST_BACKUP = 415685305958400; +``` + +## MySQL compatibility + +This statement is a TiDB extension to MySQL syntax. + +## See also + +* [RESTORE](/sql-statements/sql-statement-restore.md) +* [SHOW BACKUPS](/sql-statements/sql-statement-show-backups.md) diff --git a/sql-statements/sql-statement-restore.md b/sql-statements/sql-statement-restore.md new file mode 100644 index 0000000000000..709e85e1759d1 --- /dev/null +++ b/sql-statements/sql-statement-restore.md @@ -0,0 +1,156 @@ +--- +title: RESTORE | TiDB SQL Statement Reference +summary: An overview of the usage of RESTORE for the TiDB database. +category: reference +aliases: ['/docs/dev/reference/sql/statements/restore/'] +--- + +# RESTORE + +This statement performs a distributed restore from a backup archive previously produced by a [`BACKUP` statement](/sql-statements/sql-statement-backup.md). + +The `RESTORE` statement uses the same engine as the [BR tool](/br/backup-and-restore-use-cases.md.md), except that the restore process is driven by TiDB itself rather than a separate BR tool. All benefits and caveats of BR also applies here. In particular, **`RESTORE` is currently not ACID-compliant**. Before running `RESTORE`, ensure that + +* The cluster is "offline", and the current TiDB session is the only active SQL connection to access all tables being restored. +* When performing a full restore, the tables being restored should not already exist, because existing data may be overridden and causes inconsistency between the data and indices. +* When performing an incremental restore, the tables should be at the exact same state as the `LAST_BACKUP` timestamp when the backup was created. + +Running `RESTORE` requires `SUPER` privilege. Additionally, both the TiDB node executing the backup and all TiKV nodes in the cluster must have read permission from the destination. + +The `RESTORE` statement is blocking, and will finish only after the entire backup task is finished, failed, or canceled. A long-lasting connection should be prepared for running `RESTORE`. The task can be canceled using the [`KILL TIDB QUERY`](/sql-statements/sql-statement-kill.md) statement. + +Only one `BACKUP` and `RESTORE` task can be executed at a time. If a `BACKUP` or `RESTORE` task is already running on the same TiDB server, the new `RESTORE` execution will wait until all previous tasks are done. + +`RESTORE` can only be used with "tikv" storage engine. Using `RESTORE` with the "mocktikv" engine will fail. + +## Synopsis + +**RestoreStmt:** + +![RestoreStmt](/media/sqlgram/RestoreStmt.png) + +**BRIETables:** + +![BRIETables](/media/sqlgram/BRIETables.png) + +**RestoreOption:** + +![RestoreOption](/media/sqlgram/RestoreOption.png) + +**Boolean:** + +![Boolean](/media/sqlgram/Boolean.png) + +## Examples + +### Restore from backup archive + +{{< copyable "sql" >}} + +```sql +RESTORE DATABASE * FROM 'local:///mnt/backup/2020/04/'; +``` + +``` ++------------------------------+-----------+----------+---------------------+---------------------+ +| Destination | Size | BackupTS | Queue Time | Execution Time | ++------------------------------+-----------+----------+---------------------+---------------------+ +| local:///mnt/backup/2020/04/ | 248665063 | 0 | 2020-04-21 17:16:55 | 2020-04-21 17:16:55 | ++------------------------------+-----------+----------+---------------------+---------------------+ +1 row in set (28.961 sec) +``` + +This will restore everything from a backup archive at the local filesystem. The data will be read as SST files from the `/mnt/backup/2020/04/` folders distributed among all TiDB and TiKV nodes. + +On complete, it will display the result in one row of + +| Column | Meaning | +|--------|---------| +| `Destination` | The destination URL to read from | +| `Size` | The total size of the backup archive, in bytes | +| `BackupTS` | (not used) | +| `Queue Time` | The timestamp (in current time zone) when the `RESTORE` task was queued. | +| `Execution Time` | The timestamp (in current time zone) when the `RESTORE` task starts to run. | + +### Partial restore + +You can specify which databases or tables to restore. If some databases or tables are missing from the backup archive, they will be ignored, and thus `RESTORE` would complete without doing anything. + +{{< copyable "sql" >}} + +```sql +RESTORE DATABASE `test` FROM 'local:///mnt/backup/2020/04/'; + +RESTORE TABLE `test`.`sbtest01`, `test`.`sbtest02` FROM 'local:///mnt/backup/2020/04/'; +``` + +### Remote destinations + +BR supports restoring from S3 or GCS: + +{{< copyable "sql" >}} + +```sql +RESTORE DATABASE * FROM 's3://example-bucket-2020/backup-05/?region=us-west-2'; +``` + +The URL syntax is further explained in [BR storages](/br/storages.md). + +When running on cloud environment where credentials should not be distributed, set the `SEND_CREDENTIALS_TO_TIKV` option to `FALSE`: + +{{< copyable "sql" >}} + +```sql +RESTORE DATABASE * FROM 's3://example-bucket-2020/backup-05/?region=us-west-2' + SEND_CREDENTIALS_TO_TIKV = FALSE; +``` + +### Performance fine-tuning + +Use `RATE_LIMIT` to limit the average download speed per TiKV node to reduce network bandwidth. + +By default, TiDB node would run 128 restore threads. This value can be adjusted with the `CONCURRENCY` option. + +Before restore is completed, `RESTORE` would perform a checksum against the data from the archive to verify correctness. This step can be disabled with the `CHECKSUM` option if you are confident that this is unnecessary. + +{{< copyable "sql" >}} + +```sql +RESTORE DATABASE * FROM 's3://example-bucket-2020/backup-06/' + RATE_LIMIT = 120 MB/SECOND + CONCURRENCY = 64 + CHECKSUM = FALSE; +``` + +### Incremental restore + +There is no special syntax to perform incremental restore. TiDB will recognize whether the backup archive is full or incremental and take appropriate action. You only need to apply each incremental restore in correct order. + +For instance, if we create backup as + +{{< copyable "sql" >}} + +```sql +BACKUP DATABASE `test` TO 's3://example-bucket/full-backup' SNAPSHOT = 413612900352000; +BACKUP DATABASE `test` TO 's3://example-bucket/inc-backup-1' SNAPSHOT = 414971854848000 LAST_BACKUP = 413612900352000; +BACKUP DATABASE `test` TO 's3://example-bucket/inc-backup-2' SNAPSHOT = 416353458585600 LAST_BACKUP = 414971854848000; +``` + +then we should apply the restore in the same order + +{{< copyable "sql" >}} + +```sql +RESTORE DATABASE * FROM 's3://example-bucket/full-backup'; +RESTORE DATABASE * FROM 's3://example-bucket/inc-backup-1'; +RESTORE DATABASE * FROM 's3://example-bucket/inc-backup-2'; +``` + +## MySQL compatibility + +This statement is a TiDB extension to MySQL syntax. + +## See also + +* [BACKUP](/sql-statements/sql-statement-backup.md) +* [SHOW RESTORES](/sql-statements/sql-statement-show-backups.md) diff --git a/sql-statements/sql-statement-show-backups.md b/sql-statements/sql-statement-show-backups.md new file mode 100644 index 0000000000000..90dfa463d3dad --- /dev/null +++ b/sql-statements/sql-statement-show-backups.md @@ -0,0 +1,88 @@ +--- +title: SHOW [BACKUPS|RESTORES] | TiDB SQL Statement Reference +summary: An overview of the usage of SHOW [BACKUPS|RESTORES] for the TiDB database. +category: reference +aliases: ['/docs/dev/reference/sql/statements/show-backups/'] +--- + +# SHOW [BACKUPS|RESTORES] + +This statement shows a list of all queued and running [`BACKUP`](/sql-statements/sql-statement-backup.md) and [`RESTORE`](/sql-statements/sql-statement-restore.md) tasks. + +Use `SHOW BACKUPS` to query `BACKUP` tasks and use `SHOW RESTORES` to query `RESTORE` tasks. Both statements require `SUPER` privilege to run. + +## Synopsis + +**ShowBRIEStmt:** + +![ShowBRIEStmt](/media/sqlgram/ShowBRIEStmt.png) + +**ShowLikeOrWhereOpt:** + +![ShowLikeOrWhereOpt](/media/sqlgram/ShowLikeOrWhereOpt.png) + +## Examples + +In one connection, execute + +```sql +mysql> BACKUP DATABASE `test` TO 's3://example-bucket/backup-01/?region=us-west-1'; +``` + +Before the backup completes, run `SHOW BACKUPS` in a new connection + +```sql +mysql> SHOW BACKUPS; ++--------------------------------+---------+----------+---------------------+---------------------+-------------+------------+ +| Destination | State | Progress | Queue_Time | Execution_Time | Finish_Time | Connection | ++--------------------------------+---------+----------+---------------------+---------------------+-------------+------------+ +| s3://example-bucket/backup-01/ | Backup | 98.38 | 2020-04-12 23:09:03 | 2020-04-12 23:09:25 | NULL | 4 | ++--------------------------------+---------+----------+---------------------+---------------------+-------------+------------+ +1 row in set (0.00 sec) +``` + +The columns are + +| Column | Meaning | +|--------|---------| +| `Destination` | The destination URL (with all parameters stripped to avoid leaking secret keys) | +| `State` | State of the task | +| `Progress` | Estimated progress in the current state as a percentage | +| `Queue_Time` | When the task was queued | +| `Execution_Time` | When the task was started; the value is `0000-00-00 00:00:00` for queueing tasks | +| `Finish_Time` | (not used for now) | +| `Connection` | Connection ID running this task | + +The connection ID can be used to cancel a backup/restore task via the [`KILL TIDB QUERY`](/sql-statements/sql-statement-kill.md) statement. + +```sql +mysql> KILL TIDB QUERY 4; +Query OK, 0 rows affected (0.00 sec) +``` + +### Filtering + +Use the `LIKE` clause to filter out tasks by matching the destination URL against a wildcard expression. + +{{< copyable "sql" >}} + +```sql +SHOW BACKUPS LIKE 's3://%'; +``` + +Use the `WHERE` clause to filter by columns + +{{< copyable "sql" >}} + +```sql +SHOW BACKUPS WHERE `Progress` < 25.0; +``` + +## MySQL compatibility + +This statement is a TiDB extension to MySQL syntax. + +## See also + +* [BACKUP](/sql-statements/sql-statement-backup.md) +* [RESTORE](/sql-statements/sql-statement-restore.md) From 1fc4a729bca40a85d69607643df9a818f9f4b80b Mon Sep 17 00:00:00 2001 From: kennytm Date: Tue, 26 May 2020 17:35:38 +0800 Subject: [PATCH 02/10] sql-statments: fix lint --- sql-statements/sql-statement-backup.md | 3 +-- sql-statements/sql-statement-restore.md | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sql-statements/sql-statement-backup.md b/sql-statements/sql-statement-backup.md index 75d6f283b5210..970ce2a2a4db6 100644 --- a/sql-statements/sql-statement-backup.md +++ b/sql-statements/sql-statement-backup.md @@ -9,7 +9,7 @@ aliases: ['/docs/dev/reference/sql/statements/backup/'] This statement performs a distributed backup of the cluster. -The `BACKUP` statement uses the same engine as the [BR tool](/br/backup-and-restore-use-cases.md.md), except that the backup process is driven by TiDB itself rather than a separate BR tool. All benefits and caveats of BR also applies here. +The `BACKUP` statement uses the same engine as the [BR tool](/br/backup-and-restore-use-cases.md), except that the backup process is driven by TiDB itself rather than a separate BR tool. All benefits and caveats of BR also applies here. Running `BACKUP` requires `SUPER` privilege. Additionally, both the TiDB node executing the backup and all TiKV nodes in the cluster must have read/write permission to the destination. @@ -121,7 +121,6 @@ By default, every TiKV node would run 4 backup threads. This value can be adjust Before backup is completed, `BACKUP` would perform a checksum against the data on the cluster to verify correctness. This step can be disabled with the `CHECKSUM` option if you are confident that this is unnecessary. - {{< copyable "sql" >}} ```sql diff --git a/sql-statements/sql-statement-restore.md b/sql-statements/sql-statement-restore.md index 709e85e1759d1..ccc431862a3f8 100644 --- a/sql-statements/sql-statement-restore.md +++ b/sql-statements/sql-statement-restore.md @@ -9,7 +9,7 @@ aliases: ['/docs/dev/reference/sql/statements/restore/'] This statement performs a distributed restore from a backup archive previously produced by a [`BACKUP` statement](/sql-statements/sql-statement-backup.md). -The `RESTORE` statement uses the same engine as the [BR tool](/br/backup-and-restore-use-cases.md.md), except that the restore process is driven by TiDB itself rather than a separate BR tool. All benefits and caveats of BR also applies here. In particular, **`RESTORE` is currently not ACID-compliant**. Before running `RESTORE`, ensure that +The `RESTORE` statement uses the same engine as the [BR tool](/br/backup-and-restore-use-cases.md), except that the restore process is driven by TiDB itself rather than a separate BR tool. All benefits and caveats of BR also applies here. In particular, **`RESTORE` is currently not ACID-compliant**. Before running `RESTORE`, ensure that * The cluster is "offline", and the current TiDB session is the only active SQL connection to access all tables being restored. * When performing a full restore, the tables being restored should not already exist, because existing data may be overridden and causes inconsistency between the data and indices. From 4d0031610a39c7e97b56e797fe1a3c8f31ddd7c3 Mon Sep 17 00:00:00 2001 From: kennytm Date: Wed, 27 May 2020 00:05:50 +0800 Subject: [PATCH 03/10] sql-statements: removed aliased from BRIE statements --- sql-statements/sql-statement-backup.md | 1 - sql-statements/sql-statement-restore.md | 1 - sql-statements/sql-statement-show-backups.md | 1 - 3 files changed, 3 deletions(-) diff --git a/sql-statements/sql-statement-backup.md b/sql-statements/sql-statement-backup.md index 970ce2a2a4db6..0d36cafdbc8ac 100644 --- a/sql-statements/sql-statement-backup.md +++ b/sql-statements/sql-statement-backup.md @@ -2,7 +2,6 @@ title: BACKUP | TiDB SQL Statement Reference summary: An overview of the usage of BACKUP for the TiDB database. category: reference -aliases: ['/docs/dev/reference/sql/statements/backup/'] --- # BACKUP diff --git a/sql-statements/sql-statement-restore.md b/sql-statements/sql-statement-restore.md index ccc431862a3f8..a2ed724075122 100644 --- a/sql-statements/sql-statement-restore.md +++ b/sql-statements/sql-statement-restore.md @@ -2,7 +2,6 @@ title: RESTORE | TiDB SQL Statement Reference summary: An overview of the usage of RESTORE for the TiDB database. category: reference -aliases: ['/docs/dev/reference/sql/statements/restore/'] --- # RESTORE diff --git a/sql-statements/sql-statement-show-backups.md b/sql-statements/sql-statement-show-backups.md index 90dfa463d3dad..0b25dfa2384f5 100644 --- a/sql-statements/sql-statement-show-backups.md +++ b/sql-statements/sql-statement-show-backups.md @@ -2,7 +2,6 @@ title: SHOW [BACKUPS|RESTORES] | TiDB SQL Statement Reference summary: An overview of the usage of SHOW [BACKUPS|RESTORES] for the TiDB database. category: reference -aliases: ['/docs/dev/reference/sql/statements/show-backups/'] --- # SHOW [BACKUPS|RESTORES] From b58db52439f6826496b4bb18e6e02c4d32f31874 Mon Sep 17 00:00:00 2001 From: kennytm Date: Thu, 28 May 2020 00:08:03 +0800 Subject: [PATCH 04/10] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- br/storages.md | 14 ++++++++------ sql-statements/sql-statement-backup.md | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/br/storages.md b/br/storages.md index 7e7a7b5e24141..c6585b4d7f527 100644 --- a/br/storages.md +++ b/br/storages.md @@ -6,7 +6,7 @@ category: reference # BR storages -BR supports reading and writing data on the local filesystem, as well as Amazon S3 and Google Cloud Storage. These are distinguished by the URL scheme in the `--storage` parameter passed into BR. +BR supports reading and writing data on the local filesystem, as well as on Amazon S3 and Google Cloud Storage. These are distinguished by the URL scheme in the `--storage` parameter passed into BR. ## Schemes @@ -21,7 +21,7 @@ The following services are supported: ## Parameters -Cloud storages such as S3 and GCS sometimes require additional configuration on how to connect to them. These are provided via query parameters e.g. +Cloud storages such as S3 and GCS sometimes require additional configuration for connection. You can specify parameters for such configuration. For example: {{< copyable "shell-regular" >}} @@ -31,20 +31,22 @@ Cloud storages such as S3 and GCS sometimes require additional configuration on ### S3 parameters -| Parameter | Meaning | +| Parameter | Description | |----------:|---------| | `access-key` | The access key | | `secret-access-key` | The secret access key | -| `region` | Service region for Amazon S3 (default to `us-east-1`) | +| `region` | Service Region for Amazon S3 (default to `us-east-1`) | | `use-accelerate-endpoint` | Whether to use the accelerate endpoint on Amazon S3 (default to `false`) | | `endpoint` | URL of custom endpoint for S3-compatible services (e.g. `https://s3.example.com/`) | | `force-path-style` | Use path style access rather than virtual hosted style access (default to `false`) | -| `storage-class` | Storage class of the uploaded objects (e.g. `STANDARD`, `STANDARD_IA`, etc.) | +| `storage-class` | Storage class of the uploaded objects (for example, `STANDARD`, `STANDARD_IA`) | | `sse` | Server-side encryption algorithm used to encrypt the upload (empty, `AES256` or `aws:kms`) | | `sse-kms-key-id` | If `sse` is set to `aws:kms`, specifies the KMS ID | | `acl` | Canned ACL of the uploaded objects (e.g. `private`, `authenticated-read`, etc.) | -Note: we do not recommend passing in the access key and secret access key directly in the storage URL, as they will be logged in plain text. BR will try to infer these from the environment, in the following order: +> **Note:** +> +> It is not recommended to pass in the access key and secret access key directly in the storage URL, because these keys are logged in plain text. BR tries to infer these keys from the environment in the following order: 1. `$AWS_ACCESS_KEY_ID` and `$AWS_SECRET_ACCESS_KEY` environment variables 2. `$AWS_ACCESS_KEY` and `$AWS_SECRET_KEY` environment variables diff --git a/sql-statements/sql-statement-backup.md b/sql-statements/sql-statement-backup.md index 0d36cafdbc8ac..9017c7650235f 100644 --- a/sql-statements/sql-statement-backup.md +++ b/sql-statements/sql-statement-backup.md @@ -6,15 +6,15 @@ category: reference # BACKUP -This statement performs a distributed backup of the cluster. +This statement is used to perform a distributed backup of the TiDB cluster. -The `BACKUP` statement uses the same engine as the [BR tool](/br/backup-and-restore-use-cases.md), except that the backup process is driven by TiDB itself rather than a separate BR tool. All benefits and caveats of BR also applies here. +The `BACKUP` statement uses the same engine as the [BR tool](/br/backup-and-restore-use-cases.md) does, except that the backup process is driven by TiDB itself rather than a separate BR tool. All benefits and warnings of BR also apply in this statement. -Running `BACKUP` requires `SUPER` privilege. Additionally, both the TiDB node executing the backup and all TiKV nodes in the cluster must have read/write permission to the destination. +Executing `BACKUP` requires `SUPER` privilege. Additionally, both the TiDB node executing the backup and all TiKV nodes in the cluster must have read or write permission to the destination. -The `BACKUP` statement is blocking, and will finish only after the entire backup task is finished, failed, or canceled. A long-lasting connection should be prepared for running `BACKUP`. The task can be canceled using the [`KILL TIDB QUERY`](/sql-statements/sql-statement-kill.md) statement. +The `BACKUP` statement is blocked until the entire backup task is finished, failed, or canceled. A long-lasting connection should be prepared for executing `BACKUP`. The task can be canceled using the [`KILL TIDB QUERY`](/sql-statements/sql-statement-kill.md) statement. -Only one `BACKUP` and [`RESTORE`](/sql-statements/sql-statement-restore.md) task can be executed at a time. If a `BACKUP` or `RESTORE` task is already running on the same TiDB server, the new `BACKUP` execution will wait until all previous tasks are done. +Only one `BACKUP` and [`RESTORE`](/sql-statements/sql-statement-restore.md) task can be executed at a time. If a `BACKUP` or `RESTORE` statement is already being executed on the same TiDB server, the new `BACKUP` execution will wait until all previous tasks are finished. `BACKUP` can only be used with "tikv" storage engine. Using `BACKUP` with the "mocktikv" engine will fail. @@ -59,19 +59,19 @@ BACKUP DATABASE `test` TO 'local:///mnt/backup/2020/04/'; 1 row in set (58.453 sec) ``` -This will backup the `test` database into local filesystem. The data will be saved as SST files in the `/mnt/backup/2020/04/` folders distributed among all TiDB and TiKV nodes. +In the example above, the `test` database is backed up into the local filesystem. The data is saved as SST files in the `/mnt/backup/2020/04/` directories distributed among all TiDB and TiKV nodes. -On complete, it will display the result in one row of +The first row of the result above is described as follows: | Column | Meaning | |--------|---------| | `Destination` | The destination URL | | `Size` | The total size of the backup archive, in bytes | -| `BackupTS` | The TSO of the snapshot when the backup is created (useful for [incremental backup](#Incremental-backup)) | -| `Queue Time` | The timestamp (in current time zone) when the `BACKUP` task was queued. | +| `BackupTS` | The TSO of the snapshot when the backup is created (useful for [incremental backup](#incremental-backup)) | +| `Queue Time` | The timestamp (in current time zone) when the `BACKUP` task is queued. | | `Execution Time` | The timestamp (in current time zone) when the `BACKUP` task starts to run. | -### Backup tables +### Back up tables {{< copyable "sql" >}} @@ -93,7 +93,7 @@ Note that the system tables (`mysql.*`, `INFORMATION_SCHEMA.*`, `PERFORMANCE_SCH ### Remote destinations -BR supports backing up to S3 or GCS: +BR supports backing up data to S3 or GCS: {{< copyable "sql" >}} From 183e758979aa0957a03bf765795f45314c5cada3 Mon Sep 17 00:00:00 2001 From: kennytm Date: Thu, 28 May 2020 04:39:45 +0800 Subject: [PATCH 05/10] br: further fix comments --- br/backup-and-restore-tool.md | 2 +- br/storages.md | 8 ++++---- sql-statements/sql-statement-backup.md | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/br/backup-and-restore-tool.md b/br/backup-and-restore-tool.md index bec3bab903059..498f42f0a23be 100644 --- a/br/backup-and-restore-tool.md +++ b/br/backup-and-restore-tool.md @@ -263,7 +263,7 @@ To restore the cluster data, use the `br restore` command. You can add the `full > - Data are replicated into multiple peers. When ingesting SSTs, these files have to be present on *all* peers. This is unlike back up where reading from a single node is enough. > - Where each peer is scattered to during restore is random. We don't know in advance which node will read which file. > -> These can be avoided using shared storage, e.g. mounting an NFS on the local path, or using S3. With network storage, every node can automatically read every SST file, so these caveats no longer apply. +> These can be avoided using shared storage, for example mounting an NFS on the local path, or using S3. With network storage, every node can automatically read every SST file, so these caveats no longer apply. ### Restore all the backup data diff --git a/br/storages.md b/br/storages.md index c6585b4d7f527..de01ef377e754 100644 --- a/br/storages.md +++ b/br/storages.md @@ -37,12 +37,12 @@ Cloud storages such as S3 and GCS sometimes require additional configuration for | `secret-access-key` | The secret access key | | `region` | Service Region for Amazon S3 (default to `us-east-1`) | | `use-accelerate-endpoint` | Whether to use the accelerate endpoint on Amazon S3 (default to `false`) | -| `endpoint` | URL of custom endpoint for S3-compatible services (e.g. `https://s3.example.com/`) | +| `endpoint` | URL of custom endpoint for S3-compatible services (for example, `https://s3.example.com/`) | | `force-path-style` | Use path style access rather than virtual hosted style access (default to `false`) | | `storage-class` | Storage class of the uploaded objects (for example, `STANDARD`, `STANDARD_IA`) | | `sse` | Server-side encryption algorithm used to encrypt the upload (empty, `AES256` or `aws:kms`) | | `sse-kms-key-id` | If `sse` is set to `aws:kms`, specifies the KMS ID | -| `acl` | Canned ACL of the uploaded objects (e.g. `private`, `authenticated-read`, etc.) | +| `acl` | Canned ACL of the uploaded objects (for example, `private`, `authenticated-read`) | > **Note:** > @@ -60,8 +60,8 @@ Cloud storages such as S3 and GCS sometimes require additional configuration for | Parameter | Meaning | |----------:|---------| | `credentials-file` | The path to the credentials JSON file on the TiDB node | -| `storage-class` | Storage class of the uploaded objects (e.g. `STANDARD`, `COLDLINE`, etc.) | -| `predefined-acl` | Predefined ACL of the uploaded objects (e.g. `private`, `project-private`, etc.) | +| `storage-class` | Storage class of the uploaded objects (for example, `STANDARD`, `COLDLINE`) | +| `predefined-acl` | Predefined ACL of the uploaded objects (for example, `private`, `project-private`) | When `credentials-file` is not specified, BR will try to infer the credentials from the environment, in the following order: diff --git a/sql-statements/sql-statement-backup.md b/sql-statements/sql-statement-backup.md index 9017c7650235f..f985974b659fa 100644 --- a/sql-statements/sql-statement-backup.md +++ b/sql-statements/sql-statement-backup.md @@ -42,7 +42,7 @@ Only one `BACKUP` and [`RESTORE`](/sql-statements/sql-statement-restore.md) task ## Examples -### Backup databases +### Back up databases {{< copyable "sql" >}} @@ -81,7 +81,7 @@ BACKUP TABLE `test`.`sbtest01` TO 'local:///mnt/backup/sbtest01/'; BACKUP TABLE sbtest02, sbtest03, sbtest04 TO 'local:///mnt/backup/sbtest/'; ``` -### Backup the entire cluster +### Back up the entire cluster {{< copyable "sql" >}} From 9673130cca2993fe47b606f87a935ea0bc96cc3f Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Thu, 28 May 2020 12:16:46 +0800 Subject: [PATCH 06/10] Apply suggestions from code review --- sql-statements/sql-statement-backup.md | 2 +- sql-statements/sql-statement-restore.md | 10 +++++----- sql-statements/sql-statement-show-backups.md | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sql-statements/sql-statement-backup.md b/sql-statements/sql-statement-backup.md index f985974b659fa..cc1e7a23a8446 100644 --- a/sql-statements/sql-statement-backup.md +++ b/sql-statements/sql-statement-backup.md @@ -63,7 +63,7 @@ In the example above, the `test` database is backed up into the local filesystem The first row of the result above is described as follows: -| Column | Meaning | +| Column | Description | |--------|---------| | `Destination` | The destination URL | | `Size` | The total size of the backup archive, in bytes | diff --git a/sql-statements/sql-statement-restore.md b/sql-statements/sql-statement-restore.md index a2ed724075122..6dfd004302b1e 100644 --- a/sql-statements/sql-statement-restore.md +++ b/sql-statements/sql-statement-restore.md @@ -61,9 +61,9 @@ RESTORE DATABASE * FROM 'local:///mnt/backup/2020/04/'; This will restore everything from a backup archive at the local filesystem. The data will be read as SST files from the `/mnt/backup/2020/04/` folders distributed among all TiDB and TiKV nodes. -On complete, it will display the result in one row of +The first row of the result above is described as follows: -| Column | Meaning | +| Column | Description | |--------|---------| | `Destination` | The destination URL to read from | | `Size` | The total size of the backup archive, in bytes | @@ -85,7 +85,7 @@ RESTORE TABLE `test`.`sbtest01`, `test`.`sbtest02` FROM 'local:///mnt/backup/202 ### Remote destinations -BR supports restoring from S3 or GCS: +BR supports restoring data from S3 or GCS: {{< copyable "sql" >}} @@ -125,7 +125,7 @@ RESTORE DATABASE * FROM 's3://example-bucket-2020/backup-06/' There is no special syntax to perform incremental restore. TiDB will recognize whether the backup archive is full or incremental and take appropriate action. You only need to apply each incremental restore in correct order. -For instance, if we create backup as +For instance, if a backup task is created as follows: {{< copyable "sql" >}} @@ -135,7 +135,7 @@ BACKUP DATABASE `test` TO 's3://example-bucket/inc-backup-1' SNAPSHOT = 41497185 BACKUP DATABASE `test` TO 's3://example-bucket/inc-backup-2' SNAPSHOT = 416353458585600 LAST_BACKUP = 414971854848000; ``` -then we should apply the restore in the same order +then the same order should be applied in the restore: {{< copyable "sql" >}} diff --git a/sql-statements/sql-statement-show-backups.md b/sql-statements/sql-statement-show-backups.md index 0b25dfa2384f5..753ae8213d8c8 100644 --- a/sql-statements/sql-statement-show-backups.md +++ b/sql-statements/sql-statement-show-backups.md @@ -22,13 +22,13 @@ Use `SHOW BACKUPS` to query `BACKUP` tasks and use `SHOW RESTORES` to query `RES ## Examples -In one connection, execute +In one connection, execute the following statement: ```sql mysql> BACKUP DATABASE `test` TO 's3://example-bucket/backup-01/?region=us-west-1'; ``` -Before the backup completes, run `SHOW BACKUPS` in a new connection +Before the backup completes, run `SHOW BACKUPS` in a new connection: ```sql mysql> SHOW BACKUPS; @@ -40,7 +40,7 @@ mysql> SHOW BACKUPS; 1 row in set (0.00 sec) ``` -The columns are +The first row of the result above is described as follows: | Column | Meaning | |--------|---------| @@ -69,7 +69,7 @@ Use the `LIKE` clause to filter out tasks by matching the destination URL agains SHOW BACKUPS LIKE 's3://%'; ``` -Use the `WHERE` clause to filter by columns +Use the `WHERE` clause to filter by columns. {{< copyable "sql" >}} From 66ce538af77e4229e5d37cecc88973fc8b07edce Mon Sep 17 00:00:00 2001 From: kennytm Date: Thu, 28 May 2020 14:07:23 +0800 Subject: [PATCH 07/10] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- sql-statements/sql-statement-restore.md | 8 ++++---- sql-statements/sql-statement-show-backups.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sql-statements/sql-statement-restore.md b/sql-statements/sql-statement-restore.md index 6dfd004302b1e..259910ee49ba0 100644 --- a/sql-statements/sql-statement-restore.md +++ b/sql-statements/sql-statement-restore.md @@ -8,11 +8,11 @@ category: reference This statement performs a distributed restore from a backup archive previously produced by a [`BACKUP` statement](/sql-statements/sql-statement-backup.md). -The `RESTORE` statement uses the same engine as the [BR tool](/br/backup-and-restore-use-cases.md), except that the restore process is driven by TiDB itself rather than a separate BR tool. All benefits and caveats of BR also applies here. In particular, **`RESTORE` is currently not ACID-compliant**. Before running `RESTORE`, ensure that +The `RESTORE` statement uses the same engine as the [BR tool](/br/backup-and-restore-use-cases.md), except that the restore process is driven by TiDB itself rather than a separate BR tool. All benefits and caveats of BR also apply here. In particular, **`RESTORE` is currently not ACID-compliant**. Before running `RESTORE`, ensure that the following requirements are met: * The cluster is "offline", and the current TiDB session is the only active SQL connection to access all tables being restored. -* When performing a full restore, the tables being restored should not already exist, because existing data may be overridden and causes inconsistency between the data and indices. -* When performing an incremental restore, the tables should be at the exact same state as the `LAST_BACKUP` timestamp when the backup was created. +* When a full restore is being performed, the tables being restored should not already exist, because existing data might be overridden and causes inconsistency between the data and indices. +* When an incremental restore is being performed, the tables should be at the exact same state as the `LAST_BACKUP` timestamp when the backup is created. Running `RESTORE` requires `SUPER` privilege. Additionally, both the TiDB node executing the backup and all TiKV nodes in the cluster must have read permission from the destination. @@ -59,7 +59,7 @@ RESTORE DATABASE * FROM 'local:///mnt/backup/2020/04/'; 1 row in set (28.961 sec) ``` -This will restore everything from a backup archive at the local filesystem. The data will be read as SST files from the `/mnt/backup/2020/04/` folders distributed among all TiDB and TiKV nodes. +In the example above, all data is restored from a backup archive at the local filesystem. The data is read as SST files from the `/mnt/backup/2020/04/` directories distributed among all TiDB and TiKV nodes. The first row of the result above is described as follows: diff --git a/sql-statements/sql-statement-show-backups.md b/sql-statements/sql-statement-show-backups.md index 753ae8213d8c8..4c7d58ccea5cb 100644 --- a/sql-statements/sql-statement-show-backups.md +++ b/sql-statements/sql-statement-show-backups.md @@ -25,7 +25,7 @@ Use `SHOW BACKUPS` to query `BACKUP` tasks and use `SHOW RESTORES` to query `RES In one connection, execute the following statement: ```sql -mysql> BACKUP DATABASE `test` TO 's3://example-bucket/backup-01/?region=us-west-1'; +BACKUP DATABASE `test` TO 's3://example-bucket/backup-01/?region=us-west-1'; ``` Before the backup completes, run `SHOW BACKUPS` in a new connection: @@ -42,7 +42,7 @@ mysql> SHOW BACKUPS; The first row of the result above is described as follows: -| Column | Meaning | +| Column | Description | |--------|---------| | `Destination` | The destination URL (with all parameters stripped to avoid leaking secret keys) | | `State` | State of the task | From ef147ba8607552a2848d20f2d11674fdc9b240df Mon Sep 17 00:00:00 2001 From: kennytm Date: Thu, 28 May 2020 14:19:00 +0800 Subject: [PATCH 08/10] br: fix remaining wordings --- br/storages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/br/storages.md b/br/storages.md index de01ef377e754..973f06a876715 100644 --- a/br/storages.md +++ b/br/storages.md @@ -57,7 +57,7 @@ Cloud storages such as S3 and GCS sometimes require additional configuration for ### GCS parameters -| Parameter | Meaning | +| Parameter | Description | |----------:|---------| | `credentials-file` | The path to the credentials JSON file on the TiDB node | | `storage-class` | Storage class of the uploaded objects (for example, `STANDARD`, `COLDLINE`) | From c068d37c9af219ced235147fc073fc6837c65268 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Thu, 28 May 2020 14:34:49 +0800 Subject: [PATCH 09/10] add TOC and refine file name --- TOC.md | 4 ++++ ...rages.md => backup-and-restore-storages.md} | 0 sql-statements/sql-statement-backup.md | 8 ++++++-- sql-statements/sql-statement-restore.md | 8 ++++++-- sql-statements/sql-statement-show-backups.md | 18 +++++++++++++++--- 5 files changed, 31 insertions(+), 7 deletions(-) rename br/{storages.md => backup-and-restore-storages.md} (100%) diff --git a/TOC.md b/TOC.md index ab60d0cd6de13..a8d493bb1e0ac 100644 --- a/TOC.md +++ b/TOC.md @@ -87,6 +87,7 @@ - [Use Mydumper and TiDB Lightning](/backup-and-restore-using-mydumper-lightning.md) - [Use BR](/br/backup-and-restore-tool.md) - [BR Usage Scenarios](/br/backup-and-restore-use-cases.md) + - [BR storages](/br/backup-and-restore-storages.md) + Identify Abnormal Queries - [Identify Slow Queries](/identify-slow-queries.md) - [Identify Expensive Queries](/identify-expensive-queries.md) @@ -175,6 +176,7 @@ - [`ALTER TABLE`](/sql-statements/sql-statement-alter-table.md) - [`ALTER USER`](/sql-statements/sql-statement-alter-user.md) - [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md) + - [`BACKUP`](/sql-statements/sql-statement-backup.md) - [`BEGIN`](/sql-statements/sql-statement-begin.md) - [`COMMIT`](/sql-statements/sql-statement-commit.md) - [`CREATE DATABASE`](/sql-statements/sql-statement-create-database.md) @@ -213,6 +215,7 @@ - [`RENAME INDEX`](/sql-statements/sql-statement-rename-index.md) - [`RENAME TABLE`](/sql-statements/sql-statement-rename-table.md) - [`REPLACE`](/sql-statements/sql-statement-replace.md) + - [`RESTORE`](/sql-statements/sql-statement-restore.md) - [`REVOKE `](/sql-statements/sql-statement-revoke-privileges.md) - [`ROLLBACK`](/sql-statements/sql-statement-rollback.md) - [`SELECT`](/sql-statements/sql-statement-select.md) @@ -220,6 +223,7 @@ - [`SET PASSWORD`](/sql-statements/sql-statement-set-password.md) - [`SET TRANSACTION`](/sql-statements/sql-statement-set-transaction.md) - [`SET [GLOBAL|SESSION] `](/sql-statements/sql-statement-set-variable.md) + - [`SHOW [BACKUPS|RESTORES]`](/sql-statements/sql-statement-show-backups.md) - [`SHOW CHARACTER SET`](/sql-statements/sql-statement-show-character-set.md) - [`SHOW COLLATION`](/sql-statements/sql-statement-show-collation.md) - [`SHOW [FULL] COLUMNS FROM`](/sql-statements/sql-statement-show-columns-from.md) diff --git a/br/storages.md b/br/backup-and-restore-storages.md similarity index 100% rename from br/storages.md rename to br/backup-and-restore-storages.md diff --git a/sql-statements/sql-statement-backup.md b/sql-statements/sql-statement-backup.md index cc1e7a23a8446..225cbd42848a3 100644 --- a/sql-statements/sql-statement-backup.md +++ b/sql-statements/sql-statement-backup.md @@ -50,7 +50,7 @@ Only one `BACKUP` and [`RESTORE`](/sql-statements/sql-statement-restore.md) task BACKUP DATABASE `test` TO 'local:///mnt/backup/2020/04/'; ``` -``` +```sql +------------------------------+-----------+-----------------+---------------------+---------------------+ | Destination | Size | BackupTS | Queue Time | Execution Time | +------------------------------+-----------+-----------------+---------------------+---------------------+ @@ -64,7 +64,7 @@ In the example above, the `test` database is backed up into the local filesystem The first row of the result above is described as follows: | Column | Description | -|--------|---------| +| :-------- | :--------- | | `Destination` | The destination URL | | `Size` | The total size of the backup archive, in bytes | | `BackupTS` | The TSO of the snapshot when the backup is created (useful for [incremental backup](#incremental-backup)) | @@ -77,7 +77,11 @@ The first row of the result above is described as follows: ```sql BACKUP TABLE `test`.`sbtest01` TO 'local:///mnt/backup/sbtest01/'; +``` +{{< copyable "sql" >}} + +```sql BACKUP TABLE sbtest02, sbtest03, sbtest04 TO 'local:///mnt/backup/sbtest/'; ``` diff --git a/sql-statements/sql-statement-restore.md b/sql-statements/sql-statement-restore.md index 259910ee49ba0..c11918c256ddb 100644 --- a/sql-statements/sql-statement-restore.md +++ b/sql-statements/sql-statement-restore.md @@ -50,7 +50,7 @@ Only one `BACKUP` and `RESTORE` task can be executed at a time. If a `BACKUP` or RESTORE DATABASE * FROM 'local:///mnt/backup/2020/04/'; ``` -``` +```sql +------------------------------+-----------+----------+---------------------+---------------------+ | Destination | Size | BackupTS | Queue Time | Execution Time | +------------------------------+-----------+----------+---------------------+---------------------+ @@ -64,7 +64,7 @@ In the example above, all data is restored from a backup archive at the local fi The first row of the result above is described as follows: | Column | Description | -|--------|---------| +| :-------- | :--------- | | `Destination` | The destination URL to read from | | `Size` | The total size of the backup archive, in bytes | | `BackupTS` | (not used) | @@ -79,7 +79,11 @@ You can specify which databases or tables to restore. If some databases or table ```sql RESTORE DATABASE `test` FROM 'local:///mnt/backup/2020/04/'; +``` +{{< copyable "sql" >}} + +```sql RESTORE TABLE `test`.`sbtest01`, `test`.`sbtest02` FROM 'local:///mnt/backup/2020/04/'; ``` diff --git a/sql-statements/sql-statement-show-backups.md b/sql-statements/sql-statement-show-backups.md index 4c7d58ccea5cb..9ae112ee44335 100644 --- a/sql-statements/sql-statement-show-backups.md +++ b/sql-statements/sql-statement-show-backups.md @@ -24,14 +24,21 @@ Use `SHOW BACKUPS` to query `BACKUP` tasks and use `SHOW RESTORES` to query `RES In one connection, execute the following statement: +{{< copyable "sql" >}} + ```sql BACKUP DATABASE `test` TO 's3://example-bucket/backup-01/?region=us-west-1'; ``` Before the backup completes, run `SHOW BACKUPS` in a new connection: +{{< copyable "sql" >}} + +```sql +SHOW BACKUPS; +``` + ```sql -mysql> SHOW BACKUPS; +--------------------------------+---------+----------+---------------------+---------------------+-------------+------------+ | Destination | State | Progress | Queue_Time | Execution_Time | Finish_Time | Connection | +--------------------------------+---------+----------+---------------------+---------------------+-------------+------------+ @@ -43,7 +50,7 @@ mysql> SHOW BACKUPS; The first row of the result above is described as follows: | Column | Description | -|--------|---------| +| :-------- | :--------- | | `Destination` | The destination URL (with all parameters stripped to avoid leaking secret keys) | | `State` | State of the task | | `Progress` | Estimated progress in the current state as a percentage | @@ -54,8 +61,13 @@ The first row of the result above is described as follows: The connection ID can be used to cancel a backup/restore task via the [`KILL TIDB QUERY`](/sql-statements/sql-statement-kill.md) statement. +{{< copyable "sql" >}} + +```sql +KILL TIDB QUERY 4; +``` + ```sql -mysql> KILL TIDB QUERY 4; Query OK, 0 rows affected (0.00 sec) ``` From 03f5036211ab94532d5de8bb8d1523a40e0e05cb Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Thu, 28 May 2020 14:38:24 +0800 Subject: [PATCH 10/10] fix dead links --- sql-statements/sql-statement-backup.md | 2 +- sql-statements/sql-statement-restore.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql-statements/sql-statement-backup.md b/sql-statements/sql-statement-backup.md index 225cbd42848a3..284b9be0db186 100644 --- a/sql-statements/sql-statement-backup.md +++ b/sql-statements/sql-statement-backup.md @@ -105,7 +105,7 @@ BR supports backing up data to S3 or GCS: BACKUP DATABASE `test` TO 's3://example-bucket-2020/backup-05/?region=us-west-2'; ``` -The URL syntax is further explained in [BR storages](/br/storages.md). +The URL syntax is further explained in [BR storages](/br/backup-and-restore-storages.md). When running on cloud environment where credentials should not be distributed, set the `SEND_CREDENTIALS_TO_TIKV` option to `FALSE`: diff --git a/sql-statements/sql-statement-restore.md b/sql-statements/sql-statement-restore.md index c11918c256ddb..d47aabb676dfd 100644 --- a/sql-statements/sql-statement-restore.md +++ b/sql-statements/sql-statement-restore.md @@ -97,7 +97,7 @@ BR supports restoring data from S3 or GCS: RESTORE DATABASE * FROM 's3://example-bucket-2020/backup-05/?region=us-west-2'; ``` -The URL syntax is further explained in [BR storages](/br/storages.md). +The URL syntax is further explained in [BR storages](/br/backup-and-restore-storages.md). When running on cloud environment where credentials should not be distributed, set the `SEND_CREDENTIALS_TO_TIKV` option to `FALSE`: