summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Avoid using plugin to validate dbnamefix-validate-dbnameJay Doane2020-02-201-2/+1
|
* Let couch_jobs use its own metadata keyNick Vatamaniuc2020-02-193-5/+45
| | | | | | | | | | | | | | | | Previously, if the metadata key is bumped in a transaction, the same transaction could not be used to add jobs with `couch_jobs`. That's because metadata is a versionstamped value, and when set, it cannot be read back until that transaction has committed. In `fabric2_fdb` there is a process dict key that is set which declares that metadata was already read, which happens before any db update, however `couch_jobs` uses it's own caching mechanism and doesn't know about that pdict key. Ideally we'd implement a single `couch_fdb` module to be shared between `couch_jobs` and `fabric2_db` but until then it maybe simpler to just let `couch_jobs` use its own metadata key. This way, it doesn't get invalidated or bumped every time dbs get recreated or design docs are updated. The only time it would be bumped is if the FDB layer prefix changed at runtime.
* Handle spurious 1009 (future_version) errors in couch_jobs pendingNick Vatamaniuc2020-02-183-1/+7
| | | | | | | | We already handle them in couch_jobs_type_monitor so let's do it in `couch_jobs:wait_pending` as well. Recent fixes in FDB 6.2 didn't completely fix the issue and ther are still spurious 1009 errors dumped in the logs. They seem to be benign as far as couch_jobs operation goes as type monitor code already showed, so let's not pollute the logs with them.
* Sync Makefile with master (#2566)Eric Avdey2020-02-182-186/+133
|
* Re-use changes feed main transaction when including docsNick Vatamaniuc2020-02-181-3/+7
| | | | | | | Previously each doc was read in a separate transaction. It turns out that size limits do not apply to read-only transactions so we don't have to worry about that here. Also transaction restart are already implemented so we don't have to worry about timeout either.
* Test coverage: apply_open_doc_optsPaul J. Davis2020-02-151-1/+98
|
* Test coverage: validate_dbname, validate_docidPaul J. Davis2020-02-151-0/+75
|
* Test coverage: get_full_doc_infoPaul J. Davis2020-02-151-0/+87
|
* Test coverage: list_dbs and list_dbs_infoPaul J. Davis2020-02-151-1/+30
|
* Convert versionstamps to binariesPaul J. Davis2020-02-151-1/+1
| | | | | Versionstamp sequences should always be binaries when retrieved from a rev info map.
* Add tests for database size trackingPaul J. Davis2020-02-152-0/+1238
|
* Track the size of data stored in a databasePaul J. Davis2020-02-156-29/+205
| | | | | | | | | | | | | | | | | | This tracks the number of bytes that would be required to store the contents of a database as flat files on disk. Currently the following items are tracked: * Doc ids * Revisions * Doc body as JSON * Attachment names * Attachment type * Attachment length * Attachment md5s * Attachment headers * Local doc id * Local doc revision * Local doc bodies
* Remove attachment headers fieldPaul J. Davis2020-02-151-17/+7
| | | | | I accidentally ported part of the old couch_att test suite into an actual "feature" that's not actually accessible through any API.
* Use {restart_tx, false} option in view index builder changes feedNick Vatamaniuc2020-02-151-1/+2
| | | | | Index builder performs writes in the same transaction as the changes feed so we can't use iterators as they disable writes.
* Implement mult-transactional iterators for _changes feedsNick Vatamaniuc2020-02-145-70/+364
| | | | | | | | | | | | | | | | | | Previously changes feeds would fail if they streamed data for more than five seconds. This was because of the FoundationDB's transaction time limit. After the timeout fired, an 1007 (transaction_too_long) error was raised, and transaction was retried. The emitted changes feed would often crash or simple hang because the HTTP state would be garbled as response data was re-sent over the same socket stream again. To fix the issue introduce a new `{restart_tx, true}` option for `fold_range/4`. This option sets up a new transaction to continue iterating over the range from where the last one left off. To avoid data being resent in the response stream, user callback functions must first read all the data they plan on sending during that callback, send it out, and then after that it must not do any more db reads so as not to trigger a `transaction_too_old` error.
* Support `GET /_dbs_info` endpointPaul J. Davis2020-02-131-1/+48
| | | | | Previously only `POST` with a list of keys was supported. The new `GET` support just dumps all database info blobs in a single ordered response.
* Implement `fabric2_db:list_dbs_info/1,2,3`Paul J. Davis2020-02-133-16/+126
| | | | | | This API allows for listing all database info blobs in a single request. It accepts the same parameters as `_all_dbs` for controlling pagination of results and so on.
* Implement async API for `fabric2_fdb:get_info/1`Paul J. Davis2020-02-131-0/+9
|
* Track a database level view size rollupPaul J. Davis2020-02-132-20/+33
| | | | | This way we can expose the total view size for a database in the dbinfo JSON blob.
* Fix doc attachment testsPaul J. Davis2020-02-131-2/+2
| | | | Attachment names should be binaries
* Encode startkey/endkey for all_docs (#2538)garren smith2020-02-133-16/+60
| | | | | | | * Encode startkey/endkey for all_docs Encodes the startkey/endkey so that if a startkey is not binary it will return the expected results.
* Merge pull request #2519 from cloudant/fix-b3-headeriilyak2020-02-046-112/+121
|\ | | | | Fix b3 header
| * Add basic test case for b3 fixILYA Khlopotov2020-02-042-0/+103
| |
| * fix b3 - Headers suppose to be stringsILYA Khlopotov2020-02-041-1/+1
| |
| * Support setting base_url in Couch test helperILYA Khlopotov2020-02-041-7/+14
| |
| * Update httpotion to 3.1.3ILYA Khlopotov2020-02-043-104/+3
|/ | | | | | | | 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
* Merge pull request #2494 from cloudant/add-http-reporteriilyak2020-01-304-16/+56
|\ | | | | Add http reporter
| * Support jaeger http reporterILYA Khlopotov2020-01-304-16/+56
|/
* Merge pull request #2503 from apache/reserve-search-namespaceRobert Newson2020-01-291-0/+1
|\ | | | | reserve search namespace
| * reserve search namespacereserve-search-namespaceRobert Newson2020-01-291-0/+1
|/
* Merge pull request #2499 from apache/expiring-cache-cleanupJay Doane2020-01-281-1/+0
|\ | | | | Delete unused ets table creation
| * Delete unused ets table creationexpiring-cache-cleanupJay Doane2020-01-281-1/+0
|/ | | | | | 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.
* Merge pull request #2495 from apache/prototype/fdb-layer-bump-ioqEric Avdey2020-01-281-1/+1
|\ | | | | Bump ioq to 2.1.3
| * Bump ioq to 2.1.3prototype/fdb-layer-bump-ioqEric Avdey2020-01-281-1/+1
|/
* Change map indexes to be stored in one rowGarren Smith2020-01-223-114/+17
| | | | | Changes map indexes to store the original key and value in a single FDB row.
* Merge pull request #2451 from cloudant/tracing-externaliilyak2020-01-212-5/+10
|\ | | | | Add `external` tag to opentrace events
| * Add `external` tag to opentrace eventsILYA Khlopotov2020-01-142-5/+10
|/ | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Improve transaction name setting when tracing FDB transactionsNick Vatamaniuc2019-12-181-1/+4
| | | | | | | | | 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.
* Merge pull request #2331 from cloudant/expiring-cacheJay Doane2019-12-109-0/+507
|\ | | | | Expiring cache
| * Expiring cacheexpiring-cacheJay Doane2019-12-109-0/+507
|/ | | | | | | | | | 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.
* Delete attachments when no longer referencedPaul J. Davis2019-12-105-20/+428
| | | | | | | | | | | | | 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.
* Silence test suite warning message about cryptoPaul J. Davis2019-12-101-0/+4
|
* Normalize fabric2 test suitePaul J. Davis2019-12-0517-209/+214
| | | | | This change ensures that all test names are visible and follows a single unified pattern for each test module.
* Retry for failed indexes buildsGarren Smith2019-12-023-6/+103
| | | | | Retry building a failing index for a set number of retries. If it never completes, then return the error to the user.
* Optimize view read latency when the view readyGarren Smith2019-11-261-20/+26
| | | | | If the view is already built, read the view status and view in the same transaction. This will improve view read latency.
* Change end-point /_up to check fdb connectivityEric Avdey2019-11-222-6/+11
|
* Add operation names for all HTTP endpointsPaul J. Davis2019-11-227-27/+540
| | | | | | 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.
* Implement node typesNick Vatamaniuc2019-11-216-18/+163
| | | | | | The implementation follows the RFC [1] [1]: https://github.com/apache/couchdb-documentation/blob/master/rfcs/013-node-types.md
* Trace fdb transactionsILYA Khlopotov2019-11-203-11/+39
|
* Trace http endpointsILYA Khlopotov2019-11-204-6/+146
|