question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WAL-E Clone should not use last_modified for recovery target time evaluation

See original GitHub issue

Hello everyone,

we’re currently facing problems with wal-e clone when copying backups from one point to another because the last modified flag is used for evaluation of the recovery target time. In our opinion, the start_time or finish_time flag should be used because it is insensitive against change of metadata because of copy or move operations. If our assumption is correct, I would create a PR for it.

def choose_backup(backup_list, recovery_target_time):
    """ pick up the latest backup file starting before time recovery_target_time"""

    match_timestamp = match = None
    for backup in backup_list:
        last_modified = parse(backup['last_modified'])
        if last_modified < recovery_target_time:
            if match is None or last_modified > match_timestamp:
                match = backup
                match_timestamp = last_modified
    if match is not None:
        return match['name']

https://github.com/zalando/spilo/blob/9cbf2094d7cf9eb95081c60db540b1d4e793a55f/postgres-appliance/bootstrap/clone_with_wale.py#L70

Thank you 😃

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
CyberDem0ncommented, Apr 15, 2021

Do we agree that the last_modified field is problematic?

Only if you are moving “files” around.

I don’t mind if you add some logic that will choose the field name based on conditions. Just keep in mind that wal-g shows time in a very strange format.

0reactions
AljoschaPcommented, Sep 4, 2021

Because we simply used direct cloning without copying files before, I will no longer work on it but I think it’s a problem that should definitely be addressed independent of the cloud provider. E.g. AWS has the same behavior and I think a lot of people can get into trouble because of this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation: 11: 27.2. Recovery Target Settings - PostgreSQL
This parameter specifies the time stamp up to which recovery will proceed. The precise stopping point is also influenced by recovery_target_inclusive.
Read more >
`--target-immediate` option copies all WAL files · Issue #205
This behavior is problematic in our case, since we have much more data in WAL files, than in the base backup, so it...
Read more >
Cloning a DR VM - Commvault Documentation
To make a virtual machine available for continued operation, you can recover the VM at the destination using the create clone DR VM...
Read more >
Disaster Recovery and Cloning - Crunchy Data
You may want to perform a point-in-time-recovery (PITR) to revert your database back to a state before a change occurred. Fortunately, PGO can...
Read more >
Untitled
Vi copy lines to buffer, Roberta mancino imdb, Dreizylinder ford focus, ... Industry giant 2 download full, Do not call list market research,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found