Move a Statement to a Different Compute Pool

If a compute pool is close to its Confluent Flink Unit (CFU) limit, you can move a running statement to a different pool that has available capacity, instead of increasing the pool’s MAX_CFU.

This procedure applies only to a background statement, one that writes results to a table or topic, like an INSERT INTO statement or a materialized table’s underlying statement. A foreground statement, like an ad-hoc SELECT you run in a workspace cell, writes its results directly to the UI or a client, and stopping it doesn’t take a savepoint. Without a savepoint, there’s no state to resume from, so a foreground statement can’t be moved to a different compute pool. For more information about statement types, see Flink SQL Statements in Confluent Cloud for Apache Flink.

Moving a statement requires three steps, regardless of which interface you use:

  1. Stop the statement.

  2. Change its compute pool.

  3. Resume the statement.

Prerequisites

  • Access to Confluent Cloud.

  • An existing background statement.

  • Another compute pool with available CFU capacity, in the same environment and region as the statement.

Move a statement using the Console

  1. Log in to Confluent Cloud Console and navigate to the environment that has your statement.

  2. In the navigation menu, click Flink management, then click Statements, if it’s not selected already.

  3. Click the name of the statement you want to move.

    The statement’s details page opens.

  4. Click Stop, and in the confirmation dialog, click Confirm.

    Confluent Cloud takes a savepoint and stops the statement.

  5. Click the Settings tab.

  6. Click Edit Settings.

    The Edit settings panel opens, showing the statement’s current compute pool and account.

  7. In the Compute pool dropdown, select a different compute pool.

  8. Click Save and Resume.

    Confluent Cloud resumes the statement under the new compute pool, continuing from the savepoint.

Move a statement using the Confluent CLI

Run the confluent flink statement update command to stop the statement, then run it again to resume the statement under a different compute pool.

# Stop the statement.
confluent flink statement update ${STATEMENT_NAME} --stopped=true

# Resume the statement under a different compute pool.
confluent flink statement update ${STATEMENT_NAME} --stopped=false --compute-pool ${COMPUTE_POOL_ID}

Move a statement using the REST API

Send a PUT request to the Statements endpoint with stopped set to true to stop the statement. After the statement stops, send another PUT request with stopped set to false and compute_pool_id set to the new pool’s ID to resume the statement. For a complete example, see Move a statement to a different compute pool.

Move a statement using Terraform

In the confluent_flink_statement resource, set the stopped attribute to true and run terraform apply to stop the statement. After it stops, change the compute_pool block’s id attribute to the new pool and change stopped back to false, then run terraform apply again. You must change the compute pool and transition the statement from stopped to running in the same apply. For more information, see Statements.