Unable to delete backup

[mongod@ip-10-80-10-153 ~]$ pbm status
Cluster:
========
configReplSet:
  - configReplSet/pmgo-pl204.int.compumark.com:27019: pbm-agent v2.0.0 OK
  - configReplSet/pmgo-pl202.int.compumark.com:27019: pbm-agent v2.0.0 OK
  - configReplSet/pmgo-pl206.int.compumark.com:27029: pbm-agent v2.0.0 OK
shard1ReplSet:
  - shard1ReplSet/pmgo-pl203.int.compumark.com:27018: pbm-agent v2.0.0 OK
  - shard1ReplSet/pmgo-pl201.int.compumark.com:27018: pbm-agent v2.0.0 OK
  - shard1ReplSet/pmgo-pl202.int.compumark.com:27028: pbm-agent v2.0.0 OK
shard2ReplSet:
  - shard2ReplSet/pmgo-pl204.int.compumark.com:27018: pbm-agent v2.0.0 OK
  - shard2ReplSet/pmgo-pl202.int.compumark.com:27018: pbm-agent v2.0.0 OK
  - shard2ReplSet/pmgo-pl205.int.compumark.com:27028: pbm-agent v2.0.0 OK
shard3ReplSet:
  - shard3ReplSet/pmgo-pl206.int.compumark.com:27018: pbm-agent v2.0.0 OK
  - shard3ReplSet/pmgo-pl205.int.compumark.com:27018: pbm-agent v2.0.0 OK
  - shard3ReplSet/pmgo-pl201.int.compumark.com:27028: pbm-agent v2.0.0 OK


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

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

Backups:
========
S3 us-east-1 s3://cm-mongo-db-shared-prod-va/pbm/backup
  Snapshots:
    2022-09-26T14:47:50Z 1.85TB <logical> [restore_to_time: 2022-09-27T08:00:21Z]
    2022-09-24T01:00:03Z 1.82TB <logical> [restore_to_time: 2022-09-24T18:49:35Z]
    2022-09-17T01:00:02Z 1.81TB <logical> [restore_to_time: 2022-09-17T17:39:11Z]
  PITR chunks [49.95GB]:
    2022-09-24T18:49:36Z - 2022-09-27T11:00:00Z
    2022-09-17T17:39:12Z - 2022-09-18T17:44:51Z
[mongod@ip-10-80-10-153 ~]$ pbm delete-backup 2022-09-17T01: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 '2022-09-17T17:39:11 - 2022-09-18T17:44:51'

[mongod@ip-10-80-10-153 ~]$ pbm delete-pitr --older-than="2022-09-24T18:49:35"
Are you sure you want delete chunks? [y/N] y
Waiting for delete to be done ...[done]
Backup snapshots:
  2022-09-17T01:00:02Z <logical> [restore_to_time: 2022-09-17T17:39:11Z]
  2022-09-24T01:00:03Z <logical> [restore_to_time: 2022-09-24T18:49:35Z]
  2022-09-26T14:47:50Z <logical> [restore_to_time: 2022-09-27T08:00:21Z]

PITR <on>:
  2022-09-17T17:39:12Z - 2022-09-18T17:44:51Z
  2022-09-24T18:49:36Z - 2022-09-27T11:00:00Z
[mongod@ip-10-80-10-153 ~]$ pbm delete-backup 2022-09-17T01: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 '2022-09-17T17:39:11 - 2022-09-18T17:44:51'
1 Like

Hi @aranjith0,

This is fixed in [PBM-850] Add ability to delete older backups - Percona JIRA. Wait for the release.

But right now, you can delete PITR first and the backup after:

pbm delete-pitr --older-than="2022-09-24T18:49:36Z"  # will delete [2022-09-17T17:39:12Z - 2022-09-18T17:44:51Z]
pbm delete-backup "2022-09-17T01:00:02Z"
1 Like

Yes, it works for me.

But when i run the full backup, it gave below warning :
2022-10-03T09:27:58Z 0.00B [ERROR: get file 2022-10-03T09:27:58Z/configReplSet/local.oplog.rs.bson.s2: no such file] [2022-10-03T09:28:03Z]

But I verified that the backup is getting successful at the end.

[mongod@ip-10-80-10-113 ~]$ pbm status
Cluster:
========
configReplSet:
  - configReplSet/pmgo-pl204.int.compumark.com:27019: pbm-agent v2.0.0 OK
  - configReplSet/pmgo-pl202.int.compumark.com:27019: pbm-agent v2.0.0 OK
  - configReplSet/pmgo-pl206.int.compumark.com:27029: pbm-agent v2.0.0 OK
shard1ReplSet:
  - shard1ReplSet/pmgo-pl203.int.compumark.com:27018: pbm-agent v2.0.0 OK
  - shard1ReplSet/pmgo-pl201.int.compumark.com:27018: pbm-agent v2.0.0 OK
  - shard1ReplSet/pmgo-pl202.int.compumark.com:27028: pbm-agent v2.0.0 OK
shard2ReplSet:
  - shard2ReplSet/pmgo-pl204.int.compumark.com:27018: pbm-agent v2.0.0 OK
  - shard2ReplSet/pmgo-pl202.int.compumark.com:27018: pbm-agent v2.0.0 OK
  - shard2ReplSet/pmgo-pl205.int.compumark.com:27028: pbm-agent v2.0.0 OK
shard3ReplSet:
  - shard3ReplSet/pmgo-pl206.int.compumark.com:27018: pbm-agent v2.0.0 OK
  - shard3ReplSet/pmgo-pl205.int.compumark.com:27018: pbm-agent v2.0.0 OK
  - shard3ReplSet/pmgo-pl201.int.compumark.com:27028: pbm-agent v2.0.0 OK


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

Currently running:
==================
Snapshot backup "2022-10-03T09:27:58Z", started at 2022-10-03T09:27:59Z. Status: snapshot backup. [op id: 633aab1e0ba693a0885ce775]

Backups:
========
S3 us-east-1 s3://cm-mongo-db-shared-prod-va/pbm/backup
  Snapshots:
    2022-10-03T09:27:58Z 0.00B <logical> [ERROR: get file 2022-10-03T09:27:58Z/configReplSet/local.oplog.rs.bson.s2: no such file] [2022-10-03T09:28:03Z]
    2022-09-28T09:20:02Z 1.86TB <logical> [restore_to_time: 2022-09-29T01:58:30Z]
    2022-09-28T07:57:20Z 14.85GB <logical, selective> [restore_to_time: 2022-09-28T08:16:32Z]
  PITR chunks [63.96GB]:
    2022-09-29T01:58:31Z - 2022-10-03T08:44:48Z