Skip to content

comment out the time check from the code? #247

@bigplaice

Description

@bigplaice

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions