Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Small RR fixes (#26739)

Joshen Limdd7c1d19edee
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx
index a644c175957..382901b251f 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx
@@ -84,14 +84,18 @@ const DeployNewReplicaPanel = ({
const reachedMaxReplicas = (data ?? []).filter((db) => db.identifier !== projectRef).length >= 2
const isFreePlan = subscription?.plan.id === 'free'
+ const isAWSProvider = project?.cloud_provider === 'AWS'
const isWalgEnabled = project?.is_physical_backups_enabled
const currentComputeAddon = addons?.selected_addons.find(
(addon) => addon.type === 'compute_instance'
)
+ const isMinimallyOnSmallCompute =
+ currentComputeAddon?.variant.identifier !== undefined &&
+ currentComputeAddon?.variant.identifier !== 'ci_micro'
const canDeployReplica =
!reachedMaxReplicas &&
currentPgVersion >= 15 &&
- project?.cloud_provider === 'AWS' &&
+ isAWSProvider &&
!isFreePlan &&
isWalgEnabled &&
currentComputeAddon !== undefined
@@ -148,23 +152,18 @@ const DeployNewReplicaPanel = ({
header="Deploy a new read replica"
>
<SidePanel.Content className="flex flex-col py-4 gap-y-4">
- {currentComputeAddon === undefined && (
+ {!isAWSProvider ? (
<Alert_Shadcn_>
<WarningIcon />
<AlertTitle_Shadcn_>
- Project required to at least be on a Small compute
+ Read replicas are only supported for projects provisioned via AWS
</AlertTitle_Shadcn_>
<AlertDescription_Shadcn_>
<span>
- This is to ensure that read replicas can keep up with the primary databases'
- activities.
+ Projects provisioned by other cloud providers currently will not be able to use read
+ replicas
</span>
- <div className="flex items-center gap-x-2 mt-3">
- <Button asChild type="default">
- <Link href={`/project/${projectRef}/settings/addons?panel=computeInstance`}>
- Change compute size
- </Link>
- </Button>
+ <div className="mt-3">
<Button asChild type="default" icon={<ExternalLink size={14} />}>
<a
href="https://supabase.com/docs/guides/platform/read-replicas#prerequisites"
@@ -177,106 +176,127 @@ const DeployNewReplicaPanel = ({
</div>
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
- )}
-
- {!isWalgEnabled && (
- <Alert_Shadcn_>
- <WarningIcon />
- <AlertTitle_Shadcn_>
- {refetchInterval !== false
- ? 'Physical backups are currently being enabled'
- : 'Physical backups are required to deploy replicas'}
- </AlertTitle_Shadcn_>
- {refetchInterval === false && (
- <AlertDescription_Shadcn_ className="mb-2">
- Physical backups are used under the hood to spin up read replicas for your project.
- </AlertDescription_Shadcn_>
- )}
- <AlertDescription_Shadcn_>
- {refetchInterval !== false
- ? 'This warning will go away once physical backups have been enabled - check back in a few minutes!'
- : 'Enabling physical backups will take a few minutes, after which you will be able to deploy read replicas.'}
- </AlertDescription_Shadcn_>
- {refetchInterval !== false ? (
- <AlertDescription_Shadcn_ className="mt-2">
- You may start deploying read replicas thereafter once this is completed.
- </AlertDescription_Shadcn_>
- ) : (
- <AlertDescription_Shadcn_ className="flex items-center gap-x-2 mt-3">
- <Button
- type="default"
- loading={isEnabling}
- disabled={isEnabling}
- onClick={() => {
- if (projectRef) enablePhysicalBackups({ ref: projectRef })
- }}
- >
- Enable physical backups
- </Button>
- <Button asChild type="default" icon={<ExternalLink size={14} />}>
- <a
- href="https://supabase.com/docs/guides/platform/read-replicas#how-are-read-replicas-made"
- target="_blank"
- rel="noreferrer"
- >
- Documentation
- </a>
- </Button>
- </AlertDescription_Shadcn_>
+ ) : (
+ <>
+ {!isWalgEnabled && (
+ <Alert_Shadcn_>
+ <WarningIcon />
+ <AlertTitle_Shadcn_>
+ {refetchInterval !== false
+ ? 'Physical backups are currently being enabled'
+ : 'Physical backups are required to deploy replicas'}
+ </AlertTitle_Shadcn_>
+ {refetchInterval === false && (
+ <AlertDescription_Shadcn_ className="mb-2">
+ Physical backups are used under the hood to spin up read replicas for your
+ project.
+ </AlertDescription_Shadcn_>
+ )}
+ <AlertDescription_Shadcn_>
+ {refetchInterval !== false
+ ? 'This warning will go away once physical backups have been enabled - check back in a few minutes!'
+ : 'Enabling physical backups will take a few minutes, after which you will be able to deploy read replicas.'}
+ </AlertDescription_Shadcn_>
+ {refetchInterval !== false ? (
+ <AlertDescription_Shadcn_ className="mt-2">
+ You may start deploying read replicas thereafter once this is completed.
+ </AlertDescription_Shadcn_>
+ ) : (
+ <AlertDescription_Shadcn_ className="flex items-center gap-x-2 mt-3">
+ <Button
+ type="default"
+ loading={isEnabling}
+ disabled={isEnabling}
+ onClick={() => {
+ if (projectRef) enablePhysicalBackups({ ref: projectRef })
+ }}
+ >
+ Enable physical backups
+ </Button>
+ <Button asChild type="default" icon={<ExternalLink size={14} />}>
+ <a
+ href="https://supabase.com/docs/guides/platform/read-replicas#how-are-read-replicas-made"
+ target="_blank"
+ rel="noreferrer"
+ >
+ Documentation
+ </a>
+ </Button>
+ </AlertDescription_Shadcn_>
+ )}
+ </Alert_Shadcn_>
)}
- </Alert_Shadcn_>
- )}
- {reachedMaxReplicas && (
- <Alert_Shadcn_>
- <WarningIcon />
- <AlertTitle_Shadcn_>
- You can only deploy up to 2 read replicas at once
- </AlertTitle_Shadcn_>
- <AlertDescription_Shadcn_>
- If you'd like to spin up another read replica, please drop an existing replica first.
- </AlertDescription_Shadcn_>
- </Alert_Shadcn_>
- )}
+ {!isMinimallyOnSmallCompute && (
+ <Alert_Shadcn_>
+ <WarningIcon />
+ <AlertTitle_Shadcn_>
+ Project required to at least be on a Small compute
+ </AlertTitle_Shadcn_>
+ <AlertDescription_Shadcn_>
+ <span>
+ This is to ensure that read replicas can keep up with the primary databases'
+ activities.
+ </span>
+ <div className="flex items-center gap-x-2 mt-3">
+ <Button asChild type="default">
+ <Link href={`/project/${projectRef}/settings/addons?panel=computeInstance`}>
+ Change compute size
+ </Link>
+ </Button>
+ <Button asChild type="default" icon={<ExternalLink size={14} />}>
+ <a
+ href="https://supabase.com/docs/guides/platform/read-replicas#prerequisites"
+ target="_blank"
+ rel="noreferrer"
+ >
+ Documentation
+ </a>
+ </Button>
+ </div>
+ </AlertDescription_Shadcn_>
+ </Alert_Shadcn_>
+ )}
- {/* [Joshen] Not particular about this warning as all users on prod are on AWS */}
- {project?.cloud_provider !== 'AWS' && (
- <Alert_Shadcn_>
- <WarningIcon />
- <AlertTitle_Shadcn_>
- Read replicas can only be deployed with projects on AWS
- </AlertTitle_Shadcn_>
- <AlertDescription_Shadcn_>
- If you'd like to use read replicas, please migrate your project to AWS by creating a
- new one.
- </AlertDescription_Shadcn_>
- </Alert_Shadcn_>
- )}
+ {reachedMaxReplicas && (
+ <Alert_Shadcn_>
+ <WarningIcon />
+ <AlertTitle_Shadcn_>
+ You can only deploy up to 2 read replicas at once
+ </AlertTitle_Shadcn_>
+ <AlertDescription_Shadcn_>
+ If you'd like to spin up another read replica, please drop an existing replica
+ first.
+ </AlertDescription_Shadcn_>
+ </Alert_Shadcn_>
+ )}
- {currentPgVersion < 15 && (
- <Alert_Shadcn_>
- <WarningIcon />
- <AlertTitle_Shadcn_>
- Read replicas can only be deployed with projects on Postgres version 15 and above
- </AlertTitle_Shadcn_>
- <AlertDescription_Shadcn_>
- If you'd like to use read replicas, please contact us via support
- </AlertDescription_Shadcn_>
- <AlertDescription_Shadcn_ className="mt-2">
- <Button type="default">
- <Link
- href={`/support/new?category=Sales&ref=${projectRef}&subject=Enquiry%20on%20read%20replicas&message=Project%20DB%20version:%20${project?.dbVersion}`}
- target="_blank"
- rel="noreferrer"
- >
- Contact support
- </Link>
- </Button>
- </AlertDescription_Shadcn_>
- </Alert_Shadcn_>
+ {currentPgVersion < 15 && (
+ <Alert_Shadcn_>
+ <WarningIcon />
+ <AlertTitle_Shadcn_>
+ Read replicas can only be deployed with projects on Postgres version 15 and above
+ </AlertTitle_Shadcn_>
+ <AlertDescription_Shadcn_>
+ If you'd like to use read replicas, please contact us via support
+ </AlertDescription_Shadcn_>
+ <AlertDescription_Shadcn_ className="mt-2">
+ <Button type="default">
+ <Link
+ href={`/support/new?category=Sales&ref=${projectRef}&subject=Enquiry%20on%20read%20replicas&message=Project%20DB%20version:%20${project?.dbVersion}`}
+ target="_blank"
+ rel="noreferrer"
+ >
+ Contact support
+ </Link>
+ </Button>
+ </AlertDescription_Shadcn_>
+ </Alert_Shadcn_>
+ )}
+ </>
)}
- <div className="flex flex-col gap-y-8">
+ <div className="flex flex-col gap-y-6 mt-2">
<Listbox
size="small"
id="region"
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.utils.ts b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.utils.ts
index d2fe89f4226..757ab7b6488 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.utils.ts
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.utils.ts
@@ -58,7 +58,7 @@ export const generateNodes = ({
type: 'PRIMARY',
data: {
id: primary.identifier,
- region: primaryRegion,
+ region: primaryRegion ?? { name: primary.region },
provider: primary.cloud_provider,
inserted_at: primary.inserted_at,
computeSize: primary.size,