Ensure dreyfus index module is loaded #1
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In development mode (dev/run) the dreyfus_index module is loaded by
startup. For release mode no such loading is done, instead modules are
loaded "on demand". In mango code, all use of dreyfus_index is protected
by checking if module is loaded (by calling module_loaded(dreyfus_index)).
This commit adds startup.erl containing code to be run during startup
of couchdb release (rel/couchdb/bin/couchdb) that fixes the error
occuring from dreyfus_index not being loaded.
For a seasoned couchdb or erlang developer this might seem to be a
trivial thing to fix, as for them the use of .erlang in working directory
is a well-known feature. Others might find this useful as it makes
couchdb with dreyfus working "out-of-the-box" in release mode too.
Overview
Solves loading of dreyfus_index (and other modules) running couchdb in release mode.
Testing recommendations
Configure, build and start release mode:
bash$> ./configure --disable-fauxton --disable-docs
bash$> make release
bash$> ./rel/couchdb/bin/couchdb
In another shell, test create an index all text:
bash$> curl -XPUT -H "Content-Type: application/json" http://127.0.0.1:5984/test1
bash$> curl -XPOST -H "Content-Type: application/json" http://127.0.0.1:5984/test1/_index -d '{"index":{},"type":"text"}'
Related Issues or Pull Requests
Perhaps the startup.erl should be config protected by install as startup.erl.in from rel/reltool.config
Checklist