Skip to content

Commit

Permalink
[#20493] yugabyted: Providing support for PITR through yugabyted CLI.
Browse files Browse the repository at this point in the history
Summary:
This diff introduces a new sub-command `configure point_in_time_recovery` under the `configure` top-level command in yugabyted. This enhancement enables users to run PITR operations for specific databases or keyspaces through `yugabyted`.

**Adding the following functionalities for PITR**

The following flags have been added to sub-command `configure point_in_time_recovery`:

  # //--enable//: Enable point-in-time recovery for a database or keyspace.

  # //--disable//: Disable point-in-time recovery for a database or keyspace.

  # //--status//: Display point-in-time recovery status for a YugabyteDB cluster.

  # //--retention//: Determines the duration for which each snapshot is to be retained.

  # //--database//: Name of the YSQL database for which point-in-time recovery is being configured.

  # //--keyspace//: Name of the YCQL keyspace for which point-in-time recovery is being configured.

The following flag have been added to the top-level command `restore`:

  # //--recover_to_point_in_time//: Triggers the restoration of the database or keyspace to the state at the specified timestamp.

**User journey to run PITR operations**

  1. Enable PITR for database `postgres`

Command:

```
./yugabyted configure point_in_time_recovery \
--enable --database postgres --retention 10
```

  2. Display PITR status for database `postgres`

Command:

```
./yugabyted configure point_in_time_recovery \
--status --database postgres
```

Alternatively PITR status for all databases and keyspaces can also be displayed using:

 Command:

 ```
 ./yugabyted configure point_in_time_recovery \
 --status
 ```

  3. Recover to a point in time for database `postgres`

Command:

 ```
 ./yugabyted restore --recover_to_point_in_time 2024-01-29 9:30:00 PM \
 --database postgres
 ```
 4. Disable PITR for database `postgres`

Command:

```
./yugabyted configure point_in_time_recovery \
--disable --database postgres
```
Jira: DB-9501

Test Plan: Manual Testing.

Reviewers: sgarg-yb, nikhil

Reviewed By: sgarg-yb, nikhil

Subscribers: yugabyted-dev, shikhar.sahay

Differential Revision: https://phorge.dev.yugabyte.com/D32012
  • Loading branch information
ShikharSahay committed Feb 21, 2024
1 parent 82496d1 commit 2b75cb7
Showing 1 changed file with 747 additions and 22 deletions.

0 comments on commit 2b75cb7

Please sign in to comment.