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
When using a replicated set of mongo instances, it's normal to have the default client be configured to
PREFER_SECONDARY. When performing apatch(orpatch_internal), the code will callget_document, which then callsfind_onewhich 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.
Actual Behavior
'No such document'
Environment