Skip to content

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

Temporarily disable backups and realtime on HA (#47323)

Saxon Fletcher791fa6fa1b34
diff --git a/apps/studio/components/layouts/RealtimeLayout/RealtimeLayout.tsx b/apps/studio/components/layouts/RealtimeLayout/RealtimeLayout.tsx
index c07c63d9345..e2be2602639 100644
--- a/apps/studio/components/layouts/RealtimeLayout/RealtimeLayout.tsx
+++ b/apps/studio/components/layouts/RealtimeLayout/RealtimeLayout.tsx
@@ -1,14 +1,14 @@
import { Realtime } from 'icons'
-import { ExternalLink } from 'lucide-react'
import Head from 'next/head'
import { useRouter } from 'next/router'
import type { PropsWithChildren } from 'react'
-import { Button } from 'ui'
import { ProjectLayout } from '../ProjectLayout'
import { generateRealtimeMenu } from './RealtimeMenu.utils'
+import { HighAvailabilityDisabledEmptyState } from '@/components/ui/HighAvailability/HighAvailabilityDisabledEmptyState'
import { ProductMenu } from '@/components/ui/ProductMenu'
import { ProductMenuShortcuts } from '@/components/ui/ProductMenu/ProductMenuShortcuts'
+import { useHighAvailability } from '@/hooks/misc/useHighAvailability'
import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
import { withAuth } from '@/hooks/misc/withAuth'
@@ -31,11 +31,12 @@ export interface RealtimeLayoutProps {
export const RealtimeLayout = ({ title, children }: PropsWithChildren<RealtimeLayoutProps>) => {
const { data: project } = useSelectedProjectQuery()
+ const { isHighAvailability } = useHighAvailability()
const router = useRouter()
const page = router.pathname.split('/')[4]
const menu = generateRealtimeMenu(project)
- if (!!project?.high_availability) {
+ if (isHighAvailability) {
return (
<>
<Head>
@@ -46,26 +47,11 @@ export const RealtimeLayout = ({ title, children }: PropsWithChildren<RealtimeLa
id="panel-project-content"
className="h-full w-full xl:min-w-[600px] flex items-center justify-center overflow-y-auto overflow-x-hidden bg-dash-sidebar p-6 @container"
>
- <div className="flex max-w-md flex-col items-center gap-y-5 text-center">
- <div className="flex h-12 w-12 items-center justify-center rounded-lg border border-strong bg-surface-100 text-foreground-light">
- <Realtime size={22} strokeWidth={1.5} />
- </div>
- <div className="flex flex-col gap-y-2">
- <h3 className="text-base text-foreground">
- Realtime is not available for High Availability projects
- </h3>
- <p className="text-sm text-foreground-light">
- Realtime is not currently available for projects with High Availability. Reach out
- to our support team if you're interested in using this feature with your High
- Availability project.
- </p>
- </div>
- <Button asChild variant="default" icon={<ExternalLink />}>
- <a href="https://supabase.com/support" target="_blank" rel="noopener noreferrer">
- Contact support
- </a>
- </Button>
- </div>
+ <HighAvailabilityDisabledEmptyState
+ icon={<Realtime size={22} strokeWidth={1.5} />}
+ title="Realtime unavailable on High Availability projects"
+ description="We're working to bring realtime to High Availability projects. Contact support if this is blocking your work."
+ />
</main>
</>
)
diff --git a/apps/studio/pages/project/[ref]/database/backups/pitr.tsx b/apps/studio/pages/project/[ref]/database/backups/pitr.tsx
index f65f79a470b..5dbce70898b 100644
--- a/apps/studio/pages/project/[ref]/database/backups/pitr.tsx
+++ b/apps/studio/pages/project/[ref]/database/backups/pitr.tsx
@@ -1,6 +1,6 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { useParams } from 'common'
-import { AlertCircle } from 'lucide-react'
+import { AlertCircle, DatabaseBackup } from 'lucide-react'
import { Alert, AlertDescription, AlertTitle } from 'ui'
import { Admonition } from 'ui-patterns'
import { PageContainer } from 'ui-patterns/PageContainer'
@@ -21,11 +21,13 @@ import DatabaseLayout from '@/components/layouts/DatabaseLayout/DatabaseLayout'
import DefaultLayout from '@/components/layouts/DefaultLayout'
import AlertError from '@/components/ui/AlertError'
import { DocsButton } from '@/components/ui/DocsButton'
+import { HighAvailabilityDisabledEmptyState } from '@/components/ui/HighAvailability/HighAvailabilityDisabledEmptyState'
import NoPermission from '@/components/ui/NoPermission'
import { UpgradeToPro } from '@/components/ui/UpgradeToPro'
import { useBackupsQuery } from '@/data/database/backups-query'
import { useCheckEntitlements } from '@/hooks/misc/useCheckEntitlements'
import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'
+import { useHighAvailability } from '@/hooks/misc/useHighAvailability'
import { useIsOrioleDbInAws, useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
import { DOCS_URL, PROJECT_STATUS } from '@/lib/constants'
import type { NextPageWithLayout } from '@/types'
@@ -64,7 +66,8 @@ DatabasePhysicalBackups.getLayout = (page) => (
const PITR = () => {
const { ref: projectRef } = useParams()
- const { data: project } = useSelectedProjectQuery()
+ const { data: project, isPending: isProjectPending } = useSelectedProjectQuery()
+ const { isHighAvailability } = useHighAvailability()
const { hasAccess: hasAccessToPitr, isLoading: isLoadingEntitlements } =
useCheckEntitlements('pitr.available_variants')
const isOrioleDbInAws = useIsOrioleDbInAws()
@@ -76,7 +79,7 @@ const PITR = () => {
isSuccess,
} = useBackupsQuery({ projectRef })
- const isLoading = isLoadingBackups || isLoadingEntitlements
+ const isLoading = isLoadingBackups || isLoadingEntitlements || isProjectPending
const isEnabled = backups?.pitr_enabled
const isActiveHealthy = project?.status === PROJECT_STATUS.ACTIVE_HEALTHY
@@ -101,21 +104,23 @@ const PITR = () => {
)
}
- if (project?.high_availability) {
+ if (isLoading) {
+ return <GenericSkeletonLoader />
+ }
+
+ if (isHighAvailability) {
return (
- <Admonition
- type="default"
- title="Database backups are not available for High Availability projects"
- description="High Availability projects do not support Point-in-Time Recovery (PITR) backups"
- >
- <DocsButton abbrev={false} className="mt-2" href={DOCS_URL} />
- </Admonition>
+ <HighAvailabilityDisabledEmptyState
+ icon={DatabaseBackup}
+ title="Point-in-Time Recovery unavailable on High Availability projects"
+ description="We're working to bring point-in-time recovery to High Availability projects. Contact support if this is blocking your work."
+ className="max-w-none mx-0"
+ />
)
}
return (
<>
- {isLoading && <GenericSkeletonLoader />}
{isError && <AlertError error={error} subject="Failed to retrieve PITR backups" />}
{isSuccess && (
<>
@@ -124,7 +129,11 @@ const PITR = () => {
addon={hasAccessToPitr ? 'pitr' : undefined}
source="pitr"
featureProposition="enable Point-in-Time Recovery"
- primaryText="Point in Time Recovery is a Pro Plan add-on"
+ primaryText={
+ hasAccessToPitr
+ ? 'Point in Time Recovery is available as an add-on'
+ : 'Point in Time Recovery is a Pro Plan add-on'
+ }
secondaryText={
!hasAccessToPitr
? 'Roll back your database to a specific second. Starts at $100/month. Pro Plan already includes daily backups at no extra cost.'