Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title = "How to bypass cooldown period"
topics = [
"platform"
]
keywords = ["cooldown", "disk resize"]
---

This cooldown period isn't a Supabase limitation. It's rooted in how Amazon EBS (the underlying storage instance for our databases) manages volume modifications. After modifying a volume (e.g. increasing size, changing type, or IOPS), AWS enforces a mandatory 6-hour cooldown before allowing another modification on the same volume. This is to ensure data integrity and stability of the volume under load.

From the [**AWS docs**](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyVolume.html):

> “After modifying a volume, you must wait at least six hours and ensure that the volume is in the in-use or available state before you can modify the same volume. This is sometimes referred to as a cooldown period.”

There are a few options to work around the cooldown, depending on the state of your database:

1. **Restore to a new project**: This spins up a new instance with a new disk, bypassing the cooldown entirely. It’s a great option if you're okay with a new project and project refactoring. [**Docs: restoring to a new project**](/docs/guides/platform/backups#restore-to-a-new-project).
2. **pg_upgrade**: Our [**pg_upgrade**](/docs/guides/platform/upgrading) implementation migrates your data to a new disk, which skips the cooldown. The main requirement here is that the database must be operational - it can't run it if your DB is in a degraded or inaccessible state.
3. **Pause and Restore**: This also migrates to a new disk but is only available for projects on the Free plan. If you're not on the Free plan, you'd need to [**transfer your project to an organization on the Free plan**](/docs/guides/platform/project-transfer) first.

If the database is down or locked in a bad state (e.g corrupted or stuck during resize), the only path forward is to wait until the cooldown expires and the disk resize job completes in the queue.

More on this in our doc here: [**https://supabase.com/docs/guides/platform/database-size#disk-size**](/docs/guides/platform/database-size#disk-size).
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
QUEUES_SCHEMA,
useDatabaseQueueToggleExposeMutation,
} from 'data/database-queues/database-queues-toggle-postgrest-mutation'
import { useDatabaseQueuesVersionQuery } from 'data/database-queues/database-queues-version-query'
import { useTableUpdateMutation } from 'data/tables/table-update-mutation'
import { useTablesQuery } from 'data/tables/tables-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
Expand Down Expand Up @@ -78,6 +79,11 @@ export const QueuesSettings = () => {
})
const schemas = config?.db_schema.replace(/ /g, '').split(',') ?? []

const { data: pgmqVersion } = useDatabaseQueuesVersionQuery({
projectRef: project?.ref,
connectionString: project?.connectionString,
})

const { mutateAsync: updateTable } = useTableUpdateMutation()

const { mutate: updatePostgrestConfig } = useProjectPostgrestConfigUpdateMutation({
Expand Down Expand Up @@ -161,12 +167,16 @@ export const QueuesSettings = () => {
`Failed to toggle queue exposure via PostgREST: Unable to retrieve PostgREST configuration (${configError.message})`
)
}
if (!pgmqVersion) {
return toast.error('Unable to retrieve PGMQ version. Please try again later.')
}

setIsToggling(true)
toggleExposeQueuePostgrest({
projectRef: project.ref,
connectionString: project.connectionString,
enable: values.enable,
pgmqVersion,
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,12 @@ const GitHubIntegrationConnectionForm = ({
</Button>
</FormControl_Shadcn_>
</PopoverTrigger_Shadcn_>
<PopoverContent_Shadcn_ className="p-0 w-80" side="bottom" align="start">
<PopoverContent_Shadcn_
portal
className="p-0 w-80"
side="bottom"
align="start"
>
<Command_Shadcn_>
<CommandInput_Shadcn_ placeholder="Search repositories..." />
<CommandList_Shadcn_ className="!max-h-[200px]">
Expand Down
1 change: 1 addition & 0 deletions apps/studio/data/database-queues/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const PGMQ_EXTENSION_NAME = 'pgmq' as const
Loading
Loading