vespa
vespa copied to clipboard
Feeding an expired document returns 200 OK in /document/v1
When feeding a document that does not match the selection in https://docs.vespa.ai/documentation/reference/services-content.html#document, it is silently dropped.
It is correct that the document is not stored - but the fact that is was not should be returned in the response code when using document/v1 - example POST
curl -X POST -H "Content-Type:application/json" --data-binary @docs.json https://endpoint/document/v1 ...
We could consider returning 412 Precondition Failed
as we do when there's a test-and-set condition mismatch, but the semantics are subtly different enough that it's not 100% obvious that it's the right choice. Documents being dropped as part of the ingest pipeline happens because they do not match the selection criteria of any candidate clusters, i.e. it's a case of "the set of matches is empty" during routing vs. "there is an explicit mismatch" for test-and-set.
I don't think we should change the status code as everything is OK, but we could return a payload including this information.
Also note that Update operations through HTTP PUT for a non-existing document also is 200 OK without any payload about document not found so if we touch this please consider adding a payload for that case as well.
we decided #10209 was hard to to and will prioritize this instead