Repository navigation
Fixes #33738: read committed alert state without request cache - #34089
Conversation
❌ PR checklist incompleteThis 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 |
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. OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
🚦 Removed from the merge queue —
|
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
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.