When the user quota is activated (system.usages.enabled=true), user usage is not calculated for previously uploaded contents

Description

Description
When the user quota is activated (system.usages.enabled=true), user usage is not calculated for previously uploaded contents

Steps to reproduce:
1. Create a test user, for example, "testuser" in Share UI
2. Upload any content by Share UI
3. Go to Node browser and verify cm:sizeCurrent is 0
4. Add the property system.usages.enabled=true in alfresco-global.properties and restart the server
5. Upload some documents and wait for the scheduled userUsage job to run, which is scheduled for every 5 minutes

Expected Behaviour:
After adding the property, usage was updated every 5 minutes. cm:sizeCurrent should reflect all the previous usages and usages after changing the property.

Observed Behaviour:
After adding the property, usage was updated every 5 minutes. However, cm:sizeCurrent only reflects the usage increase after changing the property.

alfresco.log output:

Example:
Initially, the "testuser" usage was 139.25MB.

I uploaded a total of 6.3MB files before changing the property.
Even after changing the property, the usage remained unchanged at 139.25MB.

After that, when I uploaded a 1.4MB file, the usage increased to 140.68MB.
If previous uploads are reflected, the final size should be about 147MB.

Environment

None

Testcase ID

None

Activity

Show:
Nithin Nambiar
April 9, 2021, 3:06 PM

I have created a DOCS ticket -

Steve Blair
April 9, 2021, 12:48 PM

I see sense in updating the documentation first to better explain. And we should investigate if there is a way to resolve this as I think the customer expectation is reasonable.

Stefan Kopf
April 9, 2021, 8:06 AM

In our documentation, it is not really clear how this is working. I am afraid that changing this feature to work as the customer is expecting it to work is a significant amount of work. This might be straight forward for smaller repos, but we need to consider larger deployments as well.

IMHO, we should discuss with PM if we just want to document better how this feature is actually working or if we should invest into changing the feature to work the way the customer is expecting it to work.

Nithin Nambiar
April 8, 2021, 5:03 PM

I agree, it seems to be working as per the design. If the feature is not turned ON before uploading any content then the user will never see accurate usage. Just wondering if this is something we can make it obvious in the documentation.

With regards to JMX there is an operation to trigger the usageCollapse job, but again it wouldn’t calculate previous usages when the property was turned OFF.

Stefan Kopf
April 8, 2021, 7:53 AM
Edited

Ah, I see. So we are only recalculating on startup if this property has not been set at all, but not if it has been set to the number “0”. This mechanism is actually only there to help with upgrades, to calculate this for all users that have been created before this feature got introduced.

So it looks like, we don’t have a mechanism in the system to recalculate these numbers if this feature got turned on later or if it got turned OFF and ON again.

Can you please check if we have a JMX operation for this? In many cases like this, we typically offer a method for recalculation via JMX.

But if not, I am still not convinced if we should add this method. It could have a severe system impact. It would need to run over ALL user accounts, and recalculate this for every single account. And I am not sure how efficient this calculation is implemented.

Not a bug

Assignee

Nithin Nambiar

Reporter

Shilpa Tupe

ACT Numbers

00350279

Delivery Team

Team 3

Bug Priority

Category 2