Pbm Delete backup

I’m using pbm version 2.2.1 and unable to delete the backups.

[mongod@tora-pl211 ~]$ pbm delete-backup 2024-03-16T01:00:02Z
Are you sure you want delete backup(s)? [y/N] y
Waiting for delete to be done ..Error: deleting: unable to delete: backup is a base for '2024-03-16T13:31:43 - 2024-04-02T11:22:05'

I had to delete the PITR backups using “pbm delete-pitr --older-than=” command before deleting the full logical backup.
Is this a bug in 2.2.1?

@aranjith0

Thanks for reaching out to us here.

Basically, there are certain conditions on backup type due to which backups cannot be deleted by pbm delete-backup command.

  1. A backup that is the base for any point-in-time recovery and with point-in-time recovery time ranges derived from it.

  2. The most recent backup, if Point-in-Time Recovery is enabled and there are no oplog slices following this backup yet.

It seems the backup you are trying to delete is used by the PITR [‘2024-03-16T13:31:43 - 2024-04-02T11:22:05’]

I had to delete the PITR backups using “pbm delete-pitr --older-than=”

Yes, in that case you have to rely on above command. Also, you can try pbm cleanup --older-than … in order to remove both backup and pitr slices together.

Reference:- Delete backups - Percona Backup for MongoDB

This doesn’t seems to be a bug rather its a behaviour!!

Let us know if this brings some clarity or if you having any further questions.

When i try to remove both backup and pitr slices together older than 10days using the command pbm cleanup --older-than=10d --yes
But it shows nothing to delete.

[mongod@tora-pl211 ~]$  pbm status
Cluster:
========
shard3ReplSet:
  - shard3ReplSet/pmgo-pl206.int.compumark.com:27018 [S]: pbm-agent v2.2.1 OK
  - shard3ReplSet/pmgo-pl205.int.compumark.com:27018 [P]: pbm-agent v2.2.1 OK
  - shard3ReplSet/pmgo-pl201.int.compumark.com:27028 [S]: pbm-agent v2.2.1 OK
shard1ReplSet:
  - shard1ReplSet/pmgo-pl203.int.compumark.com:27018 [S]: pbm-agent v2.2.1 OK
  - shard1ReplSet/pmgo-pl201.int.compumark.com:27018 [P]: pbm-agent v2.2.1 OK
  - shard1ReplSet/pmgo-pl202.int.compumark.com:27028 [S]: pbm-agent v2.2.1 OK
shard2ReplSet:
  - shard2ReplSet/pmgo-pl204.int.compumark.com:27018 [S]: pbm-agent v2.2.1 OK
  - shard2ReplSet/pmgo-pl202.int.compumark.com:27018 [P]: pbm-agent v2.2.1 OK
  - shard2ReplSet/pmgo-pl205.int.compumark.com:27028 [S]: pbm-agent v2.2.1 OK
configReplSet:
  - configReplSet/pmgo-pl204.int.compumark.com:27019 [S]: pbm-agent v2.2.1 OK
  - configReplSet/pmgo-pl202.int.compumark.com:27019 [P]: pbm-agent v2.2.1 OK
  - configReplSet/pmgo-pl206.int.compumark.com:27029 [S]: pbm-agent v2.2.1 OK


PITR incremental backup:
========================
Status [ON]

Currently running:
==================
(none)

Backups:
========
S3 us-east-1 s3://cm-mongo-db-shared-prod-va/percona/backup/
  Snapshots:
    2024-04-06T06:00:02Z 2.05TB <logical> [restore_to_time: 2024-04-06T16:25:25Z]
    2024-03-30T01:00:02Z 2.05TB <logical> [restore_to_time: 2024-03-30T11:19:59Z]
    2024-03-23T01:00:02Z 1.97TB <logical> [restore_to_time: 2024-03-23T10:54:59Z]
  PITR chunks [822.15GB]:
    2024-03-23T10:55:00Z - 2024-04-08T04:25:53Z
[mongod@tora-pl211 ~]$  pbm cleanup --older-than=10d --yes
nothing to delete

@aranjith0

Can you please confirm the pbm list output as well in order to verify the existing backups ?

Did you also tried with exact timestamp condition as below. Can you confirm if this is running fine ?

pbm cleanup --older-than=%Y-%M-%D --yes
pbm cleanup --older-than=%Y-%M-%DT%H:%M:%S --yes
  • %Y-%M-%DT%H:%M:%S (for example, 2023-04-20T13:13:20) or
  • %Y-%M-%D (2023-04-20)

Please also share the below logs to check about some events.

pbm logs --event=pitr
pbm logs --event=delete