Saya mengusulkan untuk berkenalan dengan decoding laporan awal 2019 oleh Andrei Borodin "Cadangan dari WAL-G. Apa yang ada di 2019?"
![](https://habrastorage.org/webt/du/xr/gn/duxrgnfht6zjt3v1vmo61ozxzu8.png)
Halo semuanya! Nama saya Andrey Borodin. Saya seorang pengembang di Yandex. Saya telah tertarik pada PostgreSQL sejak 2016, setelah saya berbicara dengan para pengembang, dan mereka mengatakan bahwa semuanya sederhana - Anda mengambil kode sumber dan kompilasi, dan semuanya akan berhasil. Dan sejak itu saya tidak bisa berhenti - saya menulis segala macam hal yang berbeda.
, , WAL-G. , PostgreSQL . , . , , .
, , , , . WAL-G? , , .
![](https://habrastorage.org/webt/kt/8x/x5/kt8xx5of-5i4o2ciyogdpfcb_cw.png)
PostgreSQL, , , S3 Google Cloud .
![](https://habrastorage.org/webt/kq/jy/3u/kqjy3uqy8bszdnws4z4ubazsasu.png)
, Yandex Object Storage, S3 .
![](https://habrastorage.org/webt/8h/p3/bq/8hp3bqpe3v1eth196kfbrnukdlc.png)
Bucket. .
![](https://habrastorage.org/webt/ib/1j/lo/ib1jlozxvwpqzhwuwwaapqmtvlg.png)
.
![](https://habrastorage.org/webt/2t/jq/ha/2tjqhaz9iwy2sxyhqwfesccjvq0.png)
C aws-s3-key.
![](https://habrastorage.org/webt/pt/fr/hc/ptfrhc19yivmny_jx_ykuk0219c.png)
WAL-G.
? . , , , . . , - , , . . , . . .
![](https://habrastorage.org/webt/fi/el/de/fieldera47xyfxevl5k2ejpndos.png)
, WAL-G, «backup list», . Object Storage, , . , , . , . , .
![](https://habrastorage.org/webt/nv/7k/rq/nv7krqlwxmwynkwuu8eyuzg-ba8.png)
. WAL-G «backup-push» WAL-G pgdata . , , PostgreSQL , , «archive-mode».
![](https://habrastorage.org/webt/fg/kv/7v/fgkv7vpmz5urdujgu_iearddure.png)
, «archive_mode = on» «archive_command», WAL-G. - - WAL-G. , . , WAL-G. - , GitHub. WAL-G , , archive_command.
![](https://habrastorage.org/webt/di/6a/4d/di6a4d-0wge1awychyofql9baau.png)
WAL-G High Availability Database management.
![](https://habrastorage.org/webt/ob/po/7m/obpo7mcdsikbp74yxpxcwmmu7so.png)
. Yandex Object Storage.
![](https://habrastorage.org/webt/xa/zy/a4/xazya4n0tqulyky2rpl7rckkayu.png)
– Point in time recovery. . .
![](https://habrastorage.org/webt/_n/nw/nc/_nnwncsdopzssadxu1nezucqxls.png)
. ? , . . pg_basebackup , . , , .
![](https://habrastorage.org/webt/jz/h5/-8/jzh5-8jyav7jk7yl2x7fc0yz6r4.png)
. -, .
![](https://habrastorage.org/webt/_4/wh/gt/_4whgt9lyl1ytylw8oj1dye8vuq.png)
- , , pg_basebackup .
- . , , .
- , . - , .
- , . , contribution WAL-G. WAL-G, : « , - ?». WAL-G.
- , , . .
- .
- .
![](https://habrastorage.org/webt/yb/0j/wu/yb0jwud2dsmmi7nirkkla8p5fai.png)
. , PostgreSQL. - , - , - .
![](https://habrastorage.org/webt/gm/jx/bp/gmjxbpyumzatiz3r8ddtr9pf-5c.png)
, WAL-G. . .
![](https://habrastorage.org/webt/cs/8j/h7/cs8jh7_r64dekawnhcm2cfe9row.png)
, – , WAL-G .
![](https://habrastorage.org/webt/zx/mc/7e/zxmc7ecup_c_r66mpevmn-imz14.png)
WAL-G 4 . :
WAL-PUSH – .
WAL-FETCH – .
BACKUP-PUSH – .
BACKUP-FETCH – .
![](https://habrastorage.org/webt/ys/ur/_q/ysur_qss2ejivp0vgev8ggskfca.png)
, WAL-G , . . listing , .
![](https://habrastorage.org/webt/ny/cv/o-/nycvo-vlpw1ckj3yikrvnowyu7g.png)
– -.
- , , . , WAL. WAL-, - . , , , - fail, 4 - 10 WAL. , - .
![](https://habrastorage.org/webt/sw/1r/pd/sw1rpd8cyggrka3afs3usl1wxny.png)
LSN-based – , , LSN LSN , , . , , -.
![](https://habrastorage.org/webt/9y/69/e9/9y69e9pdq8jj8-jartqlfnijbxg.png)
, .
![](https://habrastorage.org/webt/ds/84/jm/ds84jmhvpj9tjfph7ioghschvfu.png)
API PostgreSQL . PostgreSQL WAL- WAL-. WAL- «WAL-FETCH», «WAL-PREFETCH», 8 , .
, archive_status WAL-. WAL . , WAL. , , , API PostgreSQL. PostgreSQL archive_status , WAL-. , , . PostgreSQL, , .
![](https://habrastorage.org/webt/lt/ii/al/ltiialxpfx54zwsfgvgig4gjvow.png)
LSN-based WAL- , mode-time . , . , WAL-.
, WAL , , , . , . , delta-.
Delta- WAL-, , WAL. delta- .
![](https://habrastorage.org/webt/zt/id/na/ztidnayf2w3e098rienglfxxr7s.png)
, , , , WAL, , , , .
![](https://habrastorage.org/webt/db/ve/hz/dbvehzs7-bztijfr55_pzz0tvjs.png)
_delta_partial . , , WAL , , .
, , , , , , , LSN-based .
![](https://habrastorage.org/webt/qy/xp/yn/qyxpynmfcvbay6psbvaaiftxkv8.png)
, WAL-G. , , , - – , . ( https://github.com/wal-g/wal-g/tree/master/internal/walparser)
![](https://habrastorage.org/webt/2y/sy/1s/2ysy1s0y75oernmjezrctsmhocg.png)
. delta-. , , delta- , . , . delta-.
![](https://habrastorage.org/webt/bk/wi/vk/bkwivksel9wegbnqcrmka_wdots.png)
. . LSN-based, . , LSN-based delta- . . WAL-delta 20. . . , .
![](https://habrastorage.org/webt/l_/b-/9f/l_b-9f9wtrqcq1r-d8ouv_subgk.png)
, , – PostgreSQL, «pg_prefaulter»
![](https://habrastorage.org/webt/8u/jq/of/8ujqof1nx72ojops4gxexvhnv1g.png)
, , Stand-by restore command, WAL-G WAL-. , WAL . , SSD . WAL , . page-. , . WAL-G, , WAL . , . SSD-, , , , .
, .
![](https://habrastorage.org/webt/7x/8c/ne/7x8cneqqtsqo2fcrynnauo_s-2y.png)
, .
![](https://habrastorage.org/webt/es/nj/s3/esnjs3psgzp-muw9q1bmtml_pni.png)
, WAL-delta . , . WAL-delta , . WAL-delta , . , . «instant WAL-delta».
![](https://habrastorage.org/webt/ot/uk/jc/otukjcqjwarfgnktwg38lgt4avo.png)
, , , , . . . WAL, PostgreSQL , .
. , - , . . . WAL-delta. , , , - - , delta pg_basebackup, .
. . . - , , , .
, , .
![](https://habrastorage.org/webt/q2/w2/yo/q2w2yolvcnef3ahcr4-nwa7cui0.png)
WAL-G. , . , API MySQL . MySQL PITR WAL-, binlog. MySQL, - , binlog . - cron – - ?
MySQL restore command, , - -. , , , . , . , , - . (: MySQL )
![](https://habrastorage.org/webt/br/0v/jp/br0vjpoet3mwiygnwaur8vgabbu.png)
, WAL-G .
![](https://habrastorage.org/webt/tl/6o/pq/tl6opqdrxnviv7jgysyfqopuw5q.png)
, WAL-G . , . , WAL-G. - , High Availability , .
![](https://habrastorage.org/webt/ak/qo/va/akqovat-jvadafqzcxgjr0zdchk.png)
, WAL-G WAL-E. , WAL-G WAL-E , WAL-E. wal-push, . WAL-G , WAL-E . WAL-E archive-status, , , , WAL- , PostgreSQL .
WAL-G? PostgreSQL , , PostgreSQL , , mode-time md5 PostgreSQL – OK, , , .
WAL-E , archive command, WAL-G, WAL-E .
, , WAL-G , .
-, . , . , . , . . , WAL-G , smoke-: pg_dumpall /dev/null amcheck .
![](https://habrastorage.org/webt/fv/w5/vd/fvw5vd0lwx1yfkafbjljlzp0svu.png)
WAL-G WAL. . . . , , , . : « , ». WAL-G . ( — . — backup-mark https://github.com/wal-g/wal-g/blob/master/PostgreSQL.md)
![](https://habrastorage.org/webt/dr/7s/wn/dr7swnnui2oakgojqrpjzfog9e8.png)
PITR.
![](https://habrastorage.org/webt/gy/qb/ey/gyqbey8xtb0sy8shrhdx_mjbmva.png)
Google Summer of Code. , - Go «G», . , . , .
![](https://habrastorage.org/webt/-0/ea/ar/-0eaarnhwgcc9vrtovxfgmv76nm.png)
, . .
, WAL-G , . , , . pg_control . , - . , , . , .
offline-. , . . LSN, . LSN control . . . .
. . . - Go , bucket. pull request.
, , , , . . , , . , , PostgreSQL 9.4-9.5. , PostgreSQL, , . , , .
![](https://habrastorage.org/webt/ku/ag/nk/kuagnkbi1dnglau9plsdse-bk_s.png)
WAL-G , Database management. .
TODO. , , pull request, .
![](https://habrastorage.org/webt/xv/he/qs/xvheqsfhqlybyxh3xxdg4bfyagi.png)
! ! , WAL-delta, , , full-page writes. , ? . , FPW ?
Full-page writes , . . . , , . , , , . FPW . , .
! . – ?
pull request. SSD NMVE . , . , . , , , . , pull request. ( 0.2.13)
. , WAL-G , . . ?
, , . , , . , . , , – Go.
! ! WAL-G GPG . , . - ? .
GitHub, .
. . ?
, WAL-G , , : « , ?». , . . . , , . GPG , . GPG, open PGP, WAL-G, . Libsodium ( 0.2.15). , , – , . - . (PGP encryption without external GPG — v0.2.9)
! ! . , pg_basebackup WAL log , . . . - ?
, .
, .
. . , issue GitHub?
, .
, Google Summer of Code, , , .
. issue GitHub. , -, . restore. , . issues. , . . , .
, - (CEPH) , . ? retry . . - , , . , , . retry — exponential backoff. , , . . . , . ? , , . , , , .
SLA? , ?
, , , . . . Amazon Google Cloud, Yandex Object Storage .
?
. - , , WAL-G. , . Object Storage, - listing . , folder. WAL-G – - , , , , . . . , , Object Storage - , .
Mail .
reproduce…
…
reproduce, , , retry , , . , , . , . . 16 , retry 8 , 4 , 2 . . - 7,5 , 7,5 . .
! workflow WAL-G? , , . , . , , . - delta- , . . - ?
API delta- . – max delta steps, . . , , backup-push, . , , 3, , backup-push, . , 3 .
. . , WAL-G, ?
, WAL-G, , .
, , pg_basebackup?
, , . Pg_basebackup . WAL-G , . warning, .
Pg_basebackup .
, . Pg_basebackup . , , , . pg_basebackup . , , .
, CephFS. Object Storage .
, , , . .
! . remote storage, , - -?
– . , , . . . , . 0.2. , . . . WAL-E, . delta-backup. . , , Google Cloud, S3- storage.
, . , WAL-G – - barmen? ?
, . WAL-G , , . , . , - , . , , . WAL-G . - , .
, storage. , , , , . , - . . , , . , - . . , , . - , , – , .
PS Versi baru 0.2.15 telah dirilis , di mana Anda dapat menggunakan file konfigurasi .walg.json, yang secara default terletak di direktori home postgres. Anda dapat memilih keluar dari skrip bash. Contoh .walg.json dalam edisi ini https://github.com/wal-g/wal-g/issues/545
Video: