Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with GC and keeplast -> stuck at the number of snapshots #204

Open
didrocks opened this issue Apr 1, 2021 · 14 comments
Open

Issue with GC and keeplast -> stuck at the number of snapshots #204

didrocks opened this issue Apr 1, 2021 · 14 comments

Comments

@didrocks
Copy link
Member

didrocks commented Apr 1, 2021

Let’s say you hit the upper limit of free space
Then, any snapshot attempt will say, for instance:
ERROR couldn't save system state: Minimum free space to take a snapshot and preserve ZFS performance is 20%. Free space on pool "bpool" is 14%.

That’s ok, but let’s say you hit this threshold with the minimum of snapshots to keep (like 20), then you are stuck:

  • gc will never clean anything as you have 20 snapshots (the minimal number of snapshots)
  • no new snapshots will be taken as your disk is almost full.

We need to define and implement a strategy.

@Lockszmith-GH
Copy link

What about an option to clean 'everything' except the most recent snapshot?
Something that will need to be run manually, but when the error shows up in zsys operation, a recommendation to use that brute-force cleaning command can show up as a hint.

@didrocks
Copy link
Member Author

didrocks commented Apr 6, 2021

That’s a good idea, but I think we need to find a strategy that is as automated as possible. However, the 2 proposals are not incompatible :)

@Lockszmith-GH
Copy link

Speaking form experience of dealing with customers who let their SQL DBs run out of disk space - there isn't much you can do without disk space, except note that you've run out of it, and operations can resume when disk space is restored.

One possibility is to set a threshold of required free space, which will fail zsys snapshotting operations unless disk space is freed.
I doubt continuing to snapshot or removing old snapshots automatically because space has run out would be acceptable to everyone.
Failing, with a clear message of why we're failing - should allow action to be taken, but wont do anything drastic that would piss of some users.

@didrocks
Copy link
Member Author

didrocks commented Apr 7, 2021

One possibility is to set a threshold of required free space, which will fail zsys snapshotting operations unless disk space is freed.
This is already what happens here.

The issue described here is that if the disk space is taken by the minimal amount of snapshots to keep (20 in the default), then, nothing can happen:

  • GC is blocked, as it wants to keep this minimal amount of snapshots, whenever old there are
  • As you reached the limit, no more newer snapshots are taken, and so the list of minimal amount of snapshots stays the same

So, nothing is collected, nothing new is created. I think we can push the GC or make it more agressive with decaying snapshots in that situation (with a manual user interaction, ofc)

@versus167
Copy link

Perhaps a time component should also come into play when deleting snapshots.

For example, snapshots could still be deleted under the following condition:

Free disk space < 20%, there are less than 21 snapshots -> Delete the oldest snapshot if it is older than 30 days (for example).

This brings a time component into play. At least we get out of the deadlock over time. But it also doesn't blanket delete everything immediately.

@Lockszmith-GH
Copy link

If I understand this correctly, the problem is reduced space is causing zsys to stop snapshotting.

Theoretically, releasing an old snapshot will effectively release 'some' space, the question is how much space is enough.

One option could be a cleanup-size-threshold, which means:

  • if we're running out of space, a pre-set number of MB will need to be released by old snapshots.
  • I would suggest to add a safety of minimum-no-of-snapshots or an minimum-age (like @versus167 suggested) to preserve.
  • How to release? probably the safest would be to release snapshots from old to new, and test free-space after each release.

I would strongly argue this shouldn't be part of the GC's automatic behavior, but must be invoked by the user.
A hint to the action could be specified in the logs, and if it is decided this will be automatic by the GC, a switch should be opt-in (default will be off for the feature out-of-the-box).

@didrocks
Copy link
Member Author

I would suggest to add a safety of minimum-no-of-snapshots or an minimum-age (like @versus167 suggested) to preserve.
This is exactly the issue: there are a minimum age and a minimum of snapshots. The issue is that people (like I did using the development release) having the bare minimum of snapshots (20 by defaults) but still reaching 80% of bpool usage.

We can’t decide automatically to remove the oldest snapshots:

  • this is not necessarily the snapshots that will free of most spaces (even if there are great chances in the general case)
  • what if you want to keep a very old snapshot (manual) like after installation + some customization? Oldest is not necessarily the least interesting.

I agree that those decisions should not be automatic. There is already a hint in the message to free up manually (with zsysctl save remove snapshots. Once we have some time working on this again, we want to show up exactly what snapshots takes X amount of space, but ZFS doesn’t help at all giving this info (you have to diff multiple states for this). Then, we can suggest which snapshots to delete to the user.
Also, it seems most of this issue is coming from bpool anyway. Increasing its size to 3Gb can make more sense…

@versus167
Copy link

We can’t decide automatically to remove the oldest snapshots:

  • this is not necessarily the snapshots that will free of most spaces (even if there are great chances in the general case)
  • what if you want to keep a very old snapshot (manual) like after installation + some customization? Oldest is not necessarily the least interesting.

I agree that those decisions should not be automatic. There is already a hint in the message to free up manually (with zsysctl save remove snapshots. Once we have some time working on this again, we want to show up exactly what snapshots takes X amount of space, but ZFS doesn’t help at all giving this info (you have to diff multiple states for this). Then, we can suggest which snapshots to delete to the user.

In ZFS I can set a snapshot to hold. This way it cannot be deleted by mistake.

The same principle should apply in zsys. I should be able to put certain states on hold and the rest may be deleted according to the rules.

Currently the automatic rules lead to the described dead-lock. It is imperative to avoid this.

@Lockszmith-GH
Copy link

Both excellent points.
Combining the holding option with a utility to report which snapshot costs the most space is probably the way to go.

@dcarosone
Copy link

ZFS doesn’t help at all giving this info (you have to diff multiple states for this)

Not (quite) true. ZFS shows you exactly what each snapshot takes, by itself. Deleting this (single) snapshot will free the space unique to that snapshot. What's harder is figuring out which range of snapshots share what amount of space, such that deleting the fewest adjacent ones can free the most amount of space. For this, you can get some information from the 'written' property. After that, in modern ZFS the send space estimator is pretty usable. This does come down to "diffing multiple states", but it at least somewhat less intricate. However, I agree that admin intervention and policy is probably required before this point.

As for age, I agree that oldest is not necessarily best / most desirable. A strategy of "thinning" could help: find the two snapshots closest together in time, and remove the one that has the closer neighbour on the opposite side (or the one with the most unique space). Also, zsysd seems to have some properties that mark successful vs unsuccessful boots, and last booted time, which could factor in for candidate selection

Using (and paying attention to) ZFS holds is absolutely the right way to go, as this is a mechanism that can be shared between multiple parties, including backup/replication tools and the admin's manual choices.

@pjgoodall
Copy link

Where can I have a current discussion on getting to a work-around for this problem?
I try deleting a many snapshots as I can, and I still have the problem.
I'd even go for a current snapshot and delete the rest, but cant find any recent discussion.

Thanks...

@didrocks
Copy link
Member Author

Don’t remove individual datasets but remove rather states: https://didrocks.fr/2020/06/02/zfs-focus-on-ubuntu-20.04-lts-zsys-commands-for-state-management/.
Once you removed enough states, (especially the system states which will impact bpool).

The other way is to change the keeplast property to a small value by creating a configuration file for state GC:
https://didrocks.fr/2020/06/04/zfs-focus-on-ubuntu-20.04-lts-zsys-state-collection/.

@pjgoodall
Copy link

pjgoodall commented May 28, 2021

apologies, I'm meaning states when I say snapshots. I've spent more time with zfs - I was referring to zsysctl 'states'

I have tried removing a lot of zsysctl states which has no effect. Here is the output of zsysctl gc --all vv

level=debug msg="/zsys.Zsys/GC() call logged as [0138a04e:2c3edd85]"
�[37mDEBUG�[0m Check if grpc request peer is authorized     
�[37mDEBUG�[0m Any user always authorized                   
�[36mINFO�[0m Requesting zsys daemon to garbage collect    
�[37mDEBUG�[0m calculating buckets                          
�[37mDEBUG�[0m bucket keep all: start:2021-05-27 00:00:00 +1000 AEST, end:2021-05-28 16:26:33.035364912 +1000 AEST m=+0.655519624, samples:-1 
�[37mDEBUG�[0m Rule PreviousDay, buckets: 1, length, 1      
�[37mDEBUG�[0m   -  start:2021-05-26 00:00:00 +1000 AEST end:2021-05-27 00:00:00 +1000 AEST samples:3 
�[37mDEBUG�[0m Rule PreviousWeek, buckets: 5, length, 1     
�[37mDEBUG�[0m   -  start:2021-05-25 00:00:00 +1000 AEST end:2021-05-26 00:00:00 +1000 AEST samples:1 
�[37mDEBUG�[0m   -  start:2021-05-24 00:00:00 +1000 AEST end:2021-05-25 00:00:00 +1000 AEST samples:1 
�[37mDEBUG�[0m   -  start:2021-05-23 00:00:00 +1000 AEST end:2021-05-24 00:00:00 +1000 AEST samples:1 
�[37mDEBUG�[0m   -  start:2021-05-22 00:00:00 +1000 AEST end:2021-05-23 00:00:00 +1000 AEST samples:1 
�[37mDEBUG�[0m   -  start:2021-05-21 00:00:00 +1000 AEST end:2021-05-22 00:00:00 +1000 AEST samples:1 
�[37mDEBUG�[0m Rule PreviousMonth, buckets: 4, length, 7    
�[37mDEBUG�[0m   -  start:2021-05-14 00:00:00 +1000 AEST end:2021-05-21 00:00:00 +1000 AEST samples:1 
�[37mDEBUG�[0m   -  start:2021-05-07 00:00:00 +1000 AEST end:2021-05-14 00:00:00 +1000 AEST samples:1 
�[37mDEBUG�[0m   -  start:2021-04-30 00:00:00 +1000 AEST end:2021-05-07 00:00:00 +1000 AEST samples:1 
�[37mDEBUG�[0m   -  start:2021-04-23 00:00:00 +1000 AEST end:2021-04-30 00:00:00 +1000 AEST samples:1 
�[37mDEBUG�[0m bucket oldest: start:0001-01-01 00:00:00 +0000 UTC end:2021-04-23 00:00:00 +1000 AEST samples:0 
�[37mDEBUG�[0m Collect datasets                             
�[37mDEBUG�[0m GC System Pass #1                            
�[37mDEBUG�[0m bucket start: 2021-05-27 00:00:00 end:2021-05-28 16:26:33 samples: -1 
�[37mDEBUG�[0m current state: rpool/ROOT/ubuntu_g3snm5@autozsys_5mfxzy 
�[37mDEBUG�[0m state.LastUsed (2021-05-12 11:54:08) before bucket.start (2021-05-27 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-26 00:00:00 end:2021-05-27 00:00:00 samples: 3 
�[37mDEBUG�[0m current state: rpool/ROOT/ubuntu_g3snm5@autozsys_5mfxzy 
�[37mDEBUG�[0m state.LastUsed (2021-05-12 11:54:08) before bucket.start (2021-05-26 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-25 00:00:00 end:2021-05-26 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/ROOT/ubuntu_g3snm5@autozsys_5mfxzy 
�[37mDEBUG�[0m state.LastUsed (2021-05-12 11:54:08) before bucket.start (2021-05-25 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-24 00:00:00 end:2021-05-25 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/ROOT/ubuntu_g3snm5@autozsys_5mfxzy 
�[37mDEBUG�[0m state.LastUsed (2021-05-12 11:54:08) before bucket.start (2021-05-24 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-23 00:00:00 end:2021-05-24 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/ROOT/ubuntu_g3snm5@autozsys_5mfxzy 
�[37mDEBUG�[0m state.LastUsed (2021-05-12 11:54:08) before bucket.start (2021-05-23 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-22 00:00:00 end:2021-05-23 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/ROOT/ubuntu_g3snm5@autozsys_5mfxzy 
�[37mDEBUG�[0m state.LastUsed (2021-05-12 11:54:08) before bucket.start (2021-05-22 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-21 00:00:00 end:2021-05-22 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/ROOT/ubuntu_g3snm5@autozsys_5mfxzy 
�[37mDEBUG�[0m state.LastUsed (2021-05-12 11:54:08) before bucket.start (2021-05-21 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-14 00:00:00 end:2021-05-21 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/ROOT/ubuntu_g3snm5@autozsys_5mfxzy 
�[37mDEBUG�[0m state.LastUsed (2021-05-12 11:54:08) before bucket.start (2021-05-14 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-07 00:00:00 end:2021-05-14 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/ROOT/ubuntu_g3snm5@autozsys_5mfxzy 
�[37mDEBUG�[0m First state matching for this bucket: rpool/ROOT/ubuntu_g3snm5@autozsys_cig1rh (2021-05-07 14:34:07) 
�[37mDEBUG�[0m Collecting all states for current bucket     
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_5mfxzy: 2021-05-12 11:54:08 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_5mfxzy as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_rusfce: 2021-05-12 11:54:08 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_rusfce as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_cig1rh: 2021-05-07 14:34:07 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_cig1rh as it's in the last 20 snapshots 
�[37mDEBUG�[0m There are 2 exceeding states to potentially remove 
�[37mDEBUG�[0m selecting list of states to remove           
�[37mDEBUG�[0m Interval: 1620362047.00 - 1620784448.00      
�[37mDEBUG�[0m bucket is full, removing all non-keep states 
�[37mDEBUG�[0m bucket start: 2021-04-30 00:00:00 end:2021-05-07 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/ROOT/ubuntu_g3snm5@autozsys_yacith 
�[37mDEBUG�[0m First state matching for this bucket: rpool/ROOT/ubuntu_g3snm5@autozsys_3n659l (2021-05-04 11:14:41) 
�[37mDEBUG�[0m Collecting all states for current bucket     
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_yacith: 2021-05-06 15:16:41 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_yacith as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_6dy52p: 2021-05-06 15:16:04 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_6dy52p as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_7egdeg: 2021-05-06 15:02:17 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_7egdeg as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_pfcytp: 2021-05-06 14:57:19 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_pfcytp as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_lkc5ed: 2021-05-06 14:55:30 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_lkc5ed as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_6u8mgj: 2021-05-06 10:33:13 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_6u8mgj as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_345siz: 2021-05-04 16:59:07 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_345siz as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_ugotwg: 2021-05-04 12:18:48 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_ugotwg as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_3n659l: 2021-05-04 11:14:41 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_3n659l as it's in the last 20 snapshots 
�[37mDEBUG�[0m There are 8 exceeding states to potentially remove 
�[37mDEBUG�[0m selecting list of states to remove           
�[37mDEBUG�[0m Interval: 1620090881.00 - 1620278201.00      
�[37mDEBUG�[0m bucket is full, removing all non-keep states 
�[37mDEBUG�[0m bucket start: 2021-04-23 00:00:00 end:2021-04-30 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/ROOT/ubuntu_g3snm5@autozsys_rn8yvd 
�[37mDEBUG�[0m state.LastUsed (2021-03-27 19:09:06) before bucket.start (2021-04-23 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 0001-01-01 00:00:00 end:2021-04-23 00:00:00 samples: 0 
�[37mDEBUG�[0m current state: rpool/ROOT/ubuntu_g3snm5@autozsys_rn8yvd 
�[37mDEBUG�[0m First state matching for this bucket: rpool/ROOT/ubuntu_g3snm5@autozsys_q6ixmj (2021-03-04 07:27:42) 
�[37mDEBUG�[0m Collecting all states for current bucket     
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_rn8yvd: 2021-03-27 19:09:06 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_rn8yvd as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_nv89hg: 2021-03-27 15:32:05 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_nv89hg as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_nfcmdl: 2021-03-25 10:01:24 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_nfcmdl as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_owb6wt: 2021-03-05 11:39:57 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_owb6wt as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_hf2bjy: 2021-03-05 11:09:34 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_hf2bjy as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_ttmtqb@autozsys_tk45hl: 2021-03-04 08:53:55 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_ttmtqb@autozsys_tk45hl as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_ttmtqb: 2021-03-04 08:00:01 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_ttmtqb as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_ttmtqb@autozsys_h1ffq2: 2021-03-04 07:58:24 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_ttmtqb@autozsys_h1ffq2 as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/ROOT/ubuntu_g3snm5@autozsys_q6ixmj: 2021-03-04 07:27:42 
�[37mDEBUG�[0m Keeping snapshot rpool/ROOT/ubuntu_g3snm5@autozsys_q6ixmj as at least rpool/ROOT/ubuntu_g3snm5@autozsys_q6ixmj dataset has dependencies 
�[37mDEBUG�[0m There are 9 exceeding states to potentially remove 
�[37mDEBUG�[0m selecting list of states to remove           
�[37mDEBUG�[0m Interval: 1614803262.00 - 1616832546.00      
�[37mDEBUG�[0m bucket is full, removing all non-keep states 
�[37mDEBUG�[0m GC User Pass #1                              
�[37mDEBUG�[0m bucket start: 2021-05-27 00:00:00 end:2021-05-28 16:26:33 samples: -1 
�[37mDEBUG�[0m current state: rpool/USERDATA/peterg_npbufz@autozsys_7n8cvm 
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:46:00) before bucket.start (2021-05-27 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-26 00:00:00 end:2021-05-27 00:00:00 samples: 3 
�[37mDEBUG�[0m current state: rpool/USERDATA/peterg_npbufz@autozsys_7n8cvm 
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:46:00) before bucket.start (2021-05-26 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-25 00:00:00 end:2021-05-26 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/peterg_npbufz@autozsys_7n8cvm 
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:46:00) before bucket.start (2021-05-25 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-24 00:00:00 end:2021-05-25 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/peterg_npbufz@autozsys_7n8cvm 
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:46:00) before bucket.start (2021-05-24 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-23 00:00:00 end:2021-05-24 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/peterg_npbufz@autozsys_7n8cvm 
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:46:00) before bucket.start (2021-05-23 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-22 00:00:00 end:2021-05-23 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/peterg_npbufz@autozsys_7n8cvm 
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:46:00) before bucket.start (2021-05-22 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-21 00:00:00 end:2021-05-22 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/peterg_npbufz@autozsys_7n8cvm 
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:46:00) before bucket.start (2021-05-21 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-14 00:00:00 end:2021-05-21 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/peterg_npbufz@autozsys_7n8cvm 
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:46:00) before bucket.start (2021-05-14 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-07 00:00:00 end:2021-05-14 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/peterg_npbufz@autozsys_7n8cvm 
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:46:00) before bucket.start (2021-05-07 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-04-30 00:00:00 end:2021-05-07 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/peterg_npbufz@autozsys_7n8cvm 
�[37mDEBUG�[0m First state matching for this bucket: rpool/USERDATA/peterg_npbufz@autozsys_smxhmb (2021-05-04 11:08:37) 
�[37mDEBUG�[0m Collecting all states for current bucket     
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/peterg_npbufz@autozsys_7n8cvm: 2021-05-06 09:46:00 
�[37mDEBUG�[0m Keeping rpool/USERDATA/peterg_npbufz@autozsys_7n8cvm as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/peterg_npbufz: 2021-05-06 09:45:04 
�[37mDEBUG�[0m Keeping rpool/USERDATA/peterg_npbufz as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/peterg_npbufz@autozsys_345siz: 2021-05-04 16:59:08 
�[37mDEBUG�[0m Keeping rpool/USERDATA/peterg_npbufz@autozsys_345siz as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/peterg_npbufz@autozsys_utlaph: 2021-05-04 16:32:28 
�[37mDEBUG�[0m Keeping rpool/USERDATA/peterg_npbufz@autozsys_utlaph as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/peterg_npbufz@autozsys_svb4r8: 2021-05-04 15:31:28 
�[37mDEBUG�[0m Keeping rpool/USERDATA/peterg_npbufz@autozsys_svb4r8 as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/peterg_npbufz@autozsys_j1vf2z: 2021-05-04 14:30:28 
�[37mDEBUG�[0m Keeping rpool/USERDATA/peterg_npbufz@autozsys_j1vf2z as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/peterg_npbufz@autozsys_x8ckln: 2021-05-04 13:29:28 
�[37mDEBUG�[0m Keeping rpool/USERDATA/peterg_npbufz@autozsys_x8ckln as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/peterg_npbufz@autozsys_e42xww: 2021-05-04 12:28:28 
�[37mDEBUG�[0m Keeping rpool/USERDATA/peterg_npbufz@autozsys_e42xww as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/peterg_npbufz@autozsys_ugotwg: 2021-05-04 12:18:49 
�[37mDEBUG�[0m Keeping rpool/USERDATA/peterg_npbufz@autozsys_ugotwg as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/peterg_npbufz@autozsys_3xtek8: 2021-05-04 11:28:09 
�[37mDEBUG�[0m Keeping rpool/USERDATA/peterg_npbufz@autozsys_3xtek8 as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/peterg_npbufz@autozsys_3n659l: 2021-05-04 11:14:42 
�[37mDEBUG�[0m Keeping rpool/USERDATA/peterg_npbufz@autozsys_3n659l as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/peterg_npbufz@autozsys_smxhmb: 2021-05-04 11:08:37 
�[37mDEBUG�[0m Keeping rpool/USERDATA/peterg_npbufz@autozsys_smxhmb as it's in the last 20 snapshots 
�[37mDEBUG�[0m There are 11 exceeding states to potentially remove 
�[37mDEBUG�[0m selecting list of states to remove           
�[37mDEBUG�[0m Interval: 1620090517.00 - 1620258360.00      
�[37mDEBUG�[0m bucket is full, removing all non-keep states 
�[37mDEBUG�[0m bucket start: 2021-04-23 00:00:00 end:2021-04-30 00:00:00 samples: 1 
�[37mDEBUG�[0m No more user states left for pass #1.        
�[37mDEBUG�[0m bucket start: 2021-05-27 00:00:00 end:2021-05-28 16:26:33 samples: -1 
�[37mDEBUG�[0m current state: rpool/USERDATA/root_npbufz    
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:45:04) before bucket.start (2021-05-27 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-26 00:00:00 end:2021-05-27 00:00:00 samples: 3 
�[37mDEBUG�[0m current state: rpool/USERDATA/root_npbufz    
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:45:04) before bucket.start (2021-05-26 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-25 00:00:00 end:2021-05-26 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/root_npbufz    
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:45:04) before bucket.start (2021-05-25 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-24 00:00:00 end:2021-05-25 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/root_npbufz    
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:45:04) before bucket.start (2021-05-24 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-23 00:00:00 end:2021-05-24 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/root_npbufz    
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:45:04) before bucket.start (2021-05-23 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-22 00:00:00 end:2021-05-23 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/root_npbufz    
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:45:04) before bucket.start (2021-05-22 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-21 00:00:00 end:2021-05-22 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/root_npbufz    
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:45:04) before bucket.start (2021-05-21 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-14 00:00:00 end:2021-05-21 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/root_npbufz    
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:45:04) before bucket.start (2021-05-14 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-05-07 00:00:00 end:2021-05-14 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/root_npbufz    
�[37mDEBUG�[0m state.LastUsed (2021-05-06 09:45:04) before bucket.start (2021-05-07 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 2021-04-30 00:00:00 end:2021-05-07 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/root_npbufz    
�[37mDEBUG�[0m First state matching for this bucket: rpool/USERDATA/root_npbufz@autozsys_3n659l (2021-05-04 11:14:41) 
�[37mDEBUG�[0m Collecting all states for current bucket     
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/root_npbufz: 2021-05-06 09:45:04 
�[37mDEBUG�[0m Keeping rpool/USERDATA/root_npbufz as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/root_npbufz@autozsys_345siz: 2021-05-04 16:59:08 
�[37mDEBUG�[0m Keeping rpool/USERDATA/root_npbufz@autozsys_345siz as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/root_npbufz@autozsys_ugotwg: 2021-05-04 12:18:49 
�[37mDEBUG�[0m Keeping rpool/USERDATA/root_npbufz@autozsys_ugotwg as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/root_npbufz@autozsys_3n659l: 2021-05-04 11:14:41 
�[37mDEBUG�[0m Keeping rpool/USERDATA/root_npbufz@autozsys_3n659l as it's in the last 20 snapshots 
�[37mDEBUG�[0m There are 3 exceeding states to potentially remove 
�[37mDEBUG�[0m selecting list of states to remove           
�[37mDEBUG�[0m Interval: 1620090881.00 - 1620258304.00      
�[37mDEBUG�[0m bucket is full, removing all non-keep states 
�[37mDEBUG�[0m bucket start: 2021-04-23 00:00:00 end:2021-04-30 00:00:00 samples: 1 
�[37mDEBUG�[0m current state: rpool/USERDATA/root_npbufz@autozsys_rn8yvd 
�[37mDEBUG�[0m state.LastUsed (2021-03-27 19:09:06) before bucket.start (2021-04-23 00:00:00). Continuing 
�[37mDEBUG�[0m bucket start: 0001-01-01 00:00:00 end:2021-04-23 00:00:00 samples: 0 
�[37mDEBUG�[0m current state: rpool/USERDATA/root_npbufz@autozsys_rn8yvd 
�[37mDEBUG�[0m First state matching for this bucket: rpool/USERDATA/root_npbufz@autozsys_owb6wt (2021-03-05 11:39:57) 
�[37mDEBUG�[0m Collecting all states for current bucket     
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/root_npbufz@autozsys_rn8yvd: 2021-03-27 19:09:06 
�[37mDEBUG�[0m Keeping rpool/USERDATA/root_npbufz@autozsys_rn8yvd as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/root_npbufz@autozsys_nv89hg: 2021-03-27 15:32:06 
�[37mDEBUG�[0m Keeping rpool/USERDATA/root_npbufz@autozsys_nv89hg as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/root_npbufz@autozsys_nfcmdl: 2021-03-25 10:01:25 
�[37mDEBUG�[0m Keeping rpool/USERDATA/root_npbufz@autozsys_nfcmdl as it's in the last 20 snapshots 
�[37mDEBUG�[0m Analyzing state rpool/USERDATA/root_npbufz@autozsys_owb6wt: 2021-03-05 11:39:57 
�[37mDEBUG�[0m Keeping rpool/USERDATA/root_npbufz@autozsys_owb6wt as it's in the last 20 snapshots 
�[37mDEBUG�[0m There are 4 exceeding states to potentially remove 
�[37mDEBUG�[0m selecting list of states to remove           
�[37mDEBUG�[0m Interval: 1614904797.00 - 1616832546.00      
�[37mDEBUG�[0m bucket is full, removing all non-keep states 
�[37mDEBUG�[0m Unmanaged past user datasets GC              
�[37mDEBUG�[0m GC Unmanaged user Pass #0                    

I have changed the keeplast property. zsysctl service refresh followed by zsysctl gc -all gives a successful gc:

 % zsysctl list                
ID                        ZSys  Last Used
--                        ----  ---------
rpool/ROOT/ubuntu_g3snm5  true  current
(base) 
peterg@peterg-HP-Z230-Tower-Workstation : ~
[0] % zsysctl show                
Name:           rpool/ROOT/ubuntu_g3snm5
ZSys:           true
Last Used:      current
History:        
  - Name:       rpool/ROOT/ubuntu_g3snm5@autozsys_rusfce
    Created on: 2021-05-12 11:54:08
  - Name:       rpool/ROOT/ubuntu_g3snm5@autozsys_5mfxzy
    Created on: 2021-05-12 11:54:08
  - Name:       rpool/ROOT/ubuntu_g3snm5@autozsys_345siz
    Created on: 2021-05-04 16:59:07
Users:
  - Name:    peterg
    History: 
     - rpool/USERDATA/peterg_npbufz@autozsys_7n8cvm (2021-05-06 09:46:00)
     - rpool/USERDATA/peterg_npbufz (2021-05-06 09:45:04)
     - rpool/USERDATA/peterg_npbufz@autozsys_345siz (2021-05-04 16:59:08)
  - Name:    root
    History: 
     - rpool/USERDATA/root_npbufz (2021-05-06 09:45:04)
     - rpool/USERDATA/root_npbufz@autozsys_345siz (2021-05-04 16:59:08)

@Lockszmith-GH
Copy link

Did you check Issue #155 - there is some code shared there on how to do cleanups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants