-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
txn: don't try to decode request bodies > raft.SuggestedMaxDataSize #6422
Conversation
open question: should this functionality only be for |
Its unfortunate but I don't think we can do this. Vault will send Txn or KV requests that can exceed that suggested size. Prior to 1.5.3 they couldn't but then we added the ability to enable raft chunking specifically so Vault could send larger requests. |
@mkeeler I think you were right because the original commit here used |
@banks I think you are right in that we could use |
Yeah the name is kinda jank and has history - we added it when we made this
configurable but it was just based on the old constant name it replaced.
That constant pre-dates transaction API but was effectively "the biggest
raft log message we want to handle" and so re-used for transaction API.
If we ever actually document this properly, we could consider renaming it
to be more appropriate but that said, it's arguable easier for users to
grok that there is a max KV size and that transactions whether they touch
KV or not also have to fit in that same size. Maybe easier to document than
try to come up with a more correct name like "max_processable_entity_size"
or something.
IMO, I'd leave that bikeshed to paint later as this is nothing new being
added :)
…On Fri, Aug 30, 2019 at 5:05 PM Matt Keeler ***@***.***> wrote:
@banks <https://github.com/banks> I think you are right in that we could
use config.KVMaxValueSize instead of the raft suggested data size and
that should allow this to work with our target use case for raft chunking.
The odd part (that I missed during those original PRs) is that its not
config.MaxTxnSize or something less tied to the KV because for non-Vault
use cases whats coming in might have nothing to do with the KV but instead
be a batch of node, service and check updates. Another interesting bit is
that the Txn we are parsing might not do writes at all and thus might avoid
raft all together. We should still place some upper bound on what we think
the max content length prior to deserialization should be but I am not
certain it should definitely be tied to the KVMaxValueSize.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6422?email_source=notifications&email_token=AAA5QU634LGKESOMT3BRF7LQHFAMVA5CNFSM4ISFMNY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5SCRKY#issuecomment-526657707>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA5QU3AIY7NT6ZUR2VQBH3QHFAMVANCNFSM4ISFMNYQ>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR is a small, incremental step towards "fixing" #6147.
This change was originally suggested by @mkeeler in the issue description.
The basic premise of this change is that we are checking the request body size at the end of this fn (
convertOps
), after a huge request body may have already been decoded bymapstructure
. The idea here is that we should try to check the request body size at the beginning of the fn as well, before sending it tomapstructure
.I'm submitting a PR here to suggest this change, but I am fully ready to scrap this code if it is not desirable. I will leave that decision to my reviewers.