Skip to content

feat(diagnostics): detect corrupt PostgreSQL statistics#20682

Merged
nijel merged 1 commit into
WeblateOrg:mainfrom
nijel:db-check
Jul 15, 2026
Merged

feat(diagnostics): detect corrupt PostgreSQL statistics#20682
nijel merged 1 commit into
WeblateOrg:mainfrom
nijel:db-check

Conversation

@nijel

@nijel nijel commented Jul 15, 2026

Copy link
Copy Markdown
Member

No description provided.

@nijel nijel added this to the 2026.8 milestone Jul 15, 2026
@nijel nijel self-assigned this Jul 15, 2026
@nijel nijel enabled auto-merge (rebase) July 15, 2026 09:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 40a3f166d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread weblate/utils/db.py Outdated
Comment thread weblate/utils/apps.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 63c8e07dfc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread weblate/utils/db.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac24bd66c1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread weblate/utils/apps.py
)
)

check_database_statistics(errors)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Run the statistics probe before user-table queries

When the corrupted reltuples belongs to trans_project or one of its indexes, measure_database_latency() executes Project.objects.exists() before this new catalog probe and can raise DatabaseError during planning; the except then skips C047 entirely and reports only the generic C037 connection error. Running the catalog-only statistics check in its own try block, or before the latency query, keeps the new diagnostic actionable for the exact corruption it is meant to detect.

Useful? React with 👍 / 👎.

@nijel nijel merged commit 297fcc8 into WeblateOrg:main Jul 15, 2026
30 of 31 checks passed
@nijel nijel deleted the db-check branch July 15, 2026 19:50
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