4

使用pg_start_backup的非排他备份没有backup_label文件?

 3 years ago
source link: https://www.oschina.net/question/4584830_2323503
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

使用pg_start_backup的非排他备份没有backup_label文件?

自己试了一下,在pg12中,使用pg_start_backup进行数据库基础备份的时候有两种模式可以选,排他和非排他,默认为排他模式,比如执行pg_start_backup(‘backup’);后会在data/目录下生成backup_label文件,在数据库恢复的时候从backup_label读取checkpoint的lsn和redo点的lsn,但是在使用非排他的模式时pg_start_backup(‘backup’,false,false);数据目录data/下面没有backup_label文件,这使得数据库恢复时要从control文件中读取checkpoint的lsn和redo点的lsn,但是pg_basebackup使用的是非排他模式,是有backup_label文件的
在pg12的官方文档里好像说非排他模式也会有backup_label文件。
现在有两个疑惑,1)非排他模式有没有backup_label文件;2)好像从control文件中读取lsn号好像也没问题,那为什么需要backup_label文件呢


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK