Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
609a45d
Update build system for FoundationDB
davisp Jun 5, 2019
9178462
Disable eunit test suite in fabric
davisp Jun 5, 2019
373b42e
Initial fabric2 implementation on FoundationDB
davisp Jun 5, 2019
29df909
Initial test suite for the fabric2 implementation
davisp Jun 5, 2019
9083da6
Update ddoc_cache to use fabric2
davisp Jun 5, 2019
0cf5f46
Start switching chttpd HTTP endpoints to fabric2
davisp Jun 5, 2019
716d5b3
Remove debug logging
davisp Jun 6, 2019
c4f1182
Implement attachment compression
davisp Jun 6, 2019
ad31f51
Fix fabric2_txids:terminate/2
davisp Jun 7, 2019
1876962
Fix revision generation on attachment upload
davisp Jun 7, 2019
bc8007b
Convert attachment info to disk terms correctly
davisp Jun 7, 2019
f7a790e
Allow for previously configured filters
davisp Jun 10, 2019
da85a5c
Fix validate_doc_update when recreating a document
davisp Jun 10, 2019
5e12e06
Database config changes should bump the db version
davisp Jun 10, 2019
3931685
Implement `_users` db authentication
davisp Jun 7, 2019
d16cb14
Update get security to use fabric2
eiri Jun 20, 2019
920e1ff
Fix arity in changes timeout callback
eiri Jun 20, 2019
b9ee168
Fix exception in cache auth doc update
eiri Jun 20, 2019
0c2d674
CouchDB background jobs
nickva Jun 12, 2019
40561bc
Remove tests for deprecated features.
davisp Jun 18, 2019
a8e306d
Implement _all_dbs/_all_docs API parameters
davisp Jun 19, 2019
633d894
Fix bulk docs error reporting
davisp Jul 11, 2019
bf9fa0a
Fix `COPY` method
davisp Jul 11, 2019
e5fefbe
Fix revision tree extensions
davisp Jul 12, 2019
7696999
Implement `POST /_dbs_info`
davisp Jul 12, 2019
79ea59e
Fix formatting of all_docs_test.exs
davisp Jul 12, 2019
858c947
Reinitialize chttpd_auth_cache on config change
davisp Jul 12, 2019
8e574e9
Disable broken couch_att tests
davisp Jul 12, 2019
d42d9b7
Expose ICU ucol_getSortKey
chewbranca Jul 2, 2019
7a3bfe6
Fix more elixir tests
davisp Jul 16, 2019
24c864d
Make fabric2.hrl public
davisp Jul 23, 2019
d5a5426
Expose the is_replicator_db and is_user_db logic
davisp Jul 16, 2019
a545b49
Fix default key ranges for fold_range
davisp Jul 25, 2019
9ff8fa1
CouchDB map indexes on FDB
garrensmith Jun 17, 2019
d6e856d
Fix job handling to halt on errors
davisp Aug 1, 2019
554c594
Update to use new fold_range_future/wait functions
davisp Aug 6, 2019
0ea5237
Write large documents in chunks
davisp Aug 6, 2019
acfe3fa
Remember to remove old doc bodies
davisp Aug 6, 2019
3f447c4
Configurable FDB directory prefixes for CouchDB instances
nickva Aug 12, 2019
ba3cd0a
only fetch 1 query server for indexing
garrensmith Aug 15, 2019
68e8c85
Add timeout for 'fold_docs-with_different_keys' test
iilyak Aug 16, 2019
66f8205
Merge pull request #2123 from cloudant/add-timeout-to-fold_docs_with_…
iilyak Aug 19, 2019
48969ab
add trace test for couch_views
garrensmith Aug 22, 2019
6d1a8d9
Implement fabric2_db EPI plugin
nickva Aug 22, 2019
ea1cba5
Fix DB reopen behavior
nickva Aug 22, 2019
10a6011
Open dbs with admin privileges in couch_views_indexer
nickva Aug 22, 2019
d4db3c8
Implement update_seq for couch_views
nickva Aug 22, 2019
aca2878
Move fabric2_dir_prefix_tests to test directory
nickva Aug 22, 2019
fddc7ee
Fix couch_views encoding test
nickva Aug 23, 2019
9919496
Skip before_doc_update processing for local docs
nickva Aug 29, 2019
5aed0fd
Remove debug logging in fabric2_db_plugin
nickva Aug 29, 2019
dc1b4b8
Fix starkey_docid, endkey_docid and inclusive_end=false for _all_docs
nickva Aug 29, 2019
d5d5b5f
Implement _all_docs/queries
nickva Aug 30, 2019
247bbef
Implement _design_docs and _local_docs
nickva Aug 31, 2019
d6b6155
Add a max db name length config option
nickva Sep 5, 2019
198306c
Handle update_seq for _local_docs
nickva Sep 5, 2019
1c1d326
Handle _changes since=now param
nickva Sep 9, 2019
2074412
Fetch docs in parallel for view indexing
garrensmith Sep 9, 2019
5c3517a
Fix _changes heartbeat option
nickva Sep 9, 2019
91dfd3e
Support `--extra_args` parameter in `dev/run`
iilyak Sep 10, 2019
5ffdb91
Merge pull request #2184 from cloudant/add-extra-arguments-to-beam
iilyak Sep 11, 2019
2eb1dee
Implement setting and getting _revs_limit
nickva Sep 16, 2019
9c6b5cb
Make get_security and get_revs_limit calls consistent
nickva Sep 16, 2019
2051bd6
Check members after db is opened
nickva Sep 19, 2019
01a9228
Add revision stemming for interactive docs
nickva Sep 20, 2019
eed8fb1
Fix doc counts for replicated deletions
nickva Sep 24, 2019
fe9ffad
Add more deleted docs replication cases to integration test
nickva Sep 24, 2019
422416a
Add couch_eval abstraction layer
garrensmith Aug 14, 2019
41b7211
Initial creation of couch_js application
davisp Aug 20, 2019
87379c2
Implement couch_js callbacks for couch_eval
davisp Aug 20, 2019
ecc9ae4
Add tests for couch_js application
davisp Aug 20, 2019
d7d32a0
Update couch_views to use couch_eval
davisp Aug 20, 2019
ff2cdb8
Fix mango index validation
davisp Sep 27, 2019
577dd7f
Fix timeout in couch_views
nickva Oct 3, 2019
76bdf1b
DRY out CouchDB FDB prefix fetching
nickva Oct 14, 2019
ae0dc96
Use a shorter name for create_or_open_couchdb_dir
nickva Oct 15, 2019
bfb986f
Enable FDB transaction tracing
nickva Oct 16, 2019
f3d572c
Take better advantage of metadata version key feature
nickva Oct 17, 2019
797fe08
Remove old clause which is no longer used
iilyak Sep 25, 2019
3f322a5
Remove compiler warning
iilyak Oct 1, 2019
ed1c3d7
Merge pull request #2274 from cloudant/fix-warning
iilyak Oct 24, 2019
c3ef462
Merge pull request #2275 from cloudant/remove-ints-client-remains
iilyak Oct 24, 2019
5334997
Chunkify local docs
nickva Oct 22, 2019
3ded0e5
Add a special error for an invalid legacy local doc revsion
nickva Oct 24, 2019
583d7fe
Pass contexts to fabric2_db functions
iilyak Oct 1, 2019
987efb3
add test to prove we can view swap
garrensmith Oct 28, 2019
8d5c107
Use "\xFF/metadataVersion" key for checking metadata
nickva Oct 30, 2019
8bb0718
Abandon a view job if the db or ddoc is deleted
davisp Oct 30, 2019
8d28d85
Merge pull request #2279 from cloudant/refactor-user-ctx-handling
iilyak Oct 31, 2019
3db0ba7
Ensure we can create partitioned design docs with FDB
nickva Nov 4, 2019
aaae564
Check security properties in the main transaction
nickva Nov 5, 2019
b71cbe2
Before starting a db transanction, refresh the db handle from the cache
nickva Nov 8, 2019
44f660f
Update fabric2_fdb's set_config to take un-encoding values
nickva Nov 14, 2019
b58dc30
Assert Db handle field existence in `load_config/1` in fabric2_fdb
nickva Nov 14, 2019
706acca
Check membership when calling get_security/1 in fabric2_db
nickva Nov 15, 2019
2d3737c
Support regexp based blacklist in config
iilyak Nov 12, 2019
c9b8e25
Implement fabric2_server:fdb_cluster/0
iilyak Nov 12, 2019
e93d1b4
Add ctrace application
iilyak Nov 12, 2019
98bc5ea
Trace http endpoints
iilyak Nov 12, 2019
4680884
Trace fdb transactions
iilyak Nov 12, 2019
5e47f50
Implement node types
nickva Nov 21, 2019
be22ef9
Add operation names for all HTTP endpoints
davisp Nov 21, 2019
3c2b92c
Change end-point /_up to check fdb connectivity
eiri Nov 22, 2019
0cea6a4
Optimize view read latency when the view ready
garrensmith Nov 26, 2019
2247c80
Retry for failed indexes builds
garrensmith Nov 25, 2019
788538d
Normalize fabric2 test suite
davisp Dec 4, 2019
77e6901
Silence test suite warning message about crypto
davisp Dec 9, 2019
cea9274
Delete attachments when no longer referenced
davisp Dec 6, 2019
2f7957c
Expiring cache
jaydoane Dec 11, 2019
b3899c4
Merge pull request #2331 from cloudant/expiring-cache
jaydoane Dec 11, 2019
ab4eafa
Improve transaction name setting when tracing FDB transactions
nickva Dec 18, 2019
963f84b
Add `external` tag to opentrace events
iilyak Jan 14, 2020
6b1da76
Merge pull request #2451 from cloudant/tracing-external
iilyak Jan 21, 2020
ecaf215
Change map indexes to be stored in one row
garrensmith Jan 16, 2020
ea23fa1
Bump ioq to 2.1.3
eiri Jan 28, 2020
34be5dd
Merge pull request #2495 from apache/prototype/fdb-layer-bump-ioq
eiri Jan 28, 2020
b6c8a21
Delete unused ets table creation
jaydoane Jan 29, 2020
d81356f
Merge pull request #2499 from apache/expiring-cache-cleanup
jaydoane Jan 29, 2020
1496c49
reserve search namespace
rnewson Jan 29, 2020
7045d62
Merge pull request #2503 from apache/reserve-search-namespace
rnewson Jan 29, 2020
bd3c021
Support jaeger http reporter
iilyak Jan 17, 2020
7e0c5bb
Merge pull request #2494 from cloudant/add-http-reporter
iilyak Jan 30, 2020
bf39736
Update httpotion to 3.1.3
iilyak Aug 19, 2019
8650a4e
Support setting base_url in Couch test helper
iilyak Feb 4, 2020
3b9f04d
fix b3 - Headers suppose to be strings
iilyak Feb 4, 2020
d233f81
Add basic test case for b3 fix
iilyak Feb 4, 2020
f431566
Merge pull request #2519 from cloudant/fix-b3-header
iilyak Feb 4, 2020
02e4456
Add SpiderMonkey version option to configure
davisp Dec 2, 2019
e8788b3
Enable multi-version SpiderMonkey support
davisp Dec 2, 2019
5602a9f
Import SpiderMonkey 60 based CouchJS sources
jiangphcn Sep 19, 2019
ce4d670
Allow configuring the use of SpiderMonkey 60
davisp Dec 2, 2019
fa97eee
Add Javascript to support Spidermonkey 60
jiangphcn Dec 3, 2019
9fb6f45
Fix SM60 build on Mac (#2401)
janl Jan 6, 2020
d4328de
Disable JIT compiler on SpiderMonkey 60
davisp Jan 13, 2020
32d55d7
Match the OOM beahvior of 1.8.5
davisp Jan 6, 2020
5ad9d78
Remove allowance for unnamed_error
davisp Jan 6, 2020
b06ded5
Force OOM error
davisp Feb 6, 2020
790163b
Fix double "make clean"
wohali Dec 31, 2019
072d957
fixes the SM60 couchjs build by telling windows.h not to redefine min
jiangphcn Feb 10, 2020
150254f
hack required until switch to enc/rebar3 for windows build
jiangphcn Feb 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
.venv
.DS_Store
.rebar/
.rebar3/
.erlfdb/
.eunit/
log
apache-couchdb-*/
Expand All @@ -33,34 +35,37 @@ share/www
src/b64url/
src/bear/
src/config/
src/couch/priv/couch_js/config.h
src/couch/priv/couch_js/**/config.h
src/couch/priv/couchjs
src/couch/priv/couchspawnkillable
src/couch/priv/couch_ejson_compare/couch_ejson_compare.d
src/couch/priv/couch_js/http.d
src/couch/priv/couch_js/main.d
src/couch/priv/couch_js/utf8.d
src/couch/priv/couch_js/util.d
src/couch/priv/couch_js/**/*.d
src/couch/priv/icu_driver/couch_icu_driver.d
src/mango/src/mango_cursor_text.nocompile
src/docs/
src/erlfdb/
src/ets_lru/
src/fauxton/
src/folsom/
src/hqueue/
src/hyper/
src/ibrowse/
src/ioq/
src/hqueue/
src/jaeger_passage/
src/jiffy/
src/ken/
src/khash/
src/local/
src/meck/
src/mochiweb/
src/oauth/
src/passage/
src/proper/
src/rebar/
src/smoosh/
src/snappy/
src/thrift_protocol/
src/triq/
tmp/

Expand Down
57 changes: 57 additions & 0 deletions FDB_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Things of Note
===


1. If a replication sends us two revisions A and B where one is an
ancestor of the other, we likely have divergent behavior. However,
this should never happen In Theory.

2. Multiple updates to the same document in a _bulk_docs (or if they
just happen to be in the same update batch in non-fdb CouchDB)
we likely have subtly different behavior.

3. I'm relying on repeated reads in an fdb transaction to be "cheap"
in that the reads would be cached in the fdb_transaction object.
This needs to be checked for certainty but that appeared to
be how things behaved in testing.

4. When attempting to create a doc from scratch in an interacitve_edit
update, with revisions specified *and* attachment stubs, the reported
error is now a conflict. Previously the missing_stubs error was
raised earlier.

5. There may be a difference in behavior if a) there are no VDU functions
set on a db and no design documents in a batch. This is because in
this situation we don't run the prep_and_validate code on pre-fdb
CouchDB. The new code always checks stubs before merging revision trees.
I'm sure the old way would fail somehow, but it would fail further on
which means we may have failed with a different reason (conflict, etc)
before we got to the next place we check for missing stubs.

6. For multi-doc updates we'll need to investigate user versions on
versionstamps within a transaction. Also this likely prevents the
ability to have multiple updates to the same doc in a single
_bulk_docs transaction

7. Document body storage needs to be implemented beyond the single
key/value approach.

8. We'll want to look at how we currently apply open options to individual
elements of an open_revs call. Might turn out that we have to grab a
full FDI even if we could look up a rev directly. (i.e., revs_info
would require us having the entire FDI, however it'd be wasteful to return
all of that in an open_revs call, but bug compatibility ftw!)

9. Is it possible that a server_admin can delete a db without being able
to open it? If so that's probably changed behavior.

10. All docs on large active databases might be a thing getting the doc
count. If we allow range requests up to 5s, and we continue to return
the doc count total we may have to play games with snapshot reads on
the doc count key or else it'll whack any _all_docs range requests

11. Revision infos need to track their size f we want to maintain a database
size counter we'll want to store the size of a given doc body for each
revision so that we don't have to read the old body when updating the tree.

12. Update sequences do not yet include an incarnation value.
55 changes: 55 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,61 @@ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.


for share/server/60/esprima.js
Based on https://github.com/jquery/esprima

BSD License

Copyright JS Foundation and other contributors, https://js.foundation/

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



share/server/60/escodegen.js
Based on https://github.com/estools/escodegen

BSD License

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


for src/fauxton/assets/less/bootstrap/font-awesome/*
for share/www/css/*

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@ python-black-update: .venv/bin/black
.PHONY: elixir
elixir: export MIX_ENV=integration
elixir: elixir-init elixir-check-formatted elixir-credo devclean
@dev/run -a adm:pass --no-eval 'mix test --trace --exclude without_quorum_test --exclude with_quorum_test $(EXUNIT_OPTS)'
@dev/run --erlang-config=rel/files/eunit.config -n 1 -a adm:pass --no-eval 'mix test --trace --exclude without_quorum_test --exclude with_quorum_test $(EXUNIT_OPTS)'

.PHONY: elixir-only
elixir-only: devclean
@dev/run --erlang-config=rel/files/eunit.config -n 1 -a adm:pass --no-eval 'mix test --trace --exclude without_quorum_test --exclude with_quorum_test $(EXUNIT_OPTS)'

.PHONY: elixir-init
elixir-init:
Expand Down
8 changes: 8 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ This product also includes the following third-party components:

Copyright (c) 2015 Twitter, Inc.

* esprima.js (https://github.com/jquery/esprima)

Copyright JS Foundation and other contributors, https://js.foundation/

* escodegen.js (https://github.com/estools/escodegen)

Copyright (C) 2012 Yusuke Suzuki (twitter: @Constellation) and other contributors.

* hyper

Copyright (c) 2014 Game Analytics ApS
23 changes: 23 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ERLANG_MD5="false"
SKIP_DEPS=0

COUCHDB_USER="$(whoami 2>/dev/null || echo couchdb)"
SM_VSN="1.8.5"

. ${rootdir}/version.mk
COUCHDB_VERSION=${vsn_major}.${vsn_minor}.${vsn_patch}
Expand All @@ -50,6 +51,7 @@ Options:
--disable-docs do not build any documentation or manpages
--erlang-md5 use erlang for md5 hash operations
--dev alias for --with-curl --disable-docs --disable-fauxton
--spidermonkey-version VSN specify the version of SpiderMonkey to use (defaults to $SM_VSN)
--skip-deps do not update erlang dependencies
--rebar=PATH use rebar by specified path (version >=2.6.0 && <3.0 required)
EOF
Expand Down Expand Up @@ -140,6 +142,24 @@ parse_opts() {
printf 'ERROR: "--user" requires a non-empty argument.\n' >&2
exit 1
;;

--spidermonkey-version)
if [ -n "$2" ]; then
eval SM_VSN=$2
shift 2
continue
else
printf 'ERROR: "--spidermonkey-version" requires a non-empty argument.\n' >&2
exit 1
fi
;;
--spidermonkey-version=?*)
eval SM_VSN=${1#*=}
;;
--spidermonkey-version=)
printf 'ERROR: "--spidermonkey-version" requires a non-empty argument.\n' >&2
exit 1
;;
--) # End of options
shift
break
Expand Down Expand Up @@ -180,6 +200,7 @@ cat > rel/couchdb.config << EOF
{log_file, "$LOG_FILE"}.
{fauxton_root, "./share/www"}.
{user, "$COUCHDB_USER"}.
{spidermonkey_version, "$SM_VSN"}.
{node_name, "-name couchdb@127.0.0.1"}.
{cluster_port, 5984}.
{backend_port, 5986}.
Expand All @@ -206,12 +227,14 @@ with_fauxton = $WITH_FAUXTON
with_docs = $WITH_DOCS

user = $COUCHDB_USER
spidermonkey_version = $SM_VSN
EOF

cat > $rootdir/config.erl << EOF
{with_curl, $WITH_CURL}.
{with_proper, $WITH_PROPER}.
{erlang_md5, $ERLANG_MD5}.
{spidermonkey_version, "$SM_VSN"}.
EOF

install_local_rebar() {
Expand Down
8 changes: 7 additions & 1 deletion configure.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
-DisableDocs request build process skip building documentation (default false)
-SkipDeps do not update Erlang dependencies (default false)
-CouchDBUser USER set the username to run as (defaults to current user)
-SpiderMonkeyVersion VSN select the version of SpiderMonkey to use (defaults to 1.8.5)

Installation directories:
-Prefix PREFIX install architecture-independent files in PREFIX
Expand Down Expand Up @@ -49,6 +50,8 @@ Param(
[ValidateNotNullOrEmpty()]
[string]$CouchDBUser = [Environment]::UserName, # set the username to run as (defaults to current user)
[ValidateNotNullOrEmpty()]
[string]$SpiderMonkeyVersion = "1.8.5", # select the version of SpiderMonkey to use (default 1.8.5)
[ValidateNotNullOrEmpty()]
[string]$Prefix = "C:\Program Files\Apache\CouchDB", # install architecture-independent file location (default C:\Program Files\Apache\CouchDB)
[ValidateNotNullOrEmpty()]
[string]$ExecPrefix = $Prefix, # install architecture-dependent file location (default C:\Program Files\Apache\CouchDB)
Expand Down Expand Up @@ -133,6 +136,7 @@ $CouchDBConfig = @"
{log_file, ""}.
{fauxton_root, "./share/www"}.
{user, "$CouchDBUser"}.
{spidermonkey_version, "$SpiderMonkeyVersion"}.
{node_name, "-name couchdb@localhost"}.
{cluster_port, 5984}.
{backend_port, 5986}.
Expand All @@ -144,7 +148,7 @@ $InstallMk = @"
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
Expand Down Expand Up @@ -175,12 +179,14 @@ with_fauxton = $BuildFauxton
with_docs = $BuildDocs

user = $CouchDBUser
spidermonkey_version = $SpiderMonkeyVersion
"@
$InstallMk | Out-File "$rootdir\install.mk" -encoding ascii

$lowercurl = "$WithCurl".ToLower()
$ConfigERL = @"
{with_curl, $lowercurl}.
{spidermonkey_version, "$SpiderMonkeyVersion"}.
"@
$ConfigERL | Out-File "$rootdir\config.erl" -encoding ascii

Expand Down
25 changes: 23 additions & 2 deletions dev/run
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ def setup_logging(ctx):


def setup_argparse():
parser = get_args_parser()
return parser.parse_args()


def get_args_parser():
parser = optparse.OptionParser(description="Runs CouchDB 2.0 dev cluster")
parser.add_option(
"-a",
Expand Down Expand Up @@ -180,6 +185,12 @@ def setup_argparse():
default=[],
help="Optional key=val config overrides. Can be repeated",
)
parser.add_option(
"--erlang-config",
dest="erlang_config",
default="rel/files/sys.config",
help="Specify an alternative Erlang application configuration"
)
parser.add_option(
"--degrade-cluster",
dest="degrade_cluster",
Expand All @@ -200,7 +211,13 @@ def setup_argparse():
action="store_true",
help="Select available ports for nodes automatically",
)
return parser.parse_args()
parser.add_option(
"--extra_args",
dest="extra_args",
default=None,
help="Extra arguments to pass to beam process",
)
return parser


def setup_context(opts, args):
Expand All @@ -222,7 +239,9 @@ def setup_context(opts, args):
"haproxy": opts.haproxy,
"haproxy_port": opts.haproxy_port,
"config_overrides": opts.config_overrides,
"erlang_config": opts.erlang_config,
"no_eval": opts.no_eval,
"extra_args": opts.extra_args,
"reset_logs": True,
"procs": [],
"auto_ports": opts.auto_ports,
Expand Down Expand Up @@ -559,7 +578,7 @@ def boot_node(ctx, node):
"-args_file",
os.path.join(node_etcdir, "vm.args"),
"-config",
os.path.join(reldir, "files", "sys"),
os.path.join(ctx["rootdir"], ctx["erlang_config"]),
"-couch_ini",
os.path.join(node_etcdir, "default.ini"),
os.path.join(node_etcdir, "local.ini"),
Expand All @@ -578,6 +597,8 @@ def boot_node(ctx, node):
mode = "r+b"
logfname = os.path.join(ctx["devdir"], "logs", "%s.log" % node)
log = open(logfname, mode)
if "extra_args" in ctx and ctx["extra_args"]:
cmd += ctx["extra_args"].split(" ")
cmd = [toposixpath(x) for x in cmd]
return sp.Popen(cmd, stdin=sp.PIPE, stdout=log, stderr=sp.STDOUT, env=env)

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule CouchDBTest.Mixfile do
# Run "mix help deps" to learn about dependencies.
defp deps() do
[
{:httpotion, "~> 3.0", only: [:dev, :test, :integration], runtime: false},
{:httpotion, ">= 3.1.3", only: [:dev, :test, :integration], runtime: false},
{:jiffy, path: Path.expand("src/jiffy", __DIR__)},
{:ibrowse,
path: Path.expand("src/ibrowse", __DIR__), override: true, compile: false},
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%{
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"},
"credo": {:hex, :credo, "1.0.5", "fdea745579f8845315fe6a3b43e2f9f8866839cfbc8562bb72778e9fdaa94214", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"httpotion": {:hex, :httpotion, "3.1.2", "50e3e559c2ffe8c8908c97e4ffb01efc1c18e8547cc7ce5dd173c9cf0a573a3b", [:mix], [{:ibrowse, "== 4.4.0", [hex: :ibrowse, repo: "hexpm", optional: false]}], "hexpm"},
"httpotion": {:hex, :httpotion, "3.1.3", "fdaf1e16b9318dcb722de57e75ac368c93d4c6e3c9125f93e960f953a750fb77", [:mix], [{:ibrowse, "== 4.4.0", [hex: :ibrowse, repo: "hexpm", optional: false]}], "hexpm"},
"ibrowse": {:hex, :ibrowse, "4.4.0", "2d923325efe0d2cb09b9c6a047b2835a5eda69d8a47ed6ff8bc03628b764e991", [:rebar3], [], "hexpm"},
"jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"},
"jiffy": {:hex, :jiffy, "0.15.2", "de266c390111fd4ea28b9302f0bc3d7472468f3b8e0aceabfbefa26d08cd73b7", [:rebar3], [], "hexpm"},
Expand Down
Loading