janelia-flyem / dvid

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

cannot re-use instance name if it already exists on a different branch #345

Open stuarteberg opened 4 years ago

stuarteberg commented 4 years ago

For testing and development, it's often useful to create two test nodes in two different branches. But suppose I want to create a new instance named my-test-labelmap in each of the test nodes. I can create it in test node A, but when I go to create it in test node B, it doesn't work:

400 Client Error: Bad Request for url: http://emdata3:8900/api/repo/021d2ba85e554a348b9f2b79af57efef/instance?u=bergs&app=neuclease
Data named "my-test-labelmap" already exists in repo (root 28841c8277e044a7b187dda03e18da13) (/api/repo/021d2ba85e554a348b9f2b79af57efef/instance).

That's because the labelmap already exists, albeit in a different branch. On the DVID console, my instance doesn't appear in the instance list for node B, but I CAN fetch its /info.

DocSavage commented 4 years ago

So this raises a question we've debated before, which is whether an instance name should be allowed to refer to two different data instances in non-overlapping sub-DAGs. Each data instance has its own Data UUID but when you make a request using a name, the particular data instance is looked up by an internal DVID map.

The issue could be solved by rooting a data instance higher, but currently it doesn't let you create instances in locked nodes. (This would be relaxed in the future backend DAGStore.) But let's say that's allowed in the future, it would solve this issue to some degree. This doesn't solve the problem of wanting to group disjoint data instances that you didn't realize you wanted grouped but do now.

You believe, though, that my-test-labelmap should allow mapping to any number of disjoint data instances since the (version UUID, instance name) tuple is sufficient to disambiguate. Correct?