feat(licensing): quota enforcement, client rejection and trial license limits#71
Conversation
Before this commit, the quota retrieval and distribution of exceeded IDs would be disabled on mgmtd startup if the feature wasn't licensed. This lead to a couple of issues with enforcement consistency: * When a license expired while mgmtd was running, enforcement would continue to work but only until mgmtd restarts * When mgmtd restarted, collection and distribution of exceeded quotas would be disabled, leading to other nodes enforcing based on an old state * When other nodes restarted, they would still be able to initially fetch outdated quota states and enforce based on them. This commit fixes all of the above by not allowing intial downloads of quota state if the feature is not licensed and not entirely disabling the quota distribution mechanism. If the quota feature is not licensed nodes quota collection from the nodes will be disabled for efficiency reasons, but nodes will still receive exceeded quota updates to allow for online changes in license state. These updates will not contain any information about exceeded IDs and will simply clear out the state on the nodes so quotas will no longer be enforced.
Drop the somewhat misleading "Internal" prefix for errors during license verification. These errors are usually caused by invalid or non-existing license files, which isn't an "internal" problem and requires user action.
rustybee42
left a comment
There was a problem hiding this comment.
Found another couple of tiny and a slightly bigger structural issue
b1b097c to
fd9f05e
Compare
There was a problem hiding this comment.
Since Patrick performed the human review, I mostly focused on ensuring this matched my expectations for how licensing would work, testing, and using Claude to analyze the changes.
I had Claude jointly review the changes in this PR and https://github.com/ThinkParQ/beegfs-core/pull/4671/, and I've organized the findings into comments on the respective PRs. I mention this only to note Claude had the full context from the overall change.
rustybee42
left a comment
There was a problem hiding this comment.
There is some not so ideal code (unnecessary clone(), unwrap()) that should be fixed, after that it should be good to go.
rustybee42
left a comment
There was a problem hiding this comment.
Looks good now! Don't forget squashing!
This PR does three separate things related to licensing:
Tagging @iamjoemccormick for reviewing licensing related semantics and @rustybee42 for reviewing the code flow related changes around quotas and licensing.