Skip to content

[adapters] Report transaction commit progress through global_stats.#5688

Merged
blp merged 1 commit intomainfrom
transaction-commit-progress
Feb 25, 2026
Merged

[adapters] Report transaction commit progress through global_stats.#5688
blp merged 1 commit intomainfrom
transaction-commit-progress

Conversation

@blp
Copy link
Member

@blp blp commented Feb 24, 2026

Until now, transaction commit progress has been reported through the pipeline's log, which makes it unavailable in any reasonable way through the API, to the web console, and so on. This commit adds transaction commit progress to global stats.

This removes the progress updates from the log. These could be added back in if it's still desirable.

Issue: #5245

Describe Manual Test Plan

I tested this by watching the metrics with a command like watch -n.1 'curl -sk https://localhost:8888/stats|jq .global_metrics' while transactions were progressing.

@blp blp requested a review from ryzhyk February 24, 2026 16:34
@blp blp self-assigned this Feb 24, 2026
@blp blp added DBSP core Related to the core DBSP library rust Pull requests that update Rust code labels Feb 24, 2026
@blp blp force-pushed the transaction-commit-progress branch from 7f910ce to 0f0e2c3 Compare February 24, 2026 16:42
@blp blp force-pushed the transaction-commit-progress branch from 0f0e2c3 to c99275f Compare February 24, 2026 17:15
@lalithsuresh
Copy link
Contributor

@blp any way we can export this as a prometheus metric?

Copy link
Contributor

@ryzhyk ryzhyk left a comment

Choose a reason for hiding this comment

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

Looks great, thanks! I would prefer to still keep logging for now. Until we have UI support, it gives the user some visual feedback on what's going on.

@ryzhyk
Copy link
Contributor

ryzhyk commented Feb 24, 2026

@blp any way we can export this as a prometheus metric?

If we do this, only the number of not-yet-processed operators should be sufficient to expose as a metric.

Copy link
Collaborator

@mythical-fred mythical-fred left a comment

Choose a reason for hiding this comment

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

Nit: commit subject has a trailing period — Feldera convention omits it.

)
}
Err(e) => error!("Error retrieving transaction commit progress: {e}"),
match self.circuit.commit_progress() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Performance concern: commit_progress() on DBSPHandle calls broadcast_command, which sends a message to every worker thread and blocks until all responses arrive — a full inter-thread round-trip for every worker. Previously this was gated behind COMMIT_UPDATE_INTERVAL (≥ 10 s between calls). Now it runs on every circuit step while Committing.

During a large commit with many steps per second this doubles the inter-thread coordination overhead per step (one round-trip for step(), then another for commit_progress()). Could we rate-limit this — e.g. sample every N ms or every N steps — so the API value stays fresh but the hot path only pays the broadcast cost occasionally?

Copy link
Contributor

Choose a reason for hiding this comment

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

Fred has a point, and more importantly measuring commit progress isn't free, so it does make sense to rate limit.

Copy link
Member Author

Choose a reason for hiding this comment

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

I figured commit steps were expensive anyway but shrug

Copy link
Contributor

Choose a reason for hiding this comment

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

They shouldn't be. We make an effort to split commit into small steps.

@blp blp force-pushed the transaction-commit-progress branch from c99275f to 36161bc Compare February 24, 2026 22:26
@blp
Copy link
Member Author

blp commented Feb 24, 2026

OK, I added the logging back, throttled the API progress updates to once a second, and added Prometheus metrics.

Until now, transaction commit progress has been reported through the
pipeline's log, which makes it unavailable in any reasonable way through
the API, to the web console, and so on.  This commit adds transaction
commit progress to global stats and to Prometheus metrics.

Issue: #5245

Signed-off-by: Ben Pfaff <blp@feldera.com>
@blp blp force-pushed the transaction-commit-progress branch from 36161bc to f7d7412 Compare February 24, 2026 22:27
@blp blp enabled auto-merge February 24, 2026 22:29
@blp blp added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit fb1c935 Feb 25, 2026
1 check passed
@blp blp deleted the transaction-commit-progress branch February 25, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DBSP core Related to the core DBSP library rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants