Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition with ddoc deletion/recreation with same signature #647

Open
wohali opened this issue Jul 5, 2017 · 0 comments
Open

Race condition with ddoc deletion/recreation with same signature #647

wohali opened this issue Jul 5, 2017 · 0 comments

Comments

@wohali
Copy link
Member

wohali commented Jul 5, 2017

See #548 for the history on this one. Quoting @kocolosk on how our test suite worked prior to #646 landing:

In many cases we have consecutive invocations where the ddocs have the same computed signature. It looks like we're hitting a race condition where we request to delete a ddoc, the server starts closing all the associated indexes, we create a new one with the same sig, the coordinator grabs an Fd from the cache with that sig, and the Fd is closed underneath it during the response.

And to motivate continued work on this:

I think it is possible to observe this bug in normal operations, especially if a user is following the best practice around ddoc upgrades. Deleting the temporary ddoc after migrating the main one could easily kill any in-progress view responses.

Expected Behaviour

Deleting, then recreating a ddoc with the same body (and thus the same computed signature) should not hit a race condition where the newly created ddoc indexes get reaped by the previously invoked ddoc deletion - especially when following the CouchDB best practice around ddoc upgrades in production environments.

Current Behaviour

See the overview above.

Steps to Reproduce (for bugs)

Wind your repository back prior to #646 landing and run the reduce_builtin.js test suite in a loop.
We should write a new test harness for just this bug, should be easy to hit if we do so from within Erlang, for instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant