Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PBM-848 Documented describe backup with collections #136

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/reference/pbm-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Provides the detailed information about a backup:
- cluster information: the replica set name, the backup status on this replica set, whether it is used as a config server replica set, last write timestamp
- replica set info: name, backup status, last write timestamp and last transition time, `mongod` security options, if encryption is configured.
- for snapshot-based backups, provides the list of files being copied
- for logical and selective backups, provides the list of collections included in the backup. Available with version 2.3.0.

The command has the following syntax:

Expand All @@ -210,6 +211,7 @@ $ pbm describe-backup [<backup-name>] [<flags>]
| --------------------- | ------------------------------------- |
| `-o`, `--out=text` | Shows the status as either plain text or a JSON object. Supported values: `text`, `json`|
| `-l`, `--list-files` | Shows the list of files being copied for snapshot-based backups |
| `--with-collections` | Shows the collections included in the backup. For logical and selective backups only. Available with version 2.3.0.

??? admonition "JSON output"

Expand Down
130 changes: 106 additions & 24 deletions docs/usage/describe-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,109 @@
$ pbm describe-backup <backup-name>
```

The output provides the backup name, type, status, size and the information about the cluster topology it was taken in. For [selective backups](../features/selective-backup.md), it also shows the namespaces that were backed up:

Output:

```{.text .no-copy}
name: "2022-08-17T10:49:03Z"
type: logical
last_write_ts: 1662039300,2
last_transition_ts: "1662039304"
namespaces:
- Invoices.*
mongodb_version: 5.0.10-9
pbm_version: 2.0.0
status: done
size: 10234670
error: ""
replsets:
- name: rs1
status: done
iscs: false
last_write_ts: 1662039300,2
last_transition_ts: "1662039304"
error: ""
```
The output provides the backup name, type, status, size and the information about the cluster topology it was taken in. For [selective backups](../features/selective-backup.md), it also shows the namespaces that were backed up.

Check warning on line 9 in docs/usage/describe-backup.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/usage/describe-backup.md#L9

[Google.OxfordComma] Use the Oxford comma in 'The output provides the backup name, type, status, size and'.
Raw output
{"message": "[Google.OxfordComma] Use the Oxford comma in 'The output provides the backup name, type, status, size and'.", "location": {"path": "docs/usage/describe-backup.md", "range": {"start": {"line": 9, "column": 1}}}, "severity": "WARNING"}

Check notice on line 9 in docs/usage/describe-backup.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/usage/describe-backup.md#L9

[Google.Passive] In general, use active voice instead of passive voice ('was taken').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('was taken').", "location": {"path": "docs/usage/describe-backup.md", "range": {"start": {"line": 9, "column": 107}}}, "severity": "INFO"}

Check notice on line 9 in docs/usage/describe-backup.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/usage/describe-backup.md#L9

[Google.Passive] In general, use active voice instead of passive voice ('were backed').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('were backed').", "location": {"path": "docs/usage/describe-backup.md", "range": {"start": {"line": 9, "column": 213}}}, "severity": "INFO"}

??? example "Output"

```{.text .no-copy}
name: "2022-08-17T10:49:03Z"
type: logical
last_write_ts: 1662039300,2
last_transition_ts: "1662039304"
namespaces:
- Invoices.*
mongodb_version: 5.0.10-9
pbm_version: 2.0.0
status: done
size: 10234670
error: ""
replsets:
- name: rs1
status: done
iscs: false
last_write_ts: 1662039300,2
last_transition_ts: "1662039304"
error: ""
```

!!! admonition "Version added: [2.3.0](../release-notes/2.3.0.md)"

You can view the list of collections included in the *logical* or *selective* backup. This simplifies troubleshooting as it helps identify the backup contents for environments where databases are frequently created or dropped.

To view the backup contents, use the `--with-collections` flag:

```{.bash data-prompt="$"}
$ pbm describe-backup <backup-name> --with-collections
```

??? example "Output"

```{.text .no-copy}
name: "2023-09-14T14:44:33Z"
opid: 65031c51e6a16fa0e3deeb5f
type: logical
last_write_time: "2023-09-14T14:44:39Z"
last_transition_time: "2023-09-14T14:44:57Z"
mongodb_version: 6.0.9-7
fcv: "6.0"
pbm_version: 2.2.1
status: done
size_h: 89.3 KiB
replsets:
- name: rs0
status: done
node: rs00:30000
last_write_time: "2023-09-14T14:44:38Z"
last_transition_time: "2023-09-14T14:44:56Z"
collections:
- admin.pbmRRoles
- admin.pbmRUsers
- admin.system.roles
- admin.system.users
- admin.system.version
- db0.c0
- db0.c1
- db1.c0
- name: rs1
status: done
node: rs10:30100
last_write_time: "2023-09-14T14:44:38Z"
last_transition_time: "2023-09-14T14:44:49Z"
collections:
- admin.pbmRRoles
- admin.pbmRUsers
- admin.system.roles
- admin.system.users
- admin.system.version
- db0.c0
- db1.c0
- db1.c1
- name: cfg
status: done
node: cfg0:27000
last_write_time: "2023-09-14T14:44:39Z"
last_transition_time: "2023-09-14T14:44:42Z"
configsvr: true
collections:
- admin.pbmAgents
- admin.pbmBackups
- admin.pbmCmd
- admin.pbmConfig
- admin.pbmLock
- admin.pbmLockOp
- admin.pbmLog
- admin.pbmOpLog
- admin.pbmPITRChunks
- admin.pbmRRoles
- admin.pbmRUsers
- admin.system.roles
- admin.system.users
- admin.system.version
- config.chunks
- config.collections
- config.databases
- config.settings
- config.shards
- config.tags
- config.version
```