Skip to content

fix: Do not clear the schema cache during retries - #4869

Merged
steve-chavez merged 1 commit into
PostgREST:mainfrom
mkleczek:push-olktzqvzkonu
Jun 11, 2026
Merged

fix: Do not clear the schema cache during retries#4869
steve-chavez merged 1 commit into
PostgREST:mainfrom
mkleczek:push-olktzqvzkonu

Conversation

@mkleczek

@mkleczek mkleczek commented May 4, 2026

Copy link
Copy Markdown
Collaborator

DISCLAIMER:
This commit was authored entirely by a human without the assistance of LLMs.

retryingSchemaCacheLoad should not clear existing schema cache upon failure - there is no reason to do that.
If there is a communication issue with the database server or db is down, clients are going to get 502 anyway. If it was a glitch when loading the schema cache - the clients are going to use old (stale) schema cache for some time until next retry re-loads it successfully.

Fixes #4873

@mkleczek
mkleczek requested a review from steve-chavez May 4, 2026 07:49
@mkleczek
mkleczek force-pushed the push-olktzqvzkonu branch from c468e80 to 36be579 Compare May 4, 2026 17:35
@steve-chavez

Copy link
Copy Markdown
Member

Clarifying the motivation on #4873

Comment thread CHANGELOG.md Outdated
@mkleczek
mkleczek force-pushed the push-olktzqvzkonu branch 2 times, most recently from 5201ea9 to 82cf2e7 Compare May 4, 2026 18:08
@steve-chavez

Copy link
Copy Markdown
Member

Follow up question on #4873 (comment), not sure if it's correct to do the fix like this.

Comment thread test/io/test_io.py
Comment thread test/io/fixtures/roles.sql Outdated
@mkleczek
mkleczek force-pushed the push-olktzqvzkonu branch 3 times, most recently from 02f8fbc to 4d6a87d Compare May 12, 2026 06:29
@mkleczek

Copy link
Copy Markdown
Collaborator Author

Follow up question on #4873 (comment), not sure if it's correct to do the fix like this.

@steve-chavez - So what's the conclusion after #4873 (comment), #4873 (comment) and all discussions in #4873 ?

Are we going to proceed with this PR?

@steve-chavez

Copy link
Copy Markdown
Member

@mkleczek We need to clarify what are we going to do with the request "waiting" (not sure how to call this) mentioned on #4873 (comment) because there's also a scenario here where we void the schema cache and we force clients to wait while the schema cache is reloaded again. If that "waiting" is useless, let's settle it on #4873 (comment).

@mkleczek
mkleczek force-pushed the push-olktzqvzkonu branch 8 times, most recently from f92122f to 3b60b73 Compare May 20, 2026 10:35
@steve-chavez

steve-chavez commented May 20, 2026

Copy link
Copy Markdown
Member

Now that we clarified the "waiting" was ineffective on #4937, let's proceed with reviewing this.

Comment thread test/io/test_io.py Outdated
@mkleczek
mkleczek force-pushed the push-olktzqvzkonu branch 3 times, most recently from e685d2f to 5f3f373 Compare May 31, 2026 06:04
@mkleczek
mkleczek force-pushed the push-olktzqvzkonu branch 2 times, most recently from 8a684e0 to 0bbfaf9 Compare May 31, 2026 21:32
Comment thread CHANGELOG.md Outdated

@steve-chavez steve-chavez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Only thing missing is addressing the feedback on the CHANGELOG

retryingSchemaCacheLoad should not clear existing schema cache upon failure - there is no reason to do that. If there is a communication issue with the database server or db is down, clients are going to get 502 anyway. If it was a glitch when loading the schema cache - the clients are going to use old (stale) schema cache for some time until next retry re-loads it successfully.
@steve-chavez

Copy link
Copy Markdown
Member

Helped here rebasing and addressing the feedback. Will merge now.

@steve-chavez
steve-chavez merged commit 54430c3 into PostgREST:main Jun 11, 2026
31 checks passed
@taimoorzaeem taimoorzaeem added the no-backport Considered unsafe to backport since it carries a risk of breakage label Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-backport Considered unsafe to backport since it carries a risk of breakage

Development

Successfully merging this pull request may close these issues.

A statement timeout can void the schema cache

5 participants