Skip to content

Fixes #37466: Skip the glossary tagged-asset rewrite on indices that hold no tagged document (backport 2.1 #37467) - #37519

Merged
anuj-kumary merged 1 commit into
2.1from
backport/2.1/pr-37467
Nov 11, 2026
Merged

anuj-kumary merged 1 commit into
2.1from
backport/2.1/pr-37467

Conversation

@anuj-kumary

Copy link
Copy Markdown
Member

Describe your changes:

Backport of #37467 to 2.1. Fixes #37466.

Accepting a held glossary-term move ran updateGlossaryTermByFqnPrefix as an _update_by_query against the global _all alias, opening a scroll context on every shard. On a busy cluster that exhausts search.max_open_scroll_context, the engine backs off for ~60s and fails with a 429, so POST /tasks/{id}/resolve outlasts its caller (GlossaryTermMoveApproval.spec.ts in nightly AUT).

OpenSearchEntityManager and ElasticSearchEntityManager now run a size-0 search with the same prefix query and a terms aggregation on _index first:

  • no index holds a tagged document → no update-by-query runs;
  • otherwise the update-by-query targets only the matching indices;
  • a failed shard sends the rename to SearchIndexRetryQueue; a full 1000-bucket page falls back to the whole alias.

Recorded in ADR:2026-11-11-a-global-alias-rewrite-targets-only-the-indices-holding-a-match (included).

Cherry-picked from 7e18ef87ed6 (git cherry-pick -x), applied cleanly with no conflicts.

Type of change:

  • Bug fix

Tests:

  • Diff-of-diffs: all 6 files' -U0 diffs match the original merge commit line-for-line.
  • OpenSearchEntityManagerUpdateByQueryRetryTest + ElasticSearchEntityManagerUpdateByQueryRetryTest on this branch (JDK 21): 14 run, 0 failures (same as the original PR).
  • openmetadata-integration-tests test-compile on this branch: BUILD SUCCESS (the new WorkflowDefinitionResourceIT test compiles against 2.1).
  • The new IT's helpers (SearchDocs.awaitDoc/tagFqns, moveFixture, deployTermGateWorkflow, TableTestFactory.createWithName, PENDING_CHANGE_HEADER) all exist on 2.1.
  • Not run locally: the integration tests and Playwright; they run in CI / the merge queue.

Checklist:

  • I have read the CONTRIBUTING document.
  • Decision check: carries the original's decision record.

…ssary term move is approved (#37467)

* Fixes #37466: Rewrite tagged assets in the background when a held glossary term move is approved

Accepting a held move or rename applied it inside POST /tasks/{id}/resolve
and waited on an _update_by_query across the global search alias. On a
large cluster that takes ~60s and can fail with 429 (too many scroll
contexts), so the reviewer's request timed out. The DB rewrite stays
synchronous; the tagged-asset rewrite now starts after commit on the async
executor, as an unheld move already does.

* Order glossary tagged-asset rewrites and record the decision

Every glossary-term tagged-asset rewrite, waited on or not, now runs on one
single-threaded lane in post-commit drain order, so a later rename cannot
overtake an approved move's background rewrite. Adds
ADR:2026-11-10-an-approved-glossary-term-move-rewrites-tagged-assets-in-the-background.

(cherry picked from commit 7e18ef8)
@anuj-kumary
anuj-kumary requested a review from a team as a code owner November 11, 2026 06:39
@anuj-kumary anuj-kumary added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Nov 11, 2026
@anuj-kumary
anuj-kumary removed the request for review from a team November 11, 2026 06:39
@anuj-kumary anuj-kumary added the skip-pr-checks Bypass PR metadata validation check label Nov 11, 2026
@anuj-kumary
anuj-kumary requested a review from TeddyCr November 11, 2026 06:39
@anuj-kumary
anuj-kumary enabled auto-merge (squash) November 11, 2026 06:41
@gitar-bot

gitar-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Glossary-term moves now discover matching search indices before rewriting them; aggregation misses could leave tagged assets with stale FQNs.

Skips the glossary tagged-asset update-by-query when no index holds a matching document, and otherwise limits it to the indices that do, so accepting a held glossary term move no longer exhausts scroll contexts on the global alias. No 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

@anuj-kumary
anuj-kumary merged commit c7ed991 into 2.1 Nov 11, 2026
55 checks passed
@anuj-kumary
anuj-kumary deleted the backport/2.1/pr-37467 branch November 11, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants