linagora / james-project

Mirror of Apache James Project
Apache License 2.0
72 stars 62 forks source link

Recompute current values of JMAP upload #4833

Closed hungphan227 closed 1 year ago

hungphan227 commented 1 year ago

original ticket: https://github.com/linagora/james-project/issues/4816

WHY

to implement a webadmin API that admin can use to recompute current values of JMAP upload Cassandra counters are bad, and easy to go out of sync (Consistency Level ONE + non idempotent thus not retried if you ask). Hence we need a way to recompute quota as we know they would eventually go out of sync...

HOW

DOD: integration test

quantranhong1999 commented 1 year ago

Normally we should write the grooming ticket in the form:

And sometimes even with Notes, Side effects need to pay attention to...

An example: https://github.com/linagora/tmail-backend/issues/601

e.g here I think we should propose the JMAP Upload recompute Webadmin API with curl example.

hungphan227 commented 1 year ago

This is just a task from a ticket. I have already put reference to the original ticket in the description. The detail is presented in the original ticket.

chibenwa commented 1 year ago

How does this differ from https://james.apache.org/server/manage-webadmin.html#Recomputing_current_quotas_for_users ?

Maybe we can find a way to plug new operations in the existing task in a very modular fashion (interface, multi-binder)...

WDYT ?

WHY -> to implement a webadmin API that admin can use to recompute current values of JMAP upload

Not detailed enough. Cassandra counters are bad, and easy to go out of sync (Consistency Level ONE + non idempotent thus not retried if you ask). Hence we need a way to recompute quota as we know they would eventually go out of sync...

hungphan227 commented 1 year ago

@chibenwa @Arsnael I propose new solution:

Arsnael commented 1 year ago

Why not as a query parameter instead? with default value if omitted to run the current one?

For retro compatibility... and so I don't have to run around modifying potential cronjobs we have on our different environments with tmail regarding this :)

chibenwa commented 1 year ago

Why not as a query parameter instead? with default value if omitted to run the current one?

+1

And default value: run all. As a user I might not need to know all kind of quota maintained by James.

hungphan227 commented 1 year ago

I have updated the description

hungphan227 commented 1 year ago

draft PR https://github.com/apache/james-project/pull/1707

hungphan227 commented 1 year ago

PR https://github.com/apache/james-project/pull/1707