* [pbs-devel] [PATCH proxmox-backup] prune sim: correctly keep track of already included backups
@ 2020-12-14 15:04 Fabian Ebner
2020-12-14 15:08 ` Fabian Ebner
2020-12-15 13:04 ` [pbs-devel] applied: " Thomas Lamprecht
0 siblings, 2 replies; 3+ messages in thread
From: Fabian Ebner @ 2020-12-14 15:04 UTC (permalink / raw)
To: pbs-devel
This needs to happen in a separate loop, because some time intervals are not
subsets of others, i.e. weeks and months. Previously, with a daily backup
schedule, having:
* a backup on Sun, 06 Dec 2020 kept by keep-daily
* a backup on Sun, 29 Nov 2020 kept by keep-weekly
would lead to the backup on Mon, 30 Nov 2020 to be selected for keep-monthly,
because the iteration did not yet reach the backup on Sun, 29 Nov 2020 that
would mark November as being covered.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
docs/prune-simulator/prune-simulator.js | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/docs/prune-simulator/prune-simulator.js b/docs/prune-simulator/prune-simulator.js
index 5533c2d6..55cd548b 100644
--- a/docs/prune-simulator/prune-simulator.js
+++ b/docs/prune-simulator/prune-simulator.js
@@ -485,16 +485,17 @@ Ext.onReady(function() {
backups.forEach(function(backup) {
let mark = backup.mark;
- let id = idFunc(backup);
-
- if (finished || alreadyIncluded[id]) {
- return;
+ if (mark && mark === 'keep') {
+ let id = idFunc(backup);
+ alreadyIncluded[id] = true;
}
+ });
- if (mark) {
- if (mark === 'keep') {
- alreadyIncluded[id] = true;
- }
+ backups.forEach(function(backup) {
+ let mark = backup.mark;
+ let id = idFunc(backup);
+
+ if (finished || alreadyIncluded[id] || mark) {
return;
}
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pbs-devel] [PATCH proxmox-backup] prune sim: correctly keep track of already included backups
2020-12-14 15:04 [pbs-devel] [PATCH proxmox-backup] prune sim: correctly keep track of already included backups Fabian Ebner
@ 2020-12-14 15:08 ` Fabian Ebner
2020-12-15 13:04 ` [pbs-devel] applied: " Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Fabian Ebner @ 2020-12-14 15:08 UTC (permalink / raw)
To: pbs-devel
Forgot to mention that it's better viewed with --patience
Am 14.12.20 um 16:04 schrieb Fabian Ebner:
> This needs to happen in a separate loop, because some time intervals are not
> subsets of others, i.e. weeks and months. Previously, with a daily backup
> schedule, having:
> * a backup on Sun, 06 Dec 2020 kept by keep-daily
> * a backup on Sun, 29 Nov 2020 kept by keep-weekly
> would lead to the backup on Mon, 30 Nov 2020 to be selected for keep-monthly,
> because the iteration did not yet reach the backup on Sun, 29 Nov 2020 that
> would mark November as being covered.
>
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
> docs/prune-simulator/prune-simulator.js | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/docs/prune-simulator/prune-simulator.js b/docs/prune-simulator/prune-simulator.js
> index 5533c2d6..55cd548b 100644
> --- a/docs/prune-simulator/prune-simulator.js
> +++ b/docs/prune-simulator/prune-simulator.js
> @@ -485,16 +485,17 @@ Ext.onReady(function() {
>
> backups.forEach(function(backup) {
> let mark = backup.mark;
> - let id = idFunc(backup);
> -
> - if (finished || alreadyIncluded[id]) {
> - return;
> + if (mark && mark === 'keep') {
> + let id = idFunc(backup);
> + alreadyIncluded[id] = true;
> }
> + });
>
> - if (mark) {
> - if (mark === 'keep') {
> - alreadyIncluded[id] = true;
> - }
> + backups.forEach(function(backup) {
> + let mark = backup.mark;
> + let id = idFunc(backup);
> +
> + if (finished || alreadyIncluded[id] || mark) {
> return;
> }
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [pbs-devel] applied: [PATCH proxmox-backup] prune sim: correctly keep track of already included backups
2020-12-14 15:04 [pbs-devel] [PATCH proxmox-backup] prune sim: correctly keep track of already included backups Fabian Ebner
2020-12-14 15:08 ` Fabian Ebner
@ 2020-12-15 13:04 ` Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2020-12-15 13:04 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Fabian Ebner
On 14.12.20 16:04, Fabian Ebner wrote:
> This needs to happen in a separate loop, because some time intervals are not
> subsets of others, i.e. weeks and months. Previously, with a daily backup
> schedule, having:
> * a backup on Sun, 06 Dec 2020 kept by keep-daily
> * a backup on Sun, 29 Nov 2020 kept by keep-weekly
> would lead to the backup on Mon, 30 Nov 2020 to be selected for keep-monthly,
> because the iteration did not yet reach the backup on Sun, 29 Nov 2020 that
> would mark November as being covered.
>
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
> docs/prune-simulator/prune-simulator.js | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-15 13:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 15:04 [pbs-devel] [PATCH proxmox-backup] prune sim: correctly keep track of already included backups Fabian Ebner
2020-12-14 15:08 ` Fabian Ebner
2020-12-15 13:04 ` [pbs-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox