Skip to content

[Flink] Add sourceParallelismUpperBound metric for auto-scaling systems#7117

Merged
yunfengzhou-hub merged 2 commits intoapache:masterfrom
wzhero1:feat/paimon-flink-available-max-parallelism-metrics
Feb 11, 2026
Merged

[Flink] Add sourceParallelismUpperBound metric for auto-scaling systems#7117
yunfengzhou-hub merged 2 commits intoapache:masterfrom
wzhero1:feat/paimon-flink-available-max-parallelism-metrics

Conversation

@wzhero1
Copy link
Contributor

@wzhero1 wzhero1 commented Jan 26, 2026

Purpose

This PR adds a new metric sourceParallelismUpperBound to the Flink Source Enumerator. This metric provides a recommended upper bound of parallelism for auto-scaling systems to optimize resource allocation.

Motivation

Auto-scaling systems need to understand the optimal parallelism for Paimon sources to:

  1. Avoid over-provisioning resources for fixed-bucket tables (where parallelism shouldn't exceed bucket count)
  2. Make informed scaling decisions for dynamic-bucket tables

The metric value:

  • For fixed bucket tables: equals the bucket number
  • For dynamic or postpone bucket tables (bucket = -1): equals the max parallelism

Note: This is a recommendation, not a hard limit - users can still configure higher parallelism manually if needed.

Tests

Added unit tests in FileStoreSourceMetricsTest.java:

  • continuousFileStoreFixBucketEnumeratorMetricsTest() - Verifies metric equals bucket number for fixed bucket tables
  • continuousFileStoreDynBucketEnumeratorMetricsTest() - Verifies metric equals current parallelism for dynamic bucket tables

Also added TestingMetricUtils.getGauge() helper method for testing Gauge metrics.

API and Format

No API or storage format changes. This only adds a new metric.

Documentation

Updated docs/content/maintenance/metrics.md with the new metric description.

@wzhero1 wzhero1 force-pushed the feat/paimon-flink-available-max-parallelism-metrics branch 2 times, most recently from affa652 to 438e986 Compare January 26, 2026 07:25
@wzhero1 wzhero1 force-pushed the feat/paimon-flink-available-max-parallelism-metrics branch from 438e986 to edbdea3 Compare February 10, 2026 02:42
@wzhero1 wzhero1 changed the title [Flink] Add sourceScalingMaxParallelism metric for auto-scaling systems [Flink] Add sourceParallelismUpperBound metric for auto-scaling systems Feb 10, 2026
@wzhero1 wzhero1 force-pushed the feat/paimon-flink-available-max-parallelism-metrics branch from edbdea3 to 166deaa Compare February 10, 2026 02:54
Copy link
Contributor

@yunfengzhou-hub yunfengzhou-hub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Left some comments as below.

Copy link
Contributor

@yunfengzhou-hub yunfengzhou-hub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@yunfengzhou-hub yunfengzhou-hub merged commit 959170d into apache:master Feb 11, 2026
14 checks passed
jerry-024 added a commit to jerry-024/paimon that referenced this pull request Feb 12, 2026
* upstream/master: (33 commits)
  [core] Fix merge adjacent files in DataEvolutionCompactCoordinator
  [python] Rename list_tag to list_tags
  [python] add list tag for TagManager (apache#7264)
  [core][python] Introduce DataFileMeta.nonNullRowIdRange to unify codes
  [python] with_shard should be evenly distributed for data evolution mode (apache#7271)
  [core] Remove useless version in Varant
  [core] Should work with Split in DataTableBatchScan
  [core] Fix  paimon_incremental_query with limit push down (apache#7269)
  [rest] Improve RestCatalog OpenAPI nonce generation (apache#7270)
  [cdc] Avoid sending empty schema change events to Schema Evolution (apache#7261)
  [python] Fix avro write timestamp without timezone wrongly (apache#7259)
  [doc] add doc for filter by _ROW_ID on data evolution (apache#7262)
  [fs] Extract jindo dls to separate module (apache#7263)
  [core] Add listTableDetails method to Catalog interface (apache#7266)
  [python] Support filter by _ROW_ID for data evolution (apache#7252)
  [Flink] Add sourceParallelismUpperBound metric for auto-scaling systems (apache#7117)
  [github] Add whether it is an AI-generated tag in the PR template (apache#7257)
  [core] Improve HttpClient error response handling (apache#7254)
  [python] Light refactor: move _is_blob_file check into DataFileMeta (apache#7256)
  [core] RowIdPredicateVisitor supports converting between statement (apache#7255)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants