Skip to content

Fix merge-queue flakes: history walk, alert log flood, change-request supersede race, test races - #36970

Merged
yan-3005 merged 4 commits into
mainfrom
yan-3005/search-test-failures-fix
Nov 3, 2026
Merged

yan-3005 merged 4 commits into
mainfrom
yan-3005/search-test-failures-fix

Conversation

@yan-3005

@yan-3005 yan-3005 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes these merge-queue flakes from 2026-11-01 to 2026-11-03: BaseEntityIT…test_listEntityHistoryByTimestamp_pagedWalkMatchesUnpaginatedRead, StoredConfigBoundsTest.checkingWhatChangedIsLinearInTheDestinations, WorkflowDefinitionResourceIT.test_heldDescriptionAndPortChangesApplyTogether, DataProductDomainMigrationIT.testDataProductDomainMigrationBackAndForth, AssetsTabVersioningIT.movingAnAssetToAnotherDomain_dropsTheOldDomainsDataProducts, UserSecretsIT.aBotsUpdateIsStoredWithoutItsToken and PersonaAIContextIT.aiContextStatusPagesWithTheSameCursorAsThePersonaList. Each cause below was traced from the CI logs.

Flake Cause Fix
StoredConfigBoundsTest timed out 5 times on unrelated PRs Since #36147, validation decrypts every destination, including unchanged ones, so each one goes through ChannelResolution. That logged one INFO line per destination, and its dedup set clears at 10k entries. The test's 32k destinations wrote about 64k lines, which took 6–10 s on CI against a 10 s limit. Large alerts in production produce the same log flood. Log the resolution at DEBUG. Only an unregistered channel, which needs action, logs a WARN. The test now runs in 0.4 s.
test_heldDescriptionAndPortChangesApplyTogether A change request's workflow runs can finish out of order. The run for the older revision superseded the newer revision's live review task in CreateTask before attachTask noticed that run was stale. The request was then left with a cancelled task for good. A run whose revision is no longer the request's active revision skips the supersede. attachTask closes that run's own task, as before.
History walk (BaseEntityIT) A concurrent test hard-deleted the row that told page N there were more results. Page N+1 came back empty and without a cursor. Tables run 41626674696: table 0ee19500 was deleted at 11:45:57.356 by SubResourceAuthorizationIT's namespace cleanup. The forward walk skips empty pages.
DataProductDomainMigrationIT ES returned 429s and then a Partial shards failure on the synchronous domain update. The search retry queue repaired the docs about 33 s later, just after the 30 s wait. Wait 60 s.
AssetsTabVersioningIT (6 failures since 29 Oct) DomainBulkAssetsDryRunIT turns the "Multiple Domains are not allowed" rule off for a few seconds. Moving an asset during that window adds the new domain instead of replacing the old one. Take @ResourceLock("MULTI_DOMAIN_RULE", READ).
UserSecretsIT Change events are written asynchronously after the response, and the test read them once. Wait for the event.
PersonaAIContextIT The test compared the totals of two back-to-back list calls, and a parallel test created a persona in between. Retry both reads and all the asserts together.

Not in this PR

Type of change:

  • Bug fix

High-level design:

N/A: nine files with targeted fixes, two of them in product code (ChannelResolution logging and the CreateTask supersede guard via ChangeRequestService.isActiveRevision).

Tests:

Use cases covered

  • A large alert validates without flooding the log.
  • The run for a replaced change-request revision neither looks up nor cancels the live review task; the run for the active revision still does.
  • The listed integration tests no longer depend on the timing of other tests.

Unit tests

  • CreateTaskTest +5 tests, including gate tests that fail if the stale-revision check is removed.
  • Ran locally on f58d60d867d: SearchRepository*, SearchIndexRetry*, CreateTask*, ChangeRequestServiceTest, alerting channel tests and UpdateChildrenAsyncPropagationTest. 399 run, 0 failures.

Backend integration tests

  • No new endpoints; existing ITs fixed.
  • Ran locally:
    • Postgres+OpenSearch, parallel: 866 run, 0 failures. Classes: full TableResourceIT, DatabaseResourceIT, DataProductDomainMigrationIT, AssetsTabVersioningIT, UserSecretsIT, PersonaAIContextIT, ChartResourceIT.
    • Global-state, Postgres+OpenSearch and MySQL+ES: 21 run, 0 failures on each engine. Classes: WorkflowDefinitionResourceIT#test_heldDescriptionAndPortChangesApplyTogether, ChangeRequestLifecycleIT, ChangeRequestDecisionIT, ChangeRequestResourceIT.
  • Full IT suites are running in CI on this branch, on all three engines.
  • Not covered: no real-Flowable IT forces two revision runs to finish out of order, because that depends on timing. The gate tests cover the decision itself.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

Not applicable: these are server-internal fixes and test fixes. The evidence is the CI log analysis above.

UI screen recording:

Not applicable: backend and test changes only.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review against REVIEW.md, in two passes. The search-watcher findings no longer apply because the watcher was removed. Still open: the missing real-Flowable IT for out-of-order runs, which is timing-dependent.
  • Decision check: no durable decision.

… supersede race, stale child propagation

- History walk IT: a concurrent hard delete can leave the last forward page empty and cursorless;
  the walk now ends on the last page with rows.
- ChannelResolution logged every destination at INFO; since validation decrypts unchanged
  destinations, StoredConfigBoundsTest wrote ~64k lines and timed out. Log at DEBUG, WARN only
  for an unregistered channel.
- CreateTask: the run of a change-request revision that has since been replaced no longer
  supersedes the newer revision's live review task.
- Search: watch background child propagations and reindex the parent when one fails or skips
  children; queue a parent id in the id column so the retry worker can resolve it.
- Test fixes: UserSecretsIT waits for the async change event, PersonaAIContextIT compares both
  lists in one poll, AssetsTabVersioningIT takes the multi-domain rule lock, and
  DataProductDomainMigrationIT waits long enough for the retry queue's repair.
… the change-request supersede gate

- Poll the background task's status every 5s instead of one long-poll the client's socket timeout
  would cut off, so no search connection is held while a propagation runs.
- Watch only propagateToEntityChildren via a new propagateInheritedFields; deletes, renames and
  reference rewrites stay unwatched, since a parent reindex cannot repair what they rewrite.
- Check the stale revision inside the best-effort supersede, with a gate test that fails when
  the check is removed; rate-limit the unwatched-task warning; real-OpenSearch tests for the
  task outcome.
…polling through a failed status read

- tableColumn documents are built from their table and the retry worker's reindex does not rebuild
  them, so their propagation goes out unwatched; every other child group stays watched.
- Restore the original retry-queue entry for a failed single-index updateChildren, which delete and
  reference rewrites use, so a failed repair is not reported as completed.
- A status read that fails is retried on the next poll; a task still running at the deadline is
  logged. Share the active-revision check between attachTask and isActiveRevision.
@yan-3005 yan-3005 added the skip-pr-checks Bypass PR metadata validation check label Nov 3, 2026
@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Nov 3, 2026
@yan-3005
yan-3005 marked this pull request as ready for review November 3, 2026 15:33
Copilot AI balanced review requested due to automatic review settings November 3, 2026 15:33
@yan-3005
yan-3005 requested a review from a team as a code owner November 3, 2026 15:33
@yan-3005
yan-3005 requested a review from TeddyCr November 3, 2026 15:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

The owner-propagation flake's cause is not yet reproduced, and a failed background propagation
should reuse the search retry queue's propagation replay rather than a new repair path. It will be
handled in its own change once reproduced.
Copilot AI balanced review requested due to automatic review settings November 3, 2026 15:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@gitar-bot

gitar-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Change-request revision checks now gate approval-task supersession; a misread revision could cancel a newer review or leave obsolete tasks active.

Fixes four merge-queue flakes: the history walk now skips empty pages, large alerts log resolutions at DEBUG instead of flooding INFO, change-request runs for superseded revisions no longer cancel the live review task, and inherited-field search propagation is watched and repaired via the retry queue when ES tasks fail. No open issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@yan-3005
yan-3005 marked this pull request as draft November 3, 2026 16:04
@yan-3005 yan-3005 changed the title Fix merge-queue flakes: history walk, alert log flood, change-request supersede race, lost search propagation Fix merge-queue flakes: history walk, alert log flood, change-request supersede race, test races Nov 3, 2026
@yan-3005
yan-3005 marked this pull request as ready for review November 3, 2026 16:05
@yan-3005
yan-3005 added this pull request to the merge queue Nov 3, 2026
@yan-3005
yan-3005 merged commit 248fb18 into main Nov 3, 2026
147 of 156 checks passed
@yan-3005
yan-3005 deleted the yan-3005/search-test-failures-fix branch November 3, 2026 17:07
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.

3 participants