ossc-db / pg_rman

Backup and restore management tool for PostgreSQL
http://ossc-db.github.io/pg_rman/index.html
Other
476 stars 77 forks source link

comment out the time check from the code? #247

Open bigplaice opened 1 year ago

bigplaice commented 1 year ago

Hi, pg_rman team,

I'm suffering a problem of backup failure, could you help me on this please? My pg database is running on one server and pg_rman is running on another server. pg_rman can access the "data" directory of database via NFS mount.

However, since the system time may be different on two servers, sometimes the following error appears.

FATAL: cannot take a backup DETAIL: There is a file with future timestamp from system time. Current system time may be rewound. HINT: The file is /map-to-pgdata/data/base/14432/1247. If this is a database file, please retry with the full backup mode. If this is a server log or archived WAL file, change the timestamp.

The related code is in backup.c->backup_files() { / If current time is rewinded, abort this backup. / if(tv.tv_sec < file->mtime) ereport(FATAL, (errcode(ERROR_SYSTEM), errmsg("cannot take a backup"), errdetail("There is a file with future timestamp from system time.\n" "Current system time may be rewound."), errhint("The file is %s.\n" "If this is a database file, please retry with the full backup mode.\n" "If this is a server log or archived WAL file, change the timestamp.", file->path)));

}

In my scenario, it's hard to guarantee strict time sync between two servers. So my question is, is it really necessary to check the time difference? Is it possible to comment out the time check from the code?

Thank you very much! Steven