Skip to content

Skip unchanged current execution updates - #11713

Open
ali-khokhar-nvidia wants to merge 2 commits into
temporalio:mainfrom
ali-khokhar-nvidia:ali/skip-unchanged-current-executions
Open

Skip unchanged current execution updates#11713
ali-khokhar-nvidia wants to merge 2 commits into
temporalio:mainfrom
ali-khokhar-nvidia:ali/skip-unchanged-current-executions

Conversation

@ali-khokhar-nvidia

Copy link
Copy Markdown

Fixes #11710.

What changed?

After locking and validating a current-execution row, SQL persistence now skips UpdateCurrentExecutions when every persisted field is already equal. Start times are compared at the microsecond precision used by the SQL type converters.

Why?

The existing path rewrites current_executions even when the desired row is unchanged. Avoiding that physical update removes unnecessary WAL and tuple churn while retaining the existing FOR UPDATE lock and run-ID validation.

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)
go test ./common/persistence/sql -run '^Test(CurrentExecutionsEqual|AssertRunIDAndUpdateCurrentExecutionSkipsUnchangedRow)$' -count=1

The tests cover every field in CurrentExecutionsRow, verify database timestamp precision, prove an identical row performs zero updates, and prove a changed field still performs one update.

Potential risks

Only semantically identical rows skip the update. Changed state, status, identity, version, payload, encoding, or timestamp values continue through the existing update path.

@CLAassistant

CLAassistant commented Aug 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ali-khokhar-nvidia
ali-khokhar-nvidia marked this pull request as ready for review August 21, 2026 08:07
@ali-khokhar-nvidia
ali-khokhar-nvidia requested a review from a team August 21, 2026 08:07
@ali-khokhar-nvidia
ali-khokhar-nvidia requested review from a team as code owners August 21, 2026 08:07
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.

SQL persistence rewrites unchanged current execution rows

2 participants