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:
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
| |
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. | |
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. | |
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
| |
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. | |
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. |
Manually create a savepoint
You can manually create savepoints only for a RUNNING deployment.
Open the savepoint creation dialog box.
Log on to the management console of Realtime Compute for Apache Flink.
Find the target workspace, and click Console in the Actions column.
In the left-side navigation pane, choose . On the Deployments page, click the name of the target deployment.
In the upper-right corner of the page, click Create Savepoint.
In the Create Savepoint dialog box, configure the Format parameter and enter the savepoint description in the Description field.
Click Create.
Configure scheduled savepoint creation
Go to the State tab.
Log on to the management console of Realtime Compute for Apache Flink.
Find the target workspace, and click Console in the Actions column.
In the left-side navigation pane, choose . On the Deployments page, click the name of the target deployment.
Switch to the State tab.
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]
NoteIn the [1, 7] format, 1 indicates Monday and 7 indicates Sunday.
* , - /
NoteThe 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.
Click Save Changes.
View the state generation overview
Go to the State tab.
Log on to the management console of Realtime Compute for Apache Flink.
Find the target workspace, and click Console in the Actions column.
In the left-side navigation pane, choose . On the Deployments page, click the name of the target deployment.
Switch to the State tab.
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
You can restore only a CANCELLED deployment from a specified savepoint. If your deployment is RUNNING, you must cancel the deployment first.
Go to the State tab.
Log on to the management console of Realtime Compute for Apache Flink.
Find the target workspace, and click Console in the Actions column.
In the left-side navigation pane, choose . On the Deployments page, click the name of the target deployment.
Switch to the State tab.
Click the History subtab under the State tab. In the Savepoints section, find the target savepoint.
Choose in the Actions column.
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
Go to the State tab.
Log on to the management console of Realtime Compute for Apache Flink.
Find the target workspace, and click Console in the Actions column.
In the left-side navigation pane, choose . On the Deployments page, click the name of the target deployment.
Switch to the State tab.
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.
Click Save Changes.
Manually delete a specific savepoint
Go to the State tab.
Log on to the management console of Realtime Compute for Apache Flink.
Find the target workspace, and click Console in the Actions column.
In the left-side navigation pane, choose . On the Deployments page, click the name of the target deployment.
Switch to the State tab.
Click the History subtab under the State tab. In the Savepoints section, find the target savepoint.
Choose in the Actions column.
Click OK.
Configure state related parameters
Go to the target deployment page.
Log on to the management console of Realtime Compute for Apache Flink.
Find the target workspace, and click Console in the Actions column.
In the left-side navigation pane, choose . On the Deployments page, click the name of the target deployment.
In the upper-right corner of the Parameters section on the Configuration tab, click Edit.
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.