Skip to content

Use EXCLUDED values for history-node upserts - #12110

Open
perfloop-agent wants to merge 4 commits into
temporalio:mainfrom
perfloop-oss:perfloop-pr-open-6aw1gf2qxv
Open

perfloop-agent wants to merge 4 commits into
temporalio:mainfrom
perfloop-oss:perfloop-pr-open-6aw1gf2qxv

Conversation

@perfloop-agent

Copy link
Copy Markdown

What changed?

The PostgreSQL history-node upsert now takes prev_txn_id, data, and data_encoding from EXCLUDED during conflict updates instead of binding those values a second time.

Added focused PostgreSQL coverage for insert and conflict-update readback, transaction IDs, empty and nil bytea behavior, rows affected, errors, and rollback across the supported drivers.

Why?

This avoids sending duplicate history-node values on each append while preserving the stored-row and conflict-update behavior. The change does not alter the driver, schema, transaction handling, or durability settings.

Workload: RespondWorkflowTaskCompleted with one sequential 1 KiB echo activity (256 workflows)

Metric Before After Change
postgresql_protocol_bytes_per_workflow 91630 80912 11.7% lower

Workload: RespondWorkflowTaskCompleted with ten sequential 1 KiB echo activities (256 workflows)

Metric Before After Change
postgresql_protocol_bytes_per_workflow 451605 388873 13.9% lower
Checks: 1 passed.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Ran the focused PostgreSQL HistoryNode and HistoryStore suites for lib/pq, pgx extended protocol, and pgx simple protocol against PostgreSQL 17.11 with durability enabled. Also ran complete SDK workflow checks and protocol-byte validation for one- and ten-activity workloads.

Potential risks

The regression coverage is limited to the supported managed PostgreSQL schema and role. Unsupported custom triggers or unusual role policies are not covered.


Generated by Perfloop. Human sponsor: Tomás Senart. Measurements and checks. Reproduce this comparison (tenant access required).

@perfloop-agent
perfloop-agent requested review from a team as code owners September 16, 2026 19:14
@CLAassistant

CLAassistant commented Sep 16, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@tsenart

tsenart commented Sep 16, 2026

Copy link
Copy Markdown

Hi, I'm Tomás, I build Perfloop. I approved this contribution and will handle review feedback here.

We've had performance PRs merged in ClickHouse, Prometheus, Ruff/ty, parquet-go, RoaringBitmap, and more. The measurements for this one cover complete Temporal workflows, with correctness checks across all three PostgreSQL driver modes.

@ratdaddy ratdaddy self-assigned this Sep 28, 2026

This branch has not been deployed

No deployments
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.

4 participants