janelia-flyem / dvid

Distributed, Versioned, Image-oriented Dataservice
http://dvid.io
Other
196 stars 33 forks source link

Validate inputs to /mapping #265

Closed stuarteberg closed 6 years ago

stuarteberg commented 6 years ago

As discussed in today's software meeting, it would be nice if the /mapping endpoint fails when a non-existent supervoxel is given as the input. Similarly, the bulk /mappings endpoint should not return supervoxels that no longer exist in the volume (e.g. due to splits).

If performance is a concern, the /mapping endpoint could support query string flag which, if set, tells DVID to assume that the input supervoxels are valid, and thus there is no need to verify their validity. However, please make the default behavior "safer but slower" -- i.e. check the client's inputs.

DocSavage commented 6 years ago

Rather than have /mapping completely fail, since it is a batch query, non-existant supervoxels will return a zero label to indicate it no longer exists.

DocSavage commented 6 years ago

While /mappings is now correct, the /mapping endpoint should, by default, always check the associated label index to see if the supervoxel actually exists. This can be circumvented if the internal mapping is not identity or 0 (previously split).