| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
Fix b3 header
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
| |
There were couple of hacks in test/elixir/lib/couch.ex
We've got changes needed to remove them into httpotion 3.1.3.
The changes were introduced in:
- https://github.com/myfreeweb/httpotion/pull/118
- https://github.com/myfreeweb/httpotion/pull/130
|
|\
| |
| | |
Add http reporter
|
|/ |
|
|\
| |
| | |
reserve search namespace
|
|/ |
|
|\
| |
| | |
Delete unused ets table creation
|
|/
|
|
|
|
| |
This ets table was a holdover from when couch_expiring_cache was a non-
library OTP application. It is unused, and would prevent multiple users
of the library in the same project.
|
|\
| |
| | |
Bump ioq to 2.1.3
|
|/ |
|
|
|
|
|
| |
Changes map indexes to store the original key and value in a single
FDB row.
|
|\
| |
| | |
Add `external` tag to opentrace events
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR adds an ability to selectively enable opentracing for HTTP requests
with X-B3-... headers. This is helpful in following cases:
- tracing all requests with X-B3-... headers
`all = (#{external := E}) when E == true -> true`
- tracing all requests to specific database with X-B3-... headers
```
all = (#{external := E, 'db.name' := Db})
when E == true andalso Db == <<"foo">> -> true
```
- tracing requests to specific endpoint with X-B3-... headers
```
db.design.view.read = (#{external := E, 'design.id' := Name})
when E == true andalso Name == <<"bar">> -> true
```
I want to remind that we support following X-B3-... headers:
- X-B3-TraceId
- X-B3-SpanId
- X-B3-ParentSpanId
- B3 which is in the following format
<TraceId>-<SpanId>-<1 | 0>-<ParentSpanId>
|
|
|
|
|
|
|
|
|
| |
Previously the per-request nonce value was set as the transaction name and so
in the trace logs multiple transactions ended up having the same `TransactionID`
which was pretty confusing.
To fix the issue, append a transaction ID to the name. The ID is guaranteed to
be unique for the life of the VM node.
|
|\
| |
| | |
Expiring cache
|
|/
|
|
|
|
|
|
|
|
| |
This is a library for creating an FDB backed key value cache, where
each entry has a `stale` and `expires` time associated with it. Once
the current time exceeds the `expires` time, the entry is automatically
removed. The `stale` time can be used to indicate that a refresh is
necessary, while still returning a non-expired value. It is potentially
useful for implementing e.g. caches to external systems of record, such
as OAuth 2.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes attachment handling to properly remove attachment data when
it is no longer referenced by the document's revision tree.
As implemented this accounts for the possibility that multiple revisions
may reference a given attachment id. However, due to how the current
revision tree removes revisions aggressively it's not currently possible
for multiple leaf revisions to share an underlying attachment. This is
because when attempting to use a stub attachment when replicating in a
conflict we will encounter the `missing_stub` error because the previous
shared revision has already been removed.
|
| |
|
|
|
|
|
| |
This change ensures that all test names are visible and follows a single
unified pattern for each test module.
|
|
|
|
|
| |
Retry building a failing index for a set number of retries. If it
never completes, then return the error to the user.
|
|
|
|
|
| |
If the view is already built, read the view status and view
in the same transaction. This will improve view read latency.
|
| |
|
|
|
|
|
|
| |
This adds operation names to all valid HTTP end points. This covers all
of `make elixir` except for seven requests that are testing specific
error conditions in URL and Methods for various endpoints.
|
|
|
|
|
|
| |
The implementation follows the RFC [1]
[1]: https://github.com/apache/couchdb-documentation/blob/master/rfcs/013-node-types.md
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, membership check was disabled when fetching the security doc. That
was not correct, as membership should be checked before every db operation,
including when fetching the security doc itself.
Also, most of the security tests relied on patching the user context in the
`Db` handle then calling `check_*` functions. Those functions however call
`get_security/1` before doing the actual check, and in some cases, like when
checking for admin, the failure was coming from the membership check in
`get_security/1` instead. Also some tests were going through the regular
request path of opening a new db by name. In order, make the tests more
uniform, switch all the tests to apply the tested `UserCtx` in the open call.
|
|
|
|
|
|
| |
Forgot to push this in the previous PR so made a new commit.
https://github.com/apache/couchdb/pull/2300#discussion_r346592418
|
|
|
|
|
|
|
|
|
|
|
| |
Previously `set_config/3` needed keys and values to be transalted to binaries,
now that is done inside the function. It's a bit more consistent as binary
config values and encodings are better encapsulated in the `fabric2_fdb`
module.
Since `set_config` does, it made sense to update get_config as well. There, it
turns out it was used only to load configuration setting after a db open, so
the function was renamed to `load_config` and was made private.
|
|
|
|
|
|
|
|
|
| |
Previously, a stale db handle could be re-used across a few separate
transactions. That would result in the database getting re-opened before every
one of those operations.
To prevent that from happening, check the cache before the transaction starts,
and if there is a newer version of the db handle and use that.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we checked security properties in a separate transaction, after
opening the db or fetching it from the cache. To avoid running an extra
transaction move the check inside the main transaction right after the metadata
check runs. That ensure it will be consistent and it won't be accidentally
missed as all operations run the `ensure_current` metadata check.
Also remove the special `get_config/2` function in `fabric2_fdb` for getting
revs limit and security properties and just read them directly from the db map.
|
|
|
|
| |
Users should be able to replicate their partitioned dbs to the new environment.
|
|\
| |
| | |
Pass contexts to fabric2_db functions
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since the db structure returned from fabric2_db:open and fabric2_db:create
includes `user_ctx` there is no need to pass it explicitly
in every `fabric2_db` call. This means we can simplify few things:
- Don't pass user_ctx in `chttpd_db:db_req/2` since we pass db already
- Don't have to use `db_open_options` in `chttpd_changes`
- Don't have to pass `user_ctx` to `fabric2_db:open_doc` and `fabric2_db:update_doc`
|
| |
| |
| |
| |
| | |
If we don't explicitly bail out of running the job it will loop
indefinitely in the couch_jobs retry logic.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Need to use FDB version 6.1+ and erlfdb version that has this commit:
https://github.com/cloudant-labs/couchdb-erlfdb/commit/7718a3d7e1994e1384c56d39fae5cad3d8c6c4b3
Since fabric2.hrl is a public include now, use that in couch_jobs to avoid
redefining a bunch of things.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Since we are dealing with upgrades and both versions start out as binaries,
make sure we add extra belts and suspenders to surface any issues with encoding
errors.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously local docs were not chunkified and it was possible for replications
which checkpointed a few dozen times to create local documents above the 100KB
limit.
Documents are chunkiefied according to the same scheme as the regular docs --
rev values are in a main `?DB_LOCAL_DOCS` subspace, and doc body chunks in a
separate `?DB_LOCAL_DOC_BODIES` subspace that looks like:
{?DB_LOCAL_DOC_BODIES, DocId, ChunkId} = BinaryChunk
where `ChunkId` is an incrementing integer and BinaryChunk is a 100KB chunk of
the term_to_binary of the body.
We also go to some lengths to read and silently upgrade docs written with the
old encoding. Upgrades happen on doc writes as a first step, to ensure stats
update logic is not affected.
|
|\ \
| | |
| | | |
Remove old clause which is no longer used
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The history of `send_error(_Req, {already_sent, Resp, _Error})`
clause is bellow:
- it was added on [2009/04/18](https://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?r1=762574&r2=765819&diff_format=h)
- we triggered that clause [in couch_httpd:do](https://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?revision=642432&view=markup#l88)
- at that time we were using inets webserver [see use of `httpd_response/3`](https://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?revision=642432&view=markup#l170)
- The inets OTP codebase uses `already_sent` messages [here](https://github.com/erlang/otp/blob/50214f02501926fee6ec286efa68a57a47c2e531/lib/inets/src/http_server/httpd_response.erl#L220)
It should be safe to remove this clause because we are not using inets anymore
and search of `already_sent` term across all dependencies doesn't return any results.
|
|\ \
| |/
|/| |
Remove compiler warning
|
|/ |
|