The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
[MUL-1364] fix(studio): use multipooler copy for dedicated pooler chart on HA (#49525)
Alaister Young23949ae6339d
diff --git a/apps/studio/data/reports/database-charts.test.ts b/apps/studio/data/reports/database-charts.test.tsindex 242259bfc00..1fdf6e2c06b 100644--- a/apps/studio/data/reports/database-charts.test.ts+++ b/apps/studio/data/reports/database-charts.test.ts@@ -3,16 +3,51 @@ import { describe, expect, it } from 'vitest'import { getReportAttributesV2 } from './database-charts'import { Project } from '@/data/projects/project-detail-query'-const buildProject = (overrides: Partial<Project> = {}) =>- ({- infra_compute_size: 'micro',- high_availability: false,- ...overrides,- }) as Project+const PROJECT: Project = {+ cloud_provider: 'AWS',+ connectionString: 'postgresql://postgres:[email protected]:5432/postgres',+ db_host: 'db.project-ref.supabase.co',+ dbVersion: 'supabase-postgres-15.1.0',+ high_availability: false,+ id: 1,+ infra_compute_size: 'micro',+ inserted_at: '2026-01-01T00:00:00.000Z',+ integration_source: null,+ is_branch_enabled: false,+ is_physical_backups_enabled: false,+ name: 'Production',+ organization_id: 1,+ ref: 'project-ref',+ region: 'us-east-1',+ restUrl: 'https://project-ref.supabase.co',+ status: 'ACTIVE_HEALTHY',+ subscription_id: 'subscription-1',+ updated_at: '2026-01-01T00:00:00.000Z',+}++const ENTITLED_FEATURES = ['database']++const buildProject = (overrides: Partial<Project> = {}): Project => ({ ...PROJECT, ...overrides })++const getDedicatedPoolerChart = (project: Project) => {+ const chart = getReportAttributesV2(ENTITLED_FEATURES, project).find(+ (attribute) => attribute.id === 'pgbouncer-connections'+ )+ if (!chart) throw new Error('Expected the dedicated pooler chart to exist')+ return chart+}++const getClientConnectionsAttribute = (chart: ReturnType<typeof getDedicatedPoolerChart>) => {+ const attribute = chart.attributes?.find(+ (attr) => attr !== false && attr.attribute === 'client_connections_pgbouncer'+ )+ if (!attribute) throw new Error('Expected the client connections attribute to exist')+ return attribute+}const getBurstBalanceChart = (project: Project, showDiskIOBurstBalanceChart = true) =>getReportAttributesV2(- [],+ ENTITLED_FEATURES,project,undefined,undefined,@@ -21,6 +56,27 @@ const getBurstBalanceChart = (project: Project, showDiskIOBurstBalanceChart = trshowDiskIOBurstBalanceChart).find((chart) => chart.id === 'disk-io-burst-balance')+describe('getReportAttributesV2 dedicated pooler chart', () => {+ it('uses PgBouncer copy and links to the docs for standard projects', () => {+ const chart = getDedicatedPoolerChart(buildProject())+ const attribute = getClientConnectionsAttribute(chart)++ expect(chart.titleTooltip).toBeUndefined()+ expect(chart.docsUrl).toContain('/guides/platform/compute-and-disk#limits-and-constraints')+ expect(attribute).toMatchObject({ label: 'pgbouncer', tooltip: 'PgBouncer connections' })+ })++ it('uses multipooler copy and drops the docs link for High Availability projects', () => {+ const chart = getDedicatedPoolerChart(buildProject({ high_availability: true }))+ const attribute = getClientConnectionsAttribute(chart)++ expect(chart.docsUrl).toBeUndefined()+ expect(chart.titleTooltip).toContain('multipooler')+ expect(chart.titleTooltip).toContain('docs coming soon')+ expect(attribute).toMatchObject({ label: 'multipooler', tooltip: 'Multipooler connections' })+ })+})+describe('getReportAttributesV2 disk-io-burst-balance chart', () => {it('shows the chart for burstable non high availability projects', () => {expect(getBurstBalanceChart(buildProject())?.hide).toBe(false)diff --git a/apps/studio/data/reports/database-charts.ts b/apps/studio/data/reports/database-charts.tsindex 8b12d95e849..0615d1f7052 100644--- a/apps/studio/data/reports/database-charts.ts+++ b/apps/studio/data/reports/database-charts.ts@@ -33,6 +33,9 @@ export const getReportAttributesV2: (showMemoryCommitmentChart) => {const computeVariantId = mapComputeSizeNameToAddonVariantId(project?.infra_compute_size)+ // High Availability projects run Multigres, whose dedicated pooler is multipooler rather+ // than PgBouncer. Multipooler docs aren't published yet, so the docs link is dropped for now.+ const isHighAvailability = resolveHighAvailability(project)const provisionedDiskIops = diskConfig?.attributes?.iopsconst computeIopsLimit = COMPUTE_MAX_IOPS[computeVariantId]const effectiveMaxIops =@@ -44,7 +47,7 @@ export const getReportAttributesV2: (const showBurstBalanceChart =!!showDiskIOBurstBalanceChart &&hasBurstableIO(project?.infra_compute_size) &&- !resolveHighAvailability(project)+ !isHighAvailabilityconst baselineThroughputMBps = COMPUTE_DISK[computeVariantId]?.baselineThroughputMBpsconst baselineThroughputLabel =typeof baselineThroughputMBps === 'number' ? `${baselineThroughputMBps} MB/s` : 'its baseline'@@ -508,13 +511,18 @@ export const getReportAttributesV2: (YAxisProps: { width: 30 },hideChartType: false,defaultChartStyle: 'bar',- docsUrl: `${DOCS_URL}/guides/platform/compute-and-disk#limits-and-constraints`,+ titleTooltip: isHighAvailability+ ? 'Client connections to multipooler, the dedicated pooler for High Availability projects (docs coming soon)'+ : undefined,+ docsUrl: isHighAvailability+ ? undefined+ : `${DOCS_URL}/guides/platform/compute-and-disk#limits-and-constraints`,attributes: [{attribute: 'client_connections_pgbouncer',provider: 'infra-monitoring',- label: 'pgbouncer',- tooltip: 'PgBouncer connections',+ label: isHighAvailability ? 'multipooler' : 'pgbouncer',+ tooltip: isHighAvailability ? 'Multipooler connections' : 'PgBouncer connections',},{attribute: 'pg_pooler_max_connections',