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

Fix file delivery order #3283

Merged
merged 7 commits into from
Feb 22, 2024
Merged

Fix file delivery order #3283

merged 7 commits into from
Feb 22, 2024

Conversation

pzl
Copy link
Member

@pzl pzl commented Feb 14, 2024

What is the problem this PR solves?

Chunked file delivery would occasionally be delivered out-of-order for certain file sizes

How does this PR solve the problem?

Chunk identifiers (not binary contents, just a few metadata fields) are just manually sorted in code. The positional order is not stored in the chunk documents, only contained in a doc's _id field, which is not a sortable result. Given a upper limit of file size (100mb) and fixed chunk size (4mb), the upper bound for number of documents here is 25. Software sort is reasonable enough

How to test this PR locally

Update securitySolution.maxUploadResponseActionFileBytes in kibana.yml to be 104857600

spin up an endpoint, use the responder console to upload a ~90mb file. The bug reproducing-error is a file hash mismatch. With this fix, hashes will match and the action will be marked success

Design Checklist

  • I have ensured my design is stateless and will work when multiple fleet-server instances are behind a load balancer.
  • I have or intend to scale test my changes, ensuring it will work reliably with 100K+ agents connected.
  • I have included fail safe mechanisms to limit the load on fleet-server: rate limiting, circuit breakers, caching, load shedding, etc.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool

Related issues

@pzl pzl added bug Something isn't working backport-v8.11.0 Automated backport with mergify backport-v8.12.0 Automated backport with mergify backport-v8.13.0 Automated backport with mergify backport-v8.10.0 Automated backport with mergify labels Feb 14, 2024
@pzl pzl marked this pull request as ready for review February 15, 2024 13:57
@pzl pzl requested a review from a team as a code owner February 15, 2024 13:57
Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

LGTM

@pzl
Copy link
Member Author

pzl commented Feb 19, 2024

buildkite test this

Copy link

@pzl pzl removed the backport-v8.10.0 Automated backport with mergify label Feb 22, 2024
@pzl pzl merged commit 485fad9 into elastic:main Feb 22, 2024
8 checks passed
mergify bot pushed a commit that referenced this pull request Feb 22, 2024
(cherry picked from commit 485fad9)
mergify bot pushed a commit that referenced this pull request Feb 22, 2024
(cherry picked from commit 485fad9)
mergify bot pushed a commit that referenced this pull request Feb 22, 2024
(cherry picked from commit 485fad9)
juliaElastic pushed a commit that referenced this pull request Feb 23, 2024
(cherry picked from commit 485fad9)

Co-authored-by: Dan Panzarella <[email protected]>
juliaElastic pushed a commit that referenced this pull request Feb 23, 2024
(cherry picked from commit 485fad9)

Co-authored-by: Dan Panzarella <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.11.0 Automated backport with mergify backport-v8.12.0 Automated backport with mergify backport-v8.13.0 Automated backport with mergify bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants