vmx / couchdb

Mirror of Apache CouchDB
81 stars 4 forks source link

Vtree breaks when emptied #11

Closed joshuamiller closed 13 years ago

joshuamiller commented 13 years ago

I tried and failed to come up with a patch for this that works, but I've at least narrowed down the problem, which resides here: https://github.com/vmx/couchdb/blob/geocouch/src/vtree/vtree.erl#L51

When the vtree is empty, delete/4 returns empty, but that line only matches against {ok, Response}. Hence, once you delete all records from a DB and then attempt to add more, you get errors along these lines: https://gist.github.com/745597#L12

Just messing around, I added a match against {empty, RootPos} and returned that from delete(), but it doesn't sync correctly, so I apparently don't understand the vtree implementation correctly.

vmx commented 13 years ago

Fixed in head (in geocouch [1] and gc-separate branch [2])

[1] https://github.com/vmx/couchdb/commit/19bf4b9900026d9002c567776edbab5c8e9102d3 [2] https://github.com/vmx/couchdb/commit/d0b0131d34454f13d5d5a7d94c0abe36e546c121