Skip to content

Added support for 'grid_accounting' daemon#420

Merged
Martin-Rehr merged 15 commits intonextfrom
addition/storage-usage-accounting
Jan 29, 2026
Merged

Added support for 'grid_accounting' daemon#420
Martin-Rehr merged 15 commits intonextfrom
addition/storage-usage-accounting

Conversation

@Martin-Rehr
Copy link
Contributor

The 'grid_accounting' daemon generate user storage accounting based on 'home', 'vgrid' and 'peers' usage.

@Martin-Rehr Martin-Rehr requested a review from a team January 26, 2026 16:54
Copy link
Contributor

@jonasbardino jonasbardino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good. I've commented in-line for now.

@jonasbardino
Copy link
Contributor

I just realized I hadn't seen mig/lib/accounting.py at all during my review because github thinks it's too big to display the diff. At a first glance I didn't see any obvious issues with it but perhaps just a couple of questions or remarks that you may or may not already have covered.

  1. Users cannot in practice be both external and act as peers. The comments made me unsure if that is already taken care of. Any external users with leftover peers settings (from a past as internals or whatever) could probably just be ignored in the peers mapping.
  2. Multiple internal users can in practice accept the same external user as peer. I guess only one should then be accounted for the disk use of that external user, but so far didn't find where the accounting is then in fact assigned to only the 'active' peer or if it perhaps silently gets truncated to the last one found in the peers mapping.

We can proceed with the merge and address any pending corner-cases as follow-up if you prefer.

@Martin-Rehr
Copy link
Contributor Author

Martin-Rehr commented Jan 28, 2026

Thanks for the review:

  1. In practice we have users that occur as both external and act as peers. A log warning is thrown in that case:
    if ext_users and peers:

Which gives us the information needed for a manual cleanup

  1. In this initial version all internal users that accepted the external user X as peer are accounted for the external user X

@jonasbardino
Copy link
Contributor

Thanks for the review:

1. In practice we have users that occur as both external and act as peers.  A log warning is thrown in that case:
   https://github.com/ucphhpc/migrid-sync/blob/08d6799b4345c5a9f6953537ce8c405746a12336/mig/lib/accounting.py#L659

Which gives us the information needed for a manual cleanup

2. In this initial version all internal users that accepted the external user X as peer are accounted for the external user X

Thanks for the clarification 👍

Copy link
Contributor

@jonasbardino jonasbardino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you just need to resolve the open comment about unit tests or if you have more updates in the pipeline but let's try to get it in when you're done.

@Martin-Rehr
Copy link
Contributor Author

Not sure if you just need to resolve the open comment about unit tests or if you have more updates in the pipeline but let's try to get it in when you're done.

I have no further improvements for it in the pipeline, so If everybody can live with the latest version I'll mark it as resolved.

@jonasbardino jonasbardino added the enhancement New feature or request label Jan 29, 2026
@Martin-Rehr Martin-Rehr deleted the addition/storage-usage-accounting branch January 29, 2026 16:53
@Martin-Rehr Martin-Rehr restored the addition/storage-usage-accounting branch January 29, 2026 16:56
@Martin-Rehr Martin-Rehr reopened this Jan 29, 2026
@Martin-Rehr Martin-Rehr merged commit e27a9e1 into next Jan 29, 2026
20 checks passed
@Martin-Rehr Martin-Rehr deleted the addition/storage-usage-accounting branch January 29, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants