| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This reverts commit 4a73d035dc77c4074f5e3c8d8bcf900138c91eb6.
|
|
|
|
|
| |
Somehow managed to fix without getting it into the PSE PR that was
merged the other day.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously replicator used only basic authentication. It was simple and
straightforward. However, with PBKDF2 hashing becoming the default it would be
nice not to do all the password verification work with every single request,
and instead take advantage of session (cookie) based authentication.
This commit implements session based authentication via a plugin mechanism.
The list of available replicator auth modules is configurable. For example:
```
[replicator]
auth_plugins = couch_replicator_auth_session,couch_replicator_auth_basic
```
The plugins will be tried in order. The first one to successfully initialize
will end up being used for that endpoint (source or target).
During the initialization callback, a plugin could decide it cannot be used in
the current context. In that case it signals to be "ignored". The plugin
framework will then skip over it and try to initialize the next on in the list.
`couch_replicator_auth_basic` effectively implements the old behavior. This
plugin should normally be used as a default catch-all at the end of the plugin
list. In some cases, it might be useful to enforce exclusive use of
session-based auth and fail replication jobs if it is not available.
`couch_replicator_auth_session` does most of the work of handling session based
authentication. On initialization, it strips away basic auth credentials from
headers and url to avoid basic auth being used on the server. Then it is in
charge of periodically issuing POST requests to `_session`, updating the
headers of each request with the latest cookie value, and possibly picking up
new session cookie if the server can issue them along with reglar responses.
Currently session based auth plugin is not enabled by default and is an opt-in
feature. That is, users would have to explicitly add the session module to the
list of auth_plugins. In a future, session might be used by default.
As discussed in #1153 this work also removes OAuth 1.0 support. After
server-side support was removed, it had stopped working anyway since the main
oauth app was removed. However, with the plugin framework in place it would be
possible for someone to implement it as a separate module not entangled with
the rest of the replicator code.
Fixes #1153
|
| |
|
|
|
|
|
|
| |
This was left over from an earlier attempt at being a bit more strict on
removing access to the #db record. Its not used as is obvious by the
fact that the 2-arity version isn't even exported from the module.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we run Jenkins CI builds on 11 platforms:
Erlang 18.3 + [centos6|centos7|debian8|debian9|ubuntu1404|ubuntu1604]
"Default" (ships-with-the-distro) Erlang + [same list but not centos6]
The intent was ensure that CouchDB ran fine both with our preferred
Erlang version (right now, 18.3) as well as the Erlang that ships with
various common distributions. This would help ease consumption of
CouchDB by end users, we thought.
With CouchDB 2.1.0 we started providing convenience binary packages,
built with Erlang 18.3. This (along with Docker) has become the most
common way people consume CouchDB today. Those binaries are generated
directly from the Jenkins builds.
Further, Travis CI already runs our test suite against a variety of
Erlang distributions, from 16B03 right through 20.1 (as of today).
There is little value in the extra Jenkins runs at this point, beyond
catching any vagaries of distro-specific Erlang weirdness that we
would probably wash our hands of anyway.
This change removes 5 of our 11 platform builds. This will be valuable
as we move towards regression testing other platforms (ppc64le, arm).
It also lightens our load on the ASF Jenkins infrastructure.
NOTE that we will still need to maintain the Docker image for
ubuntu1404erlangdefault, as this contains 16B03, the earliest version
of Erlang that we support. The initial "Build" step in our Jenkins
run uses this to build the couchdb.tar.gz dist tarball, which is then
compiled and tested on each platform during the "Test" step.
|
|
|
|
|
|
|
| |
The compaction test takes quite a long time on purpose to show that we
can run a compaction that has many batches. On resource constrained
build machines like Jenkins and TravisCI this can end up taking longer
than the default 5s timeout.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This re-fixes a corner case when recreating a document with an
attachment in a single multipart request. Since we don't detect that we
need a new revision until after the document has been serialized we need
to be able to deserialize the body so that we can generate the same
revisions regardless of the contents of the database. If we don't do
this then we end up including information from the position of the
attachment on disk in the revision calculation which can introduce
branches in the revision tree.
I've left this as a separate commit from the pluggable storage engine
work so that its called out clearly for us to revisit.
COUCHDB-3255
|
|
|
|
|
|
|
|
| |
This allows other storage engine implementations to reuse the same exact
test suite without having to resort to shenanigans like keeping vendored
copies up to date.
COUCHDB-3287
|
|
|
|
|
|
|
|
|
| |
This change moves the main work of storage engines to run through the
new couch_db_engine behavior. This allows us to replace the storage
engine with different implementations that can be tailored to specific
work loads and environments.
COUCHDB-3287
|
|
|
|
|
|
|
|
| |
This is the legacy storage engine code. I've kept it as part of the core
couch application because we'll always need to have at least one
storage engine available.
COUCHDB-3287
|
|
|
|
|
|
|
|
| |
This is the primary API for pluggable storage engines. This module
serves as both a behavior and a call dispatch module for handling the
engine state updates.
COUCHDB-3287
|
|
|
|
|
|
|
|
|
|
| |
This relied on having introspection into the state of a #doc{} record
that is no longer valid with PSE. This is a harmless change as it was
only necessary when performing a rolling reboot to a version that
included the new get_meta_body_size function. We can remove it now
because anyone wanting to do a rolling reboot with PSE will have to step
through a version that includes commit aee57bf which includes the
previous upgrade logic as well.
|
|
|
|
|
|
|
|
|
| |
Occasionally it's possible to lose track of our RPC workers in the main
multipart parsing code. This change monitors each worker process and
then exits if all workers have exited before the parser considers itself
finished.
Fixes part of #745
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some cases the higher level code from `couch_replicator_api_wrap` needs to
handle retries explicitly and cannot cope with retries happening in the lower
level http client. In such cases it sets `retries = 0`.
For example:
https://github.com/apache/couchdb/blob/master/src/couch_replicator/src/couch_replicator_api_wrap.erl#L271-L275
The http client then should avoid unconditional retries and instead consult
`retries` value. If `retries = 0`, it shouldn't retry and instead bubble the
exception up to the caller.
This bug was discovered when attachments were replicated to a target cluster
and the target cluster's resources were constrainted. Since attachment `PUT`
requests were made from the context of an open_revs `GET` request, `PUT`
request timed out, and they would retry. However, because the retry didn't
bubble up to the `open_revs` code, the second `PUT` request would die with a
`noproc` error, since the old parser had exited by then. See issue #745 for
more.
|
| |
|
|
|
|
| |
This knocks out a few dialyzer errors
|
| |
|
|
|
|
|
|
|
| |
It depends on and uses `config`. Obviously it still works without it, but this
eliminates Dialyzer errors such as:
`Callback info about the config_listener behaviour is not available`
|
| |
|
| |
|
|\
| |
| | |
Remove queries for _all_docs, _design_docs and _local_docs
|
|/
|
|
| |
issue 820
|
|
|
|
| |
* make javascript, test-cluster-with[out]-quorum and mango tests dependent of devclean target
|
| |
|
|
|
|
|
|
|
|
| |
Add degrade-cluster option for cluster testing
Add tests for different cluster conditions with/without quorum
Add test-cluster-with-quorum and test-cluster-without-quorum tasks
|
|\
| |
| | |
Introduce new _dbs_info endpoint to get info of a list of databases
|
|/
|
|
| |
Fixes #822
|
|
|
|
| |
Fixes #1100
|
| |
|
|
|
|
| |
Fixes #977
|
|
|
|
|
|
| |
- don't display credential information for user who
just wants to check replication status. In basic authentication,
the credential information is available in header field of doc
|
|
|
|
|
| |
We removed the Dockerfile in 6e57c43a and moved all Docker-related
materials to apache/couchdb-docker, but we never cleaned up the
Makefile targets or developer documentation.
|
|
|
|
| |
Fixes #876
|
|\
| |
| |
| |
| | |
apache/fix-create_delete_database_continuously-test
Set eunit timeout on a whole test object
|
|/ |
|
|
|
|
| |
Fixes #820
|
| |
|
|\
| |
| | |
Return update_seq and offset when update_seq is true and keys is set
|
|/
|
|
| |
issue 969
|
|
|
|
|
| |
Fix a random mashup of test object generators
with normal assertions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The existing `couchdb` start script hard-codes the arguments to
`-args_file` and `-config`. Although it is possible to copy this
script and modify it, or modify it in place, that is less than ideal
and can lead to all kinds of difficulties.
This PR adds the following environment variables:
- `ARGS_FILE`: By default, set to the existing hard-coded value.
- `SYSCONFIG_FILE`: By default, set to the existing hard-coded value.
- `COUCHDB_ARGS_FILE`: If non-empty, overrides `ARGS_FILE`.
- `COUCHDB_SYSCONFIG_FILE`: If non-empty, overrides `SYSCONFIG_FILE`.
By changing the script to use these environment variables, it makes it easily
possible to use different settings without tinkering with the pristine
installed CouchDB environment.
|
|
|
|
|
|
|
|
| |
Change runtime choice between `erl_scan:token_info`
and `erl_scan:line` to compilation conditional one.
This is getting rid of compilation deprecation warning
and also should speed up things a bit.
|
|
|
|
|
|
|
| |
Avoid starting 4 applications (config, couch_log, ioq and couch_epi) just to
handle a call to config:get. Instead just mock the config directly.
This also speeds up the test suite a bit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mango text indexes historically supported partial indexes
defined via a "selector" field. This was renamed to
"partial_filter_selector" in b98de40 but the fallback
code did not correctly handle the case where
a "selector" existed alongside a "partial_filter_selector".
This situation can occur when a the _index endpoint is
used to create a text index with a "selector". The resulting
design document contains an empty "partial_filter_selector"
field *and* the "selector" field that was passed in. The
previous implementation of the fallback would detect the
presence of "partial_filter_selector" and use the empty
value (match all docs) instead of faling back to the
"selector" field.
This commit changes the behaviour so that a "selector"
will be used even if an empty "partial_filter_selector"
is present. A secondary fix would be to change the index
creation so that we never use "selector" in the underlying
index design document, even if it is passed to the _index
API.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Return friendly error message when creating user with invalid password
- Return friendly error message instead of returning unknown_error
and function_clause when creating a use with non-string password.
issue 1051
* Add check for salt
issue 1051
|
|\
| |
| | |
Make sure mango tests's recreate fun creates db
|
|/
|
|
|
|
|
|
|
|
| |
Rapid same database deletion/creation is a known
antipattern prone to a race condition, especially
on slow VMs.
This fix modifies mango test's helper function
used for db recreation to ensure that we are actually
starting tests when a database created and empty.
|
|\
| |
| | |
Use uuid in tmp db names in unit tests
|
|/
|
|
|
|
|
|
|
|
| |
This changes naming of temporary eunit databases
and files from using unique_monotonic_integer to
couch_uuids:random to remove performance penalty
and normalize naming across erlang releases.
Also getting rid of unnecessary inter-types
convertion.
|