Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add-bank: add a check when adding a root bank #509

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

cmoussa1
Copy link
Member

Problem

Mentioned in #508, the structure of the flux-accounting database hierarchy of banks and users assumes there is only one root bank (e.g when calculating fair-share), but multiple root banks can be added with the add-bank command.


This PR adds a check when adding a root bank that one does not already exist. If so, an exception is raised.

A couple of existing tests that did not make this assumption have been edited to account for this new check, and I've also added a simple sharness test that ensures an exception is raised when trying to add more than one root bank.

Fixes #508

Problem: The structure of the flux-accounting database hierarchy of
banks and users assumes there is only one root bank, but multiple root
banks can be added with the "add-bank" command.

Add a check when adding a root bank that one does not already exist. If
so, raise an exception.
Problem: There exists a few unit tests that do not make the assumption
that the flux-accounting database does not enforce a 1-root-bank limit,
but now that there is a check for this in add_bank(), these tests fail.

Edit these tests to account for the check that when a root bank is
added, a root bank does not already exist.
Problem: There exists no sharness test for trying to add more than one
root bank to the bank_table and ensuring than an exception is raised.

Add a test.
@cmoussa1 cmoussa1 added the bug-fix A proposal for something that isn't working label Oct 15, 2024
Copy link
Member

@jameshcorbett jameshcorbett left a comment

Choose a reason for hiding this comment

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

LGTM!

@cmoussa1
Copy link
Member Author

Thanks! Setting MWP here

@mergify mergify bot merged commit 859ee8f into flux-framework:master Oct 15, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix A proposal for something that isn't working merge-when-passing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add-bank: multiple root banks can be added
2 participants