fix(paramserver): file is too large error #98
Merged
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.
Description
When uploading configurations, if the size of a file is greater than 128 KiB, it is uploaded to a blob store. Otherwise, it is stored in etcd. The two operations have separate APIs that the SDK invokes based on the file size.
The max key value size for etcd is set to 128 KiB, which means that any value greater than that cannot be stored.
When an API call is made to save a file < 128 KiB, the backend stored the entire API payload instead of just the file content. The payload is of the form
Further, the backend also injects a
metadata
field with timestamp and userid. So, let's say a file that is around115 KiB
on disk becomes > 128 KiB by the time it is saved to etcd. Which leads to thefile too large
errors.This PR handles the case by calculating the effective size and adds the metadata size in the calculation before invoking the right API.
Testing
Screen.sharing.-.2024-11-07.7_16_17.PM.mp4
Links