Skip to content

Fixes #33738: read committed alert state without request cache - #34089

Merged
harshach merged 2 commits into
mainfrom
fix/event-subscription-scheduler-fresh-read
Sep 28, 2026
Merged

harshach merged 2 commits into
mainfrom
fix/event-subscription-scheduler-fresh-read

Conversation

@harshach

Copy link
Copy Markdown
Collaborator

Describe your changes

Fixes #33738 (remaining alert scheduling race). Follow-up to #34059.

The PostgreSQL + Elasticsearch + Redis parallel lane in the merge queue run observed a disabled subscription whose Quartz job still reported active after concurrent enable/disable PATCH requests completed.

A no-op PATCH can retain an earlier subscription value in the request-scoped entity cache. Another request can then commit a different enabled state before the no-op request reaches scheduler reconciliation. Although the scheduler asks the repository for an uncached read, the request-scoped cache could still answer with the earlier value. The scheduler then accepts its stale decision as settled.

Scheduler reconciliation now enters FreshReadScope, and that scope bypasses the request-scoped cache on reads and writes. This makes the committed database row drive the final Quartz state.

Type of change

  • Bug fix

Tests

  • RequestEntityCacheTest.freshReadScopeBypassesRequestCache: failed on the old code, passes with the fix (5 tests, 0 failures in the class).
  • EventSubscriptionResourceIT.test_concurrentEnableDisableLeavesScheduleMatchingCommittedState: passed in the PostgreSQL + Elasticsearch + Redis lane (1 test, 0 failures).
  • mvn -pl openmetadata-service spotless:check: passed.

The MySQL global-state failure in the same merge queue attempt was a separate OpenSearch test-container startup failure; this PR addresses the scheduler mismatch.

UI screen recording / screenshots

Not applicable.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Sep 27, 2026
@harshach
harshach marked this pull request as ready for review September 27, 2026 20:30
@harshach
harshach requested a review from a team as a code owner September 27, 2026 20:30
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Fresh-read scoping changes alert schedule reconciliation to use committed subscription state.

Bypasses request-scoped entity cache during alert schedule reconciliation to prevent stale subscription state from driving Quartz job decisions. Fixes a race condition where concurrent enable/disable requests could leave the scheduler out of sync with the committed database state. No issues found.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@harshach harshach added the skip-pr-checks Bypass PR metadata validation check label Sep 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-28T17:50:21Z)

Blocked the queue: integration-tests-mysql-elasticsearch

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration tests fail randomly in the merge queue: CsvExportMultiNodeIT starts extra servers inside the parallel lane's JVM

2 participants