-
Notifications
You must be signed in to change notification settings - Fork 51
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
WIP: kvs: support configuration of max transaction count #6581
Open
chu11
wants to merge
9
commits into
flux-framework:master
Choose a base branch
from
chu11:issue6572_kvs_transaction_max
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Problem: There is an errant typo in which an upper case example is written lower case. Make the example character upper case.
Problem: The very generic word "count" is used in the tool's usage and variable names. Update to "fence count" to make this more clear.
Problem: In the fence_api testing tool, if an error occurs during a fence, the tool immediately exits. This makes it difficult to test for fence error conditions. Solution: Do not exit immediately on error, capture the error and call pthread_exit(). Determine if an error has occurred after all threads have ended.
Problem: In the fence_api testing tool, each fence request sends a single transaction operation. This limits some testing ability. Support a new --opcount option that allows us to configure greater than one operation per fence request.
Problem: When an error occurs in a fence request, the error is only reported to the requestor. In most cases, this is fine, but the error should be reported to all members of the fence in some cases. Most notably, it should be reported to all members of the fence when the fence count has been reached and an error has occurred after this point. Solution: In fence_request_cb() return an error via the kvs function error_event_send_to_name() when it is appropriate.
Problem: A KVS denial of service is possible because there is no maximum on the number of operations a user can submit in a KVS transaction. For example, a KVS transaction with billions of KVS entries would lead to a severe degradation in KVS performance. Support a new KVS configuration "transaction-max-ops" that will reject KVS transaction with operations above a maximum count. The default maximum is 65536. Fixes flux-framework#6572
Problem: The new transaction-max-ops configuration limits the number of operations a user can submit in a KVS commit or fence. However, this does not cap the total number of operations from a combined fence, which could exceed the transaction-max-ops by a lot. Support a new KVS configuration "fence-max-ops" that will reject KVS fences with a combined number of options above a maximum. The default maximum is 1048576.
Problem: The new kvs transaction-max-ops and fence-max-ops configuration options are not documented. Add documentation to flux-config-kvs(5)
Problem: There is no coverage for the new kvs transaction-max-ops and fence-max-ops configurations. Add coverage in t1005-kvs-security.t.
chu11
force-pushed
the
issue6572_kvs_transaction_max
branch
from
January 27, 2025 22:34
8868cd6
to
d245914
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6581 +/- ##
==========================================
+ Coverage 79.48% 79.49% +0.01%
==========================================
Files 531 531
Lines 88421 88462 +41
==========================================
+ Hits 70281 70326 +45
+ Misses 18140 18136 -4
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per discussion in #6125, denial-of-service attacks could be made against the KVS by very very large KVS transactions.
Support two configurations for capping the number of transactions made by users. One for each individual transaction made by a caller and one for the combined total of operations from a fence.
For the time being, I made the default 64K for the transaction cap and 1M for the fence cap.
I made this WIP only b/c those defaults may be tweaked depending on what stats we get from the prior PR #6556. I would like to merge only after we gather a bit of data, although I'd be quite shocked if we have to adjust the defaults. Edit: Or alternately, if we'd like to just get the code in, we could default the max to LLONG_MAX and lower the default at a later time.
Only other thought is I decided to return the errno E2BIG if we went across a max cap boundary. It's possible there is a superior errno for this, I picked it b/c I thought "ehhh that's not bad".