Skip to content

test: add regression test for Postgres SearchIndexServerStatsDAO incrementStats SQL - #36785

Closed
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/search-index-stats-postgres-sql-test
Closed

sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/search-index-stats-postgres-sql-test

Conversation

@sentry

@sentry sentry Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

COLLATE-BACKEND-DE captured PSQLException: ERROR: column "search_index_server_statsireaderwarnings" does not exist during distributed search index runs when StageStatsTracker.flush updates Postgres stats on conflict.

While the typo search_index_server_statsIreaderWarnings is already fixed on master (using search_index_server_stats.readerWarnings), recent release-2.0 builds continued to encounter the failure.

This PR adds SearchIndexServerStatsDAOSqlTest, a standalone unit test that inspects the Postgres @ConnectionAwareSqlUpdate annotation on SearchIndexServerStatsDAO.incrementStats and validates that:

  • Every DO UPDATE column increment uses the fully qualified table name search_index_server_stats.<col>.
  • No column expression concatenates the table identifier directly with the column name without a dot delimiter.

This test can be backported to release branches (like 2.0) to catch and prevent regressions.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Postgres incrementStats DO UPDATE SQL for search index server stats uses correctly qualified column references.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files added/updated: SearchIndexServerStatsDAOSqlTest

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

UI screen recording:

Not applicable — backend-only test change with no UI impact.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable).
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
  • Decision check: if this PR decides something the next contributor could undo — a schema field, REST path or format another component or repo must agree with, a new default or limit, an ordering that must hold, or a rule stated only in this description — it adds a record under docs/decisions/ (see its README.md). This description is gone from git log after the squash-merge.

Fixes COLLATE-BACKEND-DE

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@sentry
sentry Bot requested a review from a team as a code owner November 1, 2026 11:14
@sentry
sentry Bot requested a review from yan-3005 November 1, 2026 11:14
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@yan-3005

yan-3005 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Closing: the search_index_server_statsI… typo exists in no OSS commit on main, 2.1 or 2.0 (only in this PR's test), and the Postgres reindex ITs already execute the real upsert, which is a stronger guard than a regex over the annotation text. The hardcoded count of 15 assignments would also break whenever a stat column is added. COLLATE-BACKEND-DE likely came from a non-OSS build.

@yan-3005 yan-3005 closed this Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant