janelia-flyem / dvid

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

Explicit renumbering of body IDs #360

Closed stuarteberg closed 2 years ago

stuarteberg commented 2 years ago

For any reconstruction, we eventually aim to avoid letting a body change it's ID. Once a neuron is mostly complete, it's ID should remain constant, even if experiences minor merges or cleaves. But mistakes do happen. To fix those mistakes, we need a mechanism to renumber a body (back to its original ID).

One option is to introduce a new special-purpose endpoint (e.g. /change-id or /renumber, etc.). The new endpoint should also introduce a new type of message into the kafka/mutations log.

Another option is to add a parameter to the /cleave endpoint, which allows the user to specify exactly what the new body ID should be. Then, using a combination of /cleave and /merge, users could renumber bodies to an arbitrary ID. It's a slightly less direct way to achieve the same result, but presumably it requires almost no new implementation in DVID, and literally zero changes for clients which are currently implemented to consume the kafka/mutations log.

Note: If the /cleave endpoint permitted me to cleave off ALL supervoxels in a body, then the above procedure is even simpler -- no merge is necessary.

DocSavage commented 2 years ago

A simple solution was created that under-the-hood reuses the events and mutation logging for merges. There can be other data instances synced to a labelmap instance, requiring knowledge of what blocks have changed due to a renumbering. Fixed in commit f32bf18.