All Products
Search
Document Center

Realtime Compute for Apache Flink:Manage a state set

Last Updated:Feb 20, 2025

The checkpoints and savepoints of a deployment are collectively called its state set. This topic describes how to manage the state set of a deployment, including how to create, view, or delete a state (checkpoint or savepoint), or restore a deployment from a specific state.

Background information

Term

Description

Checkpoint

The lifecycle of a checkpoint is managed by Flink. You can configure the Checkpointing Interval, Checkpointing Timeout time, and Min Interval Between Checkpoints parameters and view checkpointing information. You cannot manually create or delete a checkpoint. By default, a single checkpoint is retained for a deployment. This checkpoint can be used when you want to restore the deployment. For more information about how to configure the checkpointing parameters, see Configure a deployment.

Savepoint

The lifecycle of a savepoint is solely managed by the user:

  • Savepoints can be triggered by the user manually during deployment running or upon deployment cancellation. Additionally, they can also be triggered by the Ververica Platform (VVP) either once or at regular intervals.

  • Savepoints can be deleted by the user manually, or through VVP either once or at regular intervals.

  • When starting a deployment, you can restore it from a specified savepoint.

Note

Though VVP can create and release savepoints periodically, these operations remain under user control, as they are executed based on user-configured rules.

The following table outlines the operations that you can perform on checkpoints and savepoints in specific scenarios. For more information, see the related sections of this topic.

Operation

Scenario

Reference

Manually create a savepoint

If you want to manually create a savepoint at a specific point in time (during deployment running or upon its cancellation) and restore the deployment from this savepoint, you can manually create a savepoint.

Important
  • A manually created savepoint can only be manually deleted; it cannot be released automatically based on the cleanup rule.

  • If you select Stop With Savepoint when canceling a deployment, the amount of data that needs to be retrieved is reduced. However, it takes more time to cancel the deployment.

Configure scheduled savepoint creation

If you want the system to automatically create savepoints at regular intervals, you can enable scheduled generation of savepoints and specify an interval at which savepoints are created. After the rules for scheduled savepoint generation are saved, the system automatically creates savepoints when the deployment is running.

Configure scheduled generation of savepoints

View the state generation overview

On the State tab of a deployment, you can have an overview of its checkpointing and savepoint creation history, quickly learning of the existing checkpoint and savepoints and the completion time.

View the state generation overview

Resume a deployment from a specific savepoint

You can specify a savepoint to restore a deployment.

Note

To share savepoints across deployments, make sure that the state data between deployments is compatible through measures such as a dual-run test.

Restore a deployment from a specified savepoint of another deployment

Configure automatic cleanup rules for savepoints

If you want VVP to automatically delete savepoints, configure the maximum number of historical savepoints that can be saved or the retention period of savepoints. After the automatic cleanup rules for savepoints are saved, the system automatically deletes savepoints based on the rules when the deployment is running.

Note
  • Automatic cleanup does not delete manually created savepoints, which can only be manually deleted.

  • If a deployment is suspended for a long period of time, the system deletes its savepoints based on the cleanup rules upon deployment startup.

Configure automatic cleanup rules for savepoints

Manually delete a specific savepoint

Manually created savepoints are no longer automatically deleted during deployment running. Therefore, you must regularly delete the outdated savepoints. Otherwise, they occupy unnecessary space in Object Storage Service (OSS) storage and incur additional fees.

Manually delete a specific savepoint

Configure state related parameters

You can configure state related parameters, including the streaming state backend, state time-to-live (TTL) in SQL deployments, and whether temporary data generated during the savepoint creation being stored on a local disk.

Configure state related parameters

Manually create a savepoint

Note

You can manually create savepoints only for a RUNNING deployment.

  1. Open the savepoint creation dialog box.

    1. Log on to the management console of Realtime Compute for Apache Flink.

    2. Find the target workspace, and click Console in the Actions column.

    3. In the left-side navigation pane, choose O&M > Deployments. On the Deployments page, click the name of the target deployment.

  2. In the upper-right corner of the page, click Create Savepoint.

  3. In the Create Savepoint dialog box, configure the Format parameter and enter the savepoint description in the Description field.

    创建快照

  4. Click Create.

Configure scheduled savepoint creation

  1. Go to the State tab.

    1. Log on to the management console of Realtime Compute for Apache Flink.

    2. Find the target workspace, and click Console in the Actions column.

    3. In the left-side navigation pane, choose O&M > Deployments. On the Deployments page, click the name of the target deployment.

    4. Switch to the State tab.

  2. On the Configure subtab, turn on Savepoint automatically generated at regular intervals and configure the Period setting parameter.

    You can click Quick Setting and select an option from the drop-down list. You can also use a CRON expression to specify the interval by clicking the field that you want to modify in the Period setting parameter and change the value of each field. The following table describes the valid values of the five fields in a CRON expression and the supported special characters.

    Field

    Required

    Valid values

    Supported special characters

    minute

    Supported

    [0, 59]

    * , - /

    hour

    Supported

    [0, 23]

    * , - /

    day

    Supported

    [1, 31]

    * , - /

    month

    Supported

    [1, 12] or [JAN, DEC]

    * , - /

    week

    Supported

    [1, 7] or [MON, SUN]

    Note

    In the [1, 7] format, 1 indicates Monday and 7 indicates Sunday.

    * , - /

    Note

    The minimum interval is 10 minutes. If the interval that you specify by using a CRON expression is less than 10 minutes, the system automatically creates savepoints at an interval of 10 minutes.

    The following table describes the meaning of the supported special characters in each field in a CRON expression.

    Supported special characters

    Meaning

    Cron expression

    *

    Indicates any valid value.

    In the month field, an asterisk (*) indicates every month. In the week field, an asterisk (*) indicates every day of the week.

    ,

    Lists enumerated values.

    In the minute field, 5,20 indicates that the task is triggered once at the 5th and 20th minutes.

    -

    Indicates a range.

    In the minute field, 5-20 indicates that the task is triggered once every minute from the 5th minute to the 20th minute.

    /

    Indicates increments.

    In the minute field, 0/15 indicates that the task is triggered once every 15 minutes from the beginning of an hour. In the minute field, 3/20 indicates that the task is triggered once every 20 minutes from the 3rd minute of an hour.

    The following table describes sample values of CRON expressions.

    Cron expression

    Description

    15 10 * * *

    Executes the task at 10:15 every day.

    0 12 * * *

    Executes the task at 12:00 every day.

    0 10,14,16 * * *

    Executes the task at 10:00, 14:00, and 16:00 every day.

    0/30 9-17 * * *

    Executes the task every 30 minutes between 09:00 and 17:00 every day.

    * 14 * * *

    Executes the task every minute between 14:00 and 14:59 every day.

    0-5 14 * * *

    Executes the task every minute between 14:00 and 14:05 every day.

    0/5 14 * * *

    Executes the task every 5 minutes between 14:00 and 14:55 every day.

    0/5 14,18 * * *

    Executes the task every 5 minutes between 14:00 and 14:55 and between 18:00 and 18:55 every day.

    0 12 * * WED

    Executes the task at 12:00 every Wednesday.

    15 10 15 * *

    Executes the task at 10:15 on the 15th day of every month.

    10,44 14 * 3 WED

    Executes the task at 14:10 and 14:44 every Wednesday in March every year.

  3. Click Save Changes.

View the state generation overview

  1. Go to the State tab.

    1. Log on to the management console of Realtime Compute for Apache Flink.

    2. Find the target workspace, and click Console in the Actions column.

    3. In the left-side navigation pane, choose O&M > Deployments. On the Deployments page, click the name of the target deployment.

    4. Switch to the State tab.

  2. On the Overview subtab under the State tab, view the checkpoint and savepoint information:

    Item

    Description

    Checkpoint

    Allows you to view information about the last successful and failed checkpoints, including the id, complete time, duration, and size.

    Savepoint

    Allows you to view information about the last successful and failed savepoints, including the id, complete time, duration, or failure time.

Resume a deployment from a specific savepoint

Note

You can restore only a CANCELLED deployment from a specified savepoint. If your deployment is RUNNING, you must cancel the deployment first.

  1. Go to the State tab.

    1. Log on to the management console of Realtime Compute for Apache Flink.

    2. Find the target workspace, and click Console in the Actions column.

    3. In the left-side navigation pane, choose O&M > Deployments. On the Deployments page, click the name of the target deployment.

    4. Switch to the State tab.

  2. Click the History subtab under the State tab. In the Savepoints section, find the target savepoint.

  3. Choose More > Start job from this snapshot in the Actions column.

  4. In the Start Job dialog box, configure the startup parameters.

    For more information about the configuration, see Start a deployment.

Configure automatic cleanup rules for savepoints

  1. Go to the State tab.

    1. Log on to the management console of Realtime Compute for Apache Flink.

    2. Find the target workspace, and click Console in the Actions column.

    3. In the left-side navigation pane, choose O&M > Deployments. On the Deployments page, click the name of the target deployment.

    4. Switch to the State tab.

  2. On the Configure subtab under the State tab, turn on Scheduled automatic cleaning of savepoint and configure automatic cleanup rules for savepoints.

    You can configure the Number of historical snapshots saved and The maximum time to save historical snapshots (unit: hours) parameters. When the deployment is running, the system automatically deletes savepoints if one of the conditions is met.

  3. Click Save Changes.

Manually delete a specific savepoint

  1. Go to the State tab.

    1. Log on to the management console of Realtime Compute for Apache Flink.

    2. Find the target workspace, and click Console in the Actions column.

    3. In the left-side navigation pane, choose O&M > Deployments. On the Deployments page, click the name of the target deployment.

    4. Switch to the State tab.

  2. Click the History subtab under the State tab. In the Savepoints section, find the target savepoint.

  3. Choose More > Delete this savepoint in the Actions column.

  4. Click OK.

Configure state related parameters

  1. Go to the target deployment page.

    1. Log on to the management console of Realtime Compute for Apache Flink.

    2. Find the target workspace, and click Console in the Actions column.

    3. In the left-side navigation pane, choose O&M > Deployments. On the Deployments page, click the name of the target deployment.

  2. In the upper-right corner of the Parameters section on the Configuration tab, click Edit.

  3. In the Other Configuration field, add the following code and click Save.

    state.backend.incremental: true
    table.exec.state.ttl: 129600000

    For more information about basic parameters and advanced parameters that you can configure in the console of Realtime Compute for Apache Flink, see Configurations of GeminiStateBackend.

References