Skip to content

fix(multipooler): read cached copy of pooler topo#243

Merged
cuongdo merged 4 commits intomultigres:mainfrom
cuongdo:multipooler-backup-followups
Nov 17, 2025
Merged

fix(multipooler): read cached copy of pooler topo#243
cuongdo merged 4 commits intomultigres:mainfrom
cuongdo:multipooler-backup-followups

Conversation

@cuongdo
Copy link
Copy Markdown
Contributor

@cuongdo cuongdo commented Nov 14, 2025

follow up to:
#226 (comment)

Also added some of the configs from the Supabase pgBackRest config supabase/postgres#1878

follow up for:
multigres#226 (comment)

Also added some of the configs from the Supabase pgBackRest config
supabase/postgres#1878

Signed-off-by: Cuong Do <cuongdo@users.noreply.github.com>
Comment thread go/multipooler/manager/manager.go Outdated
defer pm.mu.Unlock()
if pm.multipooler != nil && pm.multipooler.MultiPooler != nil {
return pm.multipooler.TableGroup
// getCachedTableGroup returns the table group from the multipooler record
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.

I wonder whether we should keep the original names for these functions. Putting Cached in the name makes it very explicit that we aren't touching the "real" object, but the fact that it is cached should be an internal implementation detail that is not exposed to callers. As far as callers are concerned, they ask MultiPoolerManager for its TableGroup / Shard / PoolerType and they get whatever it gives them.
Eventually we might also have to make these functions exported, because not all manager code will live in the manager package. But that is something we can do when the time comes.

Copy link
Copy Markdown
Contributor

@rafael rafael left a comment

Choose a reason for hiding this comment

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

LGTM. Addressing Deepthi's comment makes sense to me

Signed-off-by: Cuong Do <cuongdo@users.noreply.github.com>
Restore wasn't handling the dead DB connections left behind by its
stopping/restarting Postgres. However, this raises the question of how
resilient multipooler.Executor needs to be in this situation.

Signed-off-by: Cuong Do <cuongdo@users.noreply.github.com>
orch should detect this and initiate fix

Signed-off-by: Cuong Do <cuongdo@users.noreply.github.com>
@cuongdo cuongdo force-pushed the multipooler-backup-followups branch from d0eeaa4 to 88ef130 Compare November 17, 2025 16:30
@cuongdo
Copy link
Copy Markdown
Contributor Author

cuongdo commented Nov 17, 2025

@deepthi & @rafael thanks for your reviews!

I've removed the Cached part of the pooler manager getter functions. I've also pushed code that fixed e2e tests that were routinely failing in CI. Test cleanup in setupPoolerTest() was trying to restore GUCs and failing, because the pooler executor tried to execute the cleanup queries on a dead Postgres connection. I've made Restore Close()/Open() the pooler manager to get rid of the dead connections.

However, on further reflection, this shouldn't be necessary. The connection pool should be more resilient. I can fix that in a separate PR.

@cuongdo cuongdo merged commit 3fdf8eb into multigres:main Nov 17, 2025
6 checks passed
@cuongdo cuongdo deleted the multipooler-backup-followups branch November 17, 2025 18:59
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.

3 participants