Обсуждение: [pgbackrest] Expiring the last backup?

Поиск
Список
Период
Сортировка

[pgbackrest] Expiring the last backup?

От
Ron
Дата:
Hi,

The backups partition is running out of disk space, and I need to delete the 
only backup.

$ pgbackrest expire --stanza=localhost --retention-full=0
ERROR: [032]: '0' is out of range for 'repo1-retention-full' option

So, in version 2.07, what's the secret sauce for deleting that final copy?

(Yes, we're getting more disk space, but that takes time.)

-- 
Angular momentum makes the world go 'round.


Re: [pgbackrest] Expiring the last backup?

От
Stephen Frost
Дата:
Greetings,

* Ron (ronljohnsonjr@gmail.com) wrote:
> The backups partition is running out of disk space, and I need to delete the
> only backup.
>
> $ pgbackrest expire --stanza=localhost --retention-full=0
> ERROR: [032]: '0' is out of range for 'repo1-retention-full' option

Yeah, pgbackrest doesn't ever really think you want to get rid of *all*
of your backups. :)

> So, in version 2.07, what's the secret sauce for deleting that final copy?

If this is the only backup and the only cluster being backed up into
that repository, you could just nuke the whole repo and recreate it with
stanza-create once you're ready to have backups again..

Thanks!

Stephen

Вложения

Re: [pgbackrest] Expiring the last backup?

От
Ron
Дата:
On 1/24/19 7:26 AM, Stephen Frost wrote:
Greetings,

* Ron (ronljohnsonjr@gmail.com) wrote:
The backups partition is running out of disk space, and I need to delete the
only backup.

$ pgbackrest expire --stanza=localhost --retention-full=0
ERROR: [032]: '0' is out of range for 'repo1-retention-full' option
Yeah, pgbackrest doesn't ever really think you want to get rid of *all*
of your backups. :)

It's rare, but is occasionally needed.

So, in version 2.07, what's the secret sauce for deleting that final copy?
If this is the only backup and the only cluster being backed up into
that repository, you could just nuke the whole repo and recreate it with
stanza-create once you're ready to have backups again..

That occurred to me while lying in bed.  Use "stanza-delete"?

--
Angular momentum makes the world go 'round.

Re: [pgbackrest] Expiring the last backup?

От
Stephen Frost
Дата:
Greetings,

* Ron (ronljohnsonjr@gmail.com) wrote:
> On 1/24/19 7:26 AM, Stephen Frost wrote:
> >* Ron (ronljohnsonjr@gmail.com) wrote:
> >>The backups partition is running out of disk space, and I need to delete the
> >>only backup.
> >>
> >>$ pgbackrest expire --stanza=localhost --retention-full=0
> >>ERROR: [032]: '0' is out of range for 'repo1-retention-full' option
> >Yeah, pgbackrest doesn't ever really think you want to get rid of *all*
> >of your backups. :)
>
> It's rare, but *is* occasionally needed.
>
> >>So, in version 2.07, what's the secret sauce for deleting that final copy?
> >If this is the only backup and the only cluster being backed up into
> >that repository, you could just nuke the whole repo and recreate it with
> >stanza-create once you're ready to have backups again..
>
> That occurred to me while lying in bed.  Use "stanza-delete"?

That's another option, though you'll have to use --force unless you're
also shutting PG down.

Thanks!

Stephen

Вложения

Re: [pgbackrest] Expiring the last backup?

От
Ron
Дата:
On 1/24/19 8:11 AM, Stephen Frost wrote:
> Greetings,
>
> * Ron (ronljohnsonjr@gmail.com) wrote:
>> On 1/24/19 7:26 AM, Stephen Frost wrote:
>>> * Ron (ronljohnsonjr@gmail.com) wrote:
>>>> The backups partition is running out of disk space, and I need to delete the
>>>> only backup.
>>>>
>>>> $ pgbackrest expire --stanza=localhost --retention-full=0
>>>> ERROR: [032]: '0' is out of range for 'repo1-retention-full' option
>>> Yeah, pgbackrest doesn't ever really think you want to get rid of *all*
>>> of your backups. :)
>> It's rare, but *is* occasionally needed.
>>
>>>> So, in version 2.07, what's the secret sauce for deleting that final copy?
>>> If this is the only backup and the only cluster being backed up into
>>> that repository, you could just nuke the whole repo and recreate it with
>>> stanza-create once you're ready to have backups again..
>> That occurred to me while lying in bed.  Use "stanza-delete"?
> That's another option,

What's the preferred method?

> though you'll have to use --force unless you're also shutting PG down.

Won't be stopping postgres!!!

Are these the steps, or am I missing something?

$ pgbackrest stop
$ pgbackrest stanza-delete --stanza=mystanza--force



-- 
Angular momentum makes the world go 'round.


Re: [pgbackrest] Expiring the last backup?

От
Stephen Frost
Дата:
Greetings,

* Ron (ronljohnsonjr@gmail.com) wrote:
> On 1/24/19 8:11 AM, Stephen Frost wrote:
> >* Ron (ronljohnsonjr@gmail.com) wrote:
> >>On 1/24/19 7:26 AM, Stephen Frost wrote:
> >>>* Ron (ronljohnsonjr@gmail.com) wrote:
> >>>>The backups partition is running out of disk space, and I need to delete the
> >>>>only backup.
> >>>>
> >>>>$ pgbackrest expire --stanza=localhost --retention-full=0
> >>>>ERROR: [032]: '0' is out of range for 'repo1-retention-full' option
> >>>Yeah, pgbackrest doesn't ever really think you want to get rid of *all*
> >>>of your backups. :)
> >>It's rare, but *is* occasionally needed.
> >>
> >>>>So, in version 2.07, what's the secret sauce for deleting that final copy?
> >>>If this is the only backup and the only cluster being backed up into
> >>>that repository, you could just nuke the whole repo and recreate it with
> >>>stanza-create once you're ready to have backups again..
> >>That occurred to me while lying in bed.  Use "stanza-delete"?
> >That's another option,
>
> What's the preferred method?

Not sure that I have one..

> >though you'll have to use --force unless you're also shutting PG down.
>
> Won't be stopping postgres!!!
>
> Are these the steps, or am I missing something?
>
> $ pgbackrest stop

This probably isn't really necessary.

> $ pgbackrest stanza-delete --stanza=mystanza--force

Well, you'd need a space before --force..

You'll also probably want to adjust your archive_command because
otherwise it'll start failing and that would lead to WAL building up.

Thanks!

Stephen

Вложения

Re: [pgbackrest] Expiring the last backup?

От
David Steele
Дата:
On 1/24/19 5:07 PM, Ron wrote:
> 
> Are these the steps, or am I missing something?
> 
> $ pgbackrest stop
> $ pgbackrest stanza-delete --stanza=mystanza--force

That looks right but no need for --force.  That's what the `stop` is for 
-- to let pgBackRest know you really mean to do this.

See documentation for more information:
https://pgbackrest.org/user-guide.html#delete-stanza

-- 
-David
david@pgmasters.net


Re: [pgbackrest] Expiring the last backup?

От
Ron
Дата:
On 1/24/19 11:22 PM, David Steele wrote:
> On 1/24/19 5:07 PM, Ron wrote:
>>
>> Are these the steps, or am I missing something?
>>
>> $ pgbackrest stop
>> $ pgbackrest stanza-delete --stanza=mystanza--force
>
> That looks right but no need for --force.  That's what the `stop` is for 
> -- to let pgBackRest know you really mean to do this.
>
> See documentation for more information:
> https://pgbackrest.org/user-guide.html#delete-stanza

Turns out that --force was required.  stanza-delete failed, complained that 
the postmaster was running, and told me to use "--force" if I really wanted 
to drop it.


-- 
Angular momentum makes the world go 'round.


Re: [pgbackrest] Expiring the last backup?

От
David Steele
Дата:
On 1/25/19 8:02 AM, Ron wrote:
> On 1/24/19 11:22 PM, David Steele wrote:
>> On 1/24/19 5:07 PM, Ron wrote:
>>>
>>> Are these the steps, or am I missing something?
>>>
>>> $ pgbackrest stop
>>> $ pgbackrest stanza-delete --stanza=mystanza--force
>>
>> That looks right but no need for --force.  That's what the `stop` is 
>> for -- to let pgBackRest know you really mean to do this.
>>
>> See documentation for more information:
>> https://pgbackrest.org/user-guide.html#delete-stanza
> 
> Turns out that --force was required.  stanza-delete failed, complained 
> that the postmaster was running, and told me to use "--force" if I 
> really wanted to drop it.

Whoops -- I guess I should have read the docs, too.  It's very unusual 
to be deleting a stanza for a running cluster and we made it difficult 
on purpose.

-- 
-David
david@pgmasters.net