Stream: implementers
Topic: Batch interdependency validation
Paul Church (Sep 30 2021 at 21:20):
Batch semantics requires that "For a batch, there SHALL be no interdependencies between the different entries in the Bundle that cause change on the server."
This sentence really needs an "or else what happens?" clause. What error is returned, and is it for the entire operation or for an individual entry/entries? I would argue that it has to be at the level of the individual entries where the interdependency was detected.
It's quite difficult, maybe even impossible, to verify this constraint in a way that would allow the entire bundle to be rejected in every case. When resolving conditional operations or patches, the potential interdependencies are not necessarily known until each entry is being processed - so because entries are processed separately, the ones already processed cannot be rolled back. It would be problematic to "half process" each entry (doing reads and searches) just to validate this constraint before doing a second pass, since the batch is not a transaction.
I'm not sure what expectations other implementers have used for this situation.
Lloyd McKenzie (Sep 30 2021 at 22:39):
I think it's up to the server. It could toss the whole batch after a preliminary analysis, could toss the batch entries after the point it finds a problem, could proceed on a best-effort basis to process those without dependencies, or could even try to manage dependencies and process things in an order that allows the dependencies to be satisfied.
Last updated: Apr 12 2022 at 19:14 UTC