Skip to content

Revert "fix(search): migrate stale owner aggregation field in stored searchSettings (#29691)"#29722

Closed
mohityadav766 wants to merge 1 commit into
mainfrom
revert-owner-agg-migration-29691
Closed

Revert "fix(search): migrate stale owner aggregation field in stored searchSettings (#29691)"#29722
mohityadav766 wants to merge 1 commit into
mainfrom
revert-owner-agg-migration-29691

Conversation

@mohityadav766

@mohityadav766 mohityadav766 commented Jul 3, 2026

Copy link
Copy Markdown
Member

Reverts #29691.

That migration diagnosed the wrong root cause. The real failure on the affected clusters (1.12.13) is in the reindex alias swap, not in stored searchSettings:

os...OpenSearchException: Request failed: [x_content_parse_exception] [1:99] [aliases] failed to parse field [actions]
  at OpenSearchIndexManager.swapAliases(OpenSearchIndexManager.java:454)
  at DefaultRecreateHandler.promoteEntityIndex(...)
Failed to atomically swap aliases for entity 'storedProcedure'/'dataProduct'/'classification' ...

The remove_index action was built with must_exist, which OpenSearch's _aliases parser rejects ([remove_index] unknown field [must_exist][aliases] failed to parse field [actions], HTTP 400). Every rebuilt index therefore fails to promote — so the canonical *_search_index aliases never attach, which is what produces the downstream aggregation/field errors that #29691 tried to paper over.

That parser bug is already fixed on main by #28700 (drop must_exist from remove_index); it just needs backporting to 1.12.13 (separate PR). The owner-aggregation scrub is unnecessary and adds a phantom 1.13.2 migration folder, so it's reverted.

🤖 Generated with Claude Code

Greptile Summary

This PR reverts #29691, which introduced a 1.13.2 data migration to retarget a stale owner-aggregation field (owners.displayName.keywordownerDisplayName) in stored searchSettings. The PR description argues that #29691 treated a symptom rather than the root cause: the real failure on affected 1.12.13 clusters is that remove_index alias actions were built with must_exist, a field that OpenSearch's _aliases parser rejects, causing every rebuilt index to fail alias promotion and producing the downstream aggregation errors that #29691 tried to fix. That parser bug is already corrected on main by #28700 and needs backporting to 1.12.x.

Confidence Score: 5/5

Safe to merge. This is a clean revert of a migration that was not yet part of any released version, with no orphaned registry entries remaining.

All six files added by #29691 are deleted consistently. A codebase-wide search confirms no v1132 or 1.13.2 references survive elsewhere, so the migration framework will not encounter orphaned entries or broken class lookups. The removed migration was data-only (no DDL), idempotent, and targeted a symptom rather than the root cause, making its removal low-risk. The actual root-cause fix (#28700, drop must_exist from remove_index) is already present on main.

No files require special attention — all deletions are consistent and complete.

Important Files Changed

Filename Overview
openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v1132/MigrationUtil.java Deleted: contained the owner-aggregation field-retargeting logic that is being reverted.
openmetadata-service/src/main/java/org/openmetadata/service/migration/mysql/v1132/Migration.java Deleted: MySQL migration entry point calling the now-reverted MigrationUtil.
openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v1132/Migration.java Deleted: Postgres migration entry point calling the now-reverted MigrationUtil.
bootstrap/sql/migrations/native/1.13.2/mysql/schemaChanges.sql Deleted: stub SQL file (comments-only, no schema DDL) for the reverted migration.
bootstrap/sql/migrations/native/1.13.2/postgres/schemaChanges.sql Deleted: stub SQL file (comments-only, no schema DDL) for the reverted migration.
openmetadata-service/src/test/java/org/openmetadata/service/migration/utils/v1132/OwnerDisplayNameAggregationScrubTest.java Deleted: unit tests for the reverted MigrationUtil; removal is consistent with the rest of the revert.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Cluster upgrading to 1.12.13] --> B[Reindex triggered]
    B --> C["OpenSearchIndexManager.swapAliases()"]
    C --> D{"remove_index action\ncontains must_exist?"}
    D -->|Yes - pre #28700| E["OpenSearch _aliases parser\nrejects must_exist field\nHTTP 400"]
    E --> F[alias swap fails]
    F --> G["canonical *_search_index aliases\nnever attach to rebuilt index"]
    G --> H["Aggregation queries hit\nstale index/mappings"]
    H --> I["#29691 attempted fix:\nmigrate stale owner agg field\nin stored searchSettings"]
    I --> J["Root cause still present\n(wrong fix)"]
    D -->|No - post #28700 / this PR| K["Alias swap succeeds"]
    K --> L["Correct index promoted\nwith updated mappings"]
    L --> M["ownerDisplayName agg\nworks correctly"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[Cluster upgrading to 1.12.13] --> B[Reindex triggered]
    B --> C["OpenSearchIndexManager.swapAliases()"]
    C --> D{"remove_index action\ncontains must_exist?"}
    D -->|Yes - pre #28700| E["OpenSearch _aliases parser\nrejects must_exist field\nHTTP 400"]
    E --> F[alias swap fails]
    F --> G["canonical *_search_index aliases\nnever attach to rebuilt index"]
    G --> H["Aggregation queries hit\nstale index/mappings"]
    H --> I["#29691 attempted fix:\nmigrate stale owner agg field\nin stored searchSettings"]
    I --> J["Root cause still present\n(wrong fix)"]
    D -->|No - post #28700 / this PR| K["Alias swap succeeds"]
    K --> L["Correct index promoted\nwith updated mappings"]
    L --> M["ownerDisplayName agg\nworks correctly"]
Loading

Reviews (1): Last reviewed commit: "Revert "fix(search): migrate stale owner..." | Re-trigger Greptile

…searchSettings (1.13.2) (#29691)"

This reverts commit 201968f.

The owner-aggregation settings migration diagnosed the wrong root cause. The
actual failure on the affected clusters (1.12.13) is that the reindex alias
swap is rejected by OpenSearch — `must_exist` on the `remove_index` action
makes the `_aliases` parser fail with `[aliases] failed to parse field
[actions]` (HTTP 400), so no rebuilt index is ever promoted. That is already
fixed on main by #28700; the fix simply needs backporting to 1.12.13. The
searchSettings owner-aggregation scrub is unnecessary and lands in a phantom
1.13.2 migration folder, so it is reverted here.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 3, 2026 08:27
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Jul 3, 2026
@gitar-bot

gitar-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Reverts the stale owner aggregation migration as it incorrectly targeted a symptom of a parser bug already resolved in main. This cleanup removes the unnecessary migration folder and prepares the codebase for a focused backport of the alias swap fix.

Options

Display: compact → Showing less information.

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

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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.

Pull request overview

Reverts the previously added 1.13.2 data-only migration that retargeted the stored searchSettings owner aggregation field (owners.displayName.keywordownerDisplayName), along with its tests and versioned SQL markers, based on updated understanding that the underlying failure is in the OpenSearch alias swap (handled elsewhere).

Changes:

  • Removes v1132 Java migration utility and MySQL/Postgres migration runners for the owner-aggregation retarget.
  • Deletes the associated unit test for the migration behavior.
  • Drops the no-op 1.13.2 native migration SQL files that existed only for version discovery.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
openmetadata-service/src/test/java/org/openmetadata/service/migration/utils/v1132/OwnerDisplayNameAggregationScrubTest.java Removes the unit test validating the owner aggregation field retarget in stored searchSettings.
openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v1132/MigrationUtil.java Removes the utility responsible for retargeting stale owner aggregation fields in persisted searchSettings.
openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v1132/Migration.java Removes the Postgres migration runner that invoked the v1132 data migration.
openmetadata-service/src/main/java/org/openmetadata/service/migration/mysql/v1132/Migration.java Removes the MySQL migration runner that invoked the v1132 data migration.
bootstrap/sql/migrations/native/1.13.2/postgres/schemaChanges.sql Removes the no-op SQL marker file for the 1.13.2 Postgres migration.
bootstrap/sql/migrations/native/1.13.2/mysql/schemaChanges.sql Removes the no-op SQL marker file for the 1.13.2 MySQL migration.

@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — 1 failure(s), 24 flaky

✅ 4478 passed · ❌ 1 failed · 🟡 24 flaky · ⏭️ 38 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 440 0 3 16
🟡 Shard 2 803 0 7 8
🟡 Shard 3 807 0 2 7
✅ Shard 4 811 0 0 5
🔴 Shard 5 854 1 2 0
🟡 Shard 6 763 0 10 2

Genuine Failures (failed on all attempts)

Pages/ExploreBrowse.spec.ts › service type drill-down disables unrelated roots and query-panel Clear resets it (shard 5)
�[31mTest timeout of 180000ms exceeded.�[39m
🟡 24 flaky test(s) (passed on retry)
  • Flow/Metric.spec.ts › Metric creation flow should work (shard 1, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: metric (shard 1, 1 retry)
  • Flow/SearchRBAC.spec.ts › a fully denied user sees neither asset type when browsing (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/BulkImport.spec.ts › Database service (shard 2, 1 retry)
  • Features/BulkImport.spec.ts › Database (shard 2, 1 retry)
  • Features/BulkImport.spec.ts › Table (shard 2, 2 retries)
  • Features/ContextCenterPermission.spec.ts › user with deleteAll permission can see delete action but not restore action on an archived document, and can delete it (shard 2, 2 retries)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › Admin: Complete export-import-validate flow (shard 2, 2 retries)
  • Features/ExploreQuickFilters.spec.ts › explore tree sidebar selection is not cleared when a top dropdown filter is applied (shard 2, 1 retry)
  • Features/SearchExport.spec.ts › Export queues a background job and downloads from the jobs tray (shard 3, 1 retry)
  • Features/Table.spec.ts › should persist page size (shard 3, 1 retry)
  • Pages/EntityDataConsumer.spec.ts › Tag Add, Update and Remove for child entities (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/Glossary.spec.ts › Glossary & terms creation for reviewer as team (shard 6, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Glossary Bulk Import Export (shard 6, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Import partial success - some terms pass, some fail (shard 6, 1 retry)
  • Pages/InputOutputPorts.spec.ts › Exit fullscreen with Escape key (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › Column lineage for container -> table (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage service type filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for pipelineService in platform lineage (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for apiService in platform lineage (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Create team with domain and verify visibility of inherited domain in user profile after team removal (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants