View Issue Details

IDProjectCategoryView StatusLast Update
0000700bareos-coredirectorpublic2017-02-16 11:38
Reporterluf Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSCentOSOS Version7
Product Version15.2.2 
Fixed in Version16.2.5 
Summary0000700: Soft Quota Grace period could be reseted only manually
DescriptionOnce the Soft Quota is reached it is never
reset (I even clean up the space almost to 0). I tried to read
documentation and use google to find the solution but without
success. The only information is in source code (15.2 and
master branch):

1) Soft Quota Grace Period can be reset only via bconsole command:
  * purge quota client=<client>
  - this isn't documented and also <tab> help doesn't show this option

2) check_softquotas only set it but never reset - IMHO it should also
  take care about remove Soft Quota Grace Period once the pool
  size is lower then Soft Quota Grace Period or some other mark
Steps To Reproduce1) Setup Soft Quota Limit + Grace Period
2) Go over Soft Quota Limit
3) Clean up the pool under Soft Quota Limit
4) Wait longer then Grace Period (under Limit => it's ok)
5) Go over Soft Quota Limit - leads to immediate ERROR due to Grace Period Exceeded
Additional InformationI asked in user mail list and I was asked for a patch for 2 point (check_softquotas). So I attach the proposed patch.

I do not have testing environment so I haven't fully tested the patch yet.

The quota.c hasn't been touched for long time so this patch fits to master branch same as to bareos-15.2 branch (at least for compile time).
TagsNo tags attached.

Relationships

child of 0000734 closedstephand Release bareos-16.2.5 

Activities

luf

luf

2016-09-26 12:38

reporter  

0001-Add-support-for-Soft-Quota-Grace-period-reset.patch (1,003 bytes)   
From 40b9f6701dc3fe16e6eb0ed4f8135f021632d844 Mon Sep 17 00:00:00 2001
From: Ludek Finstrle <luf@seznam.cz>
Date: Mon, 26 Sep 2016 12:24:54 +0200
Subject: [PATCH] Add support for Soft Quota Grace period reset

---
 src/dird/quota.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/dird/quota.c b/src/dird/quota.c
index b334d79..c008506 100644
--- a/src/dird/quota.c
+++ b/src/dird/quota.c
@@ -250,6 +250,19 @@ bool check_softquotas(JCR *jcr)
             }
          }
       }
+   } else if (jcr->res.client->GraceTime != 0) {
+      /*
+       * Reset softquota
+       */
+      CLIENT_DBR cr;
+      memset(&cr, 0, sizeof(cr));
+      cr.ClientId = jcr->jr.ClientId;
+      if (!db_reset_quota_record(jcr, jcr->db, &cr)) {
+         Jmsg(jcr, M_WARNING, 0, _("Error setting Quota gracetime: ERR=%s\n"),
+            db_strerror(jcr->db));
+      } else {
+         Jmsg(jcr, M_ERROR, 0, _("Softquota Reset, Grace Period ends now.\n"));
+      }
    }
 
 bail_out:
-- 
1.8.3.1

joergs

joergs

2016-12-03 12:13

developer   ~0002460

It did take a while, but finally I found the time to verify your patch. It fixes the problem it addresses. Thank you for the patch.
While verifying and adapt the regression test for it, I also fix the problem, that the soft quota triggers the grace period only at the start of a job, not when the job is finished (and therefore more data is used).

Related Changesets

bareos: bareos-16.2 5067c6ea

2016-09-26 14:24

luf


Committer: joergs

Ported: N/A

Details Diff
Add support for Soft Quota Grace period reset Affected Issues
0000700
mod - src/dird/quota.c Diff File

bareos-regress: master b41ce923

2016-11-18 19:50

joergs

Ported: N/A

Details Diff
quota-softquota-test: add "soft quota reset" test

Also adapted test to the new configuration schema.
Affected Issues
0000700
rm - configs/quota-softquota-test/bareos-dir.conf.quota-softquota-test.in Diff File
add - configs/quota-softquota-test/bareos-dir.d/client/bareos-fd.conf.in Diff File
mod - tests/1-example-test Diff File
mod - tests/quota-softquota-test Diff File

bareos: bareos-16.2 6a74d1b5

2016-12-01 15:45

joergs

Ported: N/A

Details Diff
Soft Quota: add soft quota check after job run

Before, check_softquota has was called at the beginning of a backup job.
The result was that the Soft Quota Grace Time was not set
when the client soft quota has been exceeded, but when the next job for
this client started.

This does not meet the expectation when using soft quotas.

Now the job report after a backup job also better reflects the real quota
status.
Affected Issues
0000700
mod - AUTHORS Diff File
mod - src/dird/backup.c Diff File
mod - src/dird/quota.c Diff File

Issue History

Date Modified Username Field Change
2016-09-26 12:38 luf New Issue
2016-09-26 12:38 luf File Added: 0001-Add-support-for-Soft-Quota-Grace-period-reset.patch
2016-09-28 10:58 joergs Assigned To => joergs
2016-09-28 10:58 joergs Status new => assigned
2016-12-03 12:05 joergs Changeset attached => bareos bareos-16.2 5067c6ea
2016-12-03 12:05 joergs Changeset attached => bareos bareos-16.2 6a74d1b5
2016-12-03 12:06 joergs Changeset attached => bareos-regress master b41ce923
2016-12-03 12:13 joergs Note Added: 0002460
2016-12-03 12:13 joergs Status assigned => resolved
2016-12-03 12:13 joergs Fixed in Version => 16.2.5
2016-12-03 12:13 joergs Resolution open => fixed
2016-12-03 12:14 joergs Status resolved => closed
2016-12-03 14:25 joergs Relationship added child of 0000734
2017-02-16 11:38 joergs Assigned To joergs =>