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

Race condition in PATCH on newly created documents with clustered mongo #1411

Closed
ehiggs opened this issue Sep 18, 2020 · 1 comment
Closed
Milestone

Comments

@ehiggs
Copy link
Contributor

ehiggs commented Sep 18, 2020

When using a replicated set of mongo instances, it's normal to have the default client be configured to PREFER_SECONDARY. When performing a patch (or patch_internal), the code will call get_document, which then calls find_one which can be to the secondary. If the write concern is not total (also common) then the retrieved document state can be stale. This is a problem when one wants to insert data immediately, do some quick processing, and then patch the document to say the processing is done: the patch request might find that 'there is no document'.

Expected Behavior

PATCH on newly created documents should work.

post_internal(...)
patch_internal(...)

Actual Behavior

'No such document'

Environment

  • Python version: 3.7
  • Eve version: 1.1.1
@nicolaiarocci
Copy link
Member

Fixed with #1412

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants