Skip to content

Commit

Permalink
[UI] EVEREST-898 Added alert warning for PG PITR (#100)
Browse files Browse the repository at this point in the history
* EVEREST-898 Added alert warning for PG pitr

* EVEREST-898 Changed alerts position
  • Loading branch information
filipmikes1 committed Mar 20, 2024
1 parent fdb02b2 commit f3759e4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ export const Messages = {
and the most recent upload of transaction logs (${latestDate})`,
gapDisclaimer: `Oops, your PITR data contains binlog gaps, which makes PITR currently unavailable for this database.
To ensure complete PITR points for future restores, start a full backup now.`,
seeDocs: 'See Documentation',
pitrLimitationAlert:
'In PostgreSQL, point-in-time recovery (PITR) can get stuck in a Restoring state when you attempt to recover the database after the last transaction. Refer to the documentation for a workaround.',
};
19 changes: 19 additions & 0 deletions ui/apps/everest/src/modals/restore-db-modal/restore-db-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ import {
MenuItem,
Typography,
} from '@mui/material';
import { DbType } from '@percona/types';
import {
DateTimePickerInput,
LoadableChildren,
RadioGroup,
SelectInput,
} from '@percona/ui-lib';
import { dbEngineToDbType } from '@percona/utils';
import ActionableAlert from 'components/actionable-alert';
import { FormDialog } from 'components/form-dialog';
import { FormDialogProps } from 'components/form-dialog/form-dialog.types';
import { PITR_DATE_FORMAT } from 'consts';
Expand Down Expand Up @@ -220,6 +223,21 @@ const RestoreDbModal = <T extends FieldValues>({
</FormControl>
) : (
<>
{pitrData &&
DbType.Postresql ===
dbEngineToDbType(dbCluster.spec.engine.type) && (
<ActionableAlert
sx={{ mt: 1.5 }}
message={Messages.pitrLimitationAlert}
buttonMessage={Messages.seeDocs}
buttonProps={{
href: 'https://docs.percona.com/everest/use/createBackups/EnablePITR.html#limitation',
sx: {
whiteSpace: 'nowrap',
},
}}
/>
)}
{pitrData && (
<Alert
sx={{ mt: 1.5, mb: 1.5 }}
Expand All @@ -239,6 +257,7 @@ const RestoreDbModal = <T extends FieldValues>({
)}
</Alert>
)}

{!pitrData?.gaps && (
<DateTimePickerInput
views={[
Expand Down

0 comments on commit f3759e4

Please sign in to comment.