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 corruption during CONFLICT upload #3498

Merged
merged 1 commit into from Jul 21, 2023

Conversation

dbutenhof
Copy link
Member

@dbutenhof dbutenhof commented Jul 21, 2023

PBENCH-1219

Large uploads can time out, causing the client (e.g., the 0.69 passthrough server's dispatch) to retry. Eventually, this will result in an OK (200) response, which is good. However if we retry before the original operation finishes (it may be still running, despite the client timeout), we catch the already existing "temporary intake directory" as a CONFLICT error.

Unfortunately, the cleanup logic doesn't recognize this distinction, and still deleted the intake directory on exit. Timed correctly, this could break the original upload: at best, it results in a noisy termination with complaints that the previously-existing temporary directory no longer exists.

Fix this problem by attempting to delete only when this API instance has successfully created the temporary directory. Modify the CONFLICT unit test case to reproduce the situation more accurately and additionally validate that the directory still exists after completion.

PBENCH-1219

Large uploads can time out, causing the client (e.g., the 0.69 passthrough
server's dispatch) to retry. Eventually, this will result in an `OK` (200)
response, which is good. However if we retry before the original operation
finishes (it may be still running, despite the client timeout), we catch the
already existing "temporary intake directory" as a `CONFLICT` error.

Unfortunately, the cleanup logic doesn't recognize this distinction, and still
deleted the intake directory on exit. Timed correctly, this could break the
original upload: at best, it results in a noisy termination with complaints
that the existed temporary directory no longer exists.

Fix this problem by attempting to delete only when this API instance has
successfully created the temporary directory. Modify the `CONFLICT` unit test
case to reproduce the situation more accurately and additionally validate that
the directory still exists after completion.
@dbutenhof dbutenhof added bug Server API Of and relating to application programming interfaces to services and functions labels Jul 21, 2023
@dbutenhof dbutenhof requested review from ndokos and webbnh July 21, 2023 12:43
@dbutenhof dbutenhof self-assigned this Jul 21, 2023
@dbutenhof
Copy link
Member Author

NOTE: once I have approval here, I'll cherry-pick this to b0.72.

Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

👍

@dbutenhof dbutenhof merged commit abfc995 into distributed-system-analysis:main Jul 21, 2023
4 checks passed
@dbutenhof dbutenhof deleted the conflict branch July 21, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Of and relating to application programming interfaces to services and functions bug Server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants