Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
A tablegroup whose shard is bound to an external PostgreSQL is listed with a map from that shard to its connection's name (shardBackingConnections). Read it so the caller can tell a bound tablegroup from a managed one; a multiadmin that does not send it reads as managed. Signed-off-by: Ping-Min Lin <contact@pingminlin.com>
A dynamic tablegroup whose one shard is bound to an external PostgreSQL carries the name of that connection as an annotation, like the rest of the dynamic tablegroup metadata, so there is no CRD change. The TableGroup copies it onto its Shard. Signed-off-by: Ping-Min Lin <contact@pingminlin.com>
…y shard A tablegroup whose shard the catalog binds to an external PostgreSQL does not get the managed shape of the default tablegroup. It gets its one shard, 0-inf, with one pool of one pod in one cell, and none of the PostgreSQL settings, storage or backup the default shard carries. Only the one shard of an unsharded tablegroup can be bound; any other binding is reported and not provisioned. The cell is the first entry of the cells list of the default shard's first pool, taking the pools in name order, and is kept once chosen: a pool cannot change cells, and the pooler must not run in two places. Signed-off-by: Ping-Min Lin <contact@pingminlin.com>
A Shard that carries a backing connection does not run the managed machinery. It runs one multipooler pod, started the way an unmanaged pooler expects to be: its database, tablegroup, shard and catalog id, the shared service set, and the flags to serve and dial with TLS, and none of the flags that describe a PostgreSQL of its own, which the pooler refuses. It is given no connection pool flags, as a managed pooler is not. There is no PostgreSQL, pgctld, volume, backup, exporter or orchestrator, and neither probe depends on the external database. The pooler must never run twice for one external database, and Multigres does not enforce that. A pod that differs from the desired one, is terminal, or is not the one the shard names is deleted, and its replacement is created only once no pod of the shard is left, terminating ones included. A shard that leaves the spec deletes its pod and is ready for deletion when the pod is gone. Signed-off-by: Ping-Min Lin <contact@pingminlin.com>
Describe how a tablegroup bound to an external PostgreSQL is provisioned and where its pooler runs. Signed-off-by: Ping-Min Lin <contact@pingminlin.com>
kabochya
force-pushed
the
feat/bound-tablegroups
branch
from
November 19, 2026 04:51
640af59 to
b170202
Compare
🔬 Go Test Coverage ReportSummary
Status✅ PASS DetailShow New Coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Provisions dynamic tablegroups whose shard the sharding catalog binds to an external PostgreSQL (
CREATE TABLEGROUP name CONNECTION conn). Such a tablegroup gets one Shard,0-inf, that runs a single multipooler pod and nothing else: no PostgreSQL or pgctld, volumes, backups, exporter or orchestrator. The pooler reads its shard's connection from the catalog and serves the external database.Contract, in multigres/multigres:
ListDesiredTableGroupslists the bindings asshardBackingConnections, a map from shard name to connection name. Only the one shard of an unsharded tablegroup can be bound.CREATE TABLEGROUP … CONNECTION.--tablegroup-idand--shardasks the catalog whether its shard is bound, and runs unmanaged if it is.What the operator does
shardBackingConnections. A multiadmin that does not send it reads as managed.{"0-inf": conn}on the layout["0-inf"]is provisioned; any other binding is reported in theDynamicTableGroupscondition and not provisioned. The TableGroup is shaped from the database's default tablegroup like any dynamic one, except that its shard keeps one pool of one pod in one cell and drops the PostgreSQL settings, storage and backup. The TableGroup and its Shard carry the connection's name in the annotationmultigres.com/backing-connection, so there is no CRD change.cellslist of its first pool, with pools taken in name order. A TableGroup keeps its cell once chosen: a pool's cells are append-only, and the pooler must never run in two places.bound-pooler. The pod gets the database, tablegroup, shard and catalog id, the shared service set and the TLS flags. It gets none of the flags that describe a PostgreSQL of its own, which the pooler refuses, and no connection-pool flags: the pooler sizes its pool from the external server'smax_connections. Neither probe depends on the external database.Testing
make testandmake lintpass.Not yet run on a real cluster. That needs:
--enable-tablegroup-ddl, which the operator does not pass yet.