| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are two fixes:
1) In `fabric2_fdb:get_config/1`, Db was matched before and after
`ensure_current/1`. Only the db prefix path was used, which doesn't normally
change, but it's worth fixing it anyway.
2) In `fabric2_db:get_security/2` we used a cached version of the security
document outside the transaction. Now we force it go through a transaction to
call `fabric2_fdb:get_config/1` which call `ensure_current/1`. When done, we
also update the cached Db handle.
Tests in `fabric2_db_security` module also needed fixing since they relied on
the cached behavior.
|
| |
|
|\
| |
| | |
Support `--extra_args` parameter in `dev/run`
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sometimes there is a need to specify additional arguments for the beam process we start from dev/run.
In particular the feature is handy for:
- changing emulator flags
- simulate OOM via available RAM restrictions
- enable module loading tracing
- configure number of schedulers
- modify applications configuration
- run customization script to add extra development deps (such as automatic code reload)
Historically developers had to edit dev/run to do it.
This PR adds an ability to specify additional arguments via `--extra_args` argument.
In order to run customization script create `customization.erl` which exports `start/0` and run it using:
```
dev/run --extra_args='-run customization'
```
|
|
|
|
|
|
|
|
| |
`TimeoutFun` was already returning `{ok|stop, UserAcc}` so there was no need to
wrap it another `{ok, ...} tuple.
Also TimeoutFun was calling user with`{timeout, _ResponseType}` not just
timeout, so added a clause to handle that as well.
|
| |
|
|
|
|
|
| |
On master this is happening in `fabric_view_changes` but on FDB we don't go
through that module anymore, so we do in `chttpd_changes` module instead.
|
|
|
|
|
|
|
|
|
|
|
| |
On master `_local_docs&update_seq=true` returns the update sequence of the
database. Even though it might not make much sense since updating local docs
doesn't bump the sequence, it's probably a good idea to stay consistent.
It's also worth mentioning another inconsistency is when FDB returns a
`total_rows` count for `_local_docs` while master returns `null`. I think
that's probably acceptable. Master would return the count if had it available
easily and having it seems like a useful thing and an improvement.
|
|
|
|
|
|
|
| |
This is done for compatibility with CouchDB < 4.x where this limit was
implicitly enforced by the file system's max filename size. The default value
enforces the same limit for FDB in case users decide to replicate back and
forth between old and new instances with 'create_target = true' option.
|
|
|
|
|
|
|
|
|
| |
`_design_docs` reuses `_all_docs` logic and adjusts `start_key` and
`end_key` to be within the `_design/` prefix range.
Namespace setting was simplified to never have an `undefined`
value. This way it doesn't need extra case statements to handle it
further down in the FDB code.
|
|
|
|
|
| |
Also add mrargs validation to match what master does and provide some
helpful feedback to the users.
|
| |
|
| |
|
|
|
|
|
|
| |
This matches behavior on master:
https://github.com/apache/couchdb/blob/master/src/couch/src/couch_db.erl#L1373-L1387
|
|
|
|
|
| |
Start stop config and couch_drv in `setup/0` and `teardown/1` instead of the
test function itself.
|
| |
|
| |
|
|
|
|
| |
That is needed when indexing authentication dbs like `_users`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously if a VDU was updated in the `before_doc_update/3` handlers, the Db
handle wasn't refreshed soon enough such that the `prepare_and_validate/3`
would not see the newly update VDU and would not run it.
To fix make a stale Db throws an exception which bubbles up all the way to
`fabric2_fdb:transactional/2` where the transaction is retried again with a
reopened Db.
During `reopen/1` make sure to properly transfer the `user_ctx` property to the
new handle, and also make sure `user_ctx` is removed from `db_options` to avoid
caching it in `fabric2_server`.
|
|
|
|
|
|
| |
This mostly equivalent to the `couch_db` EPI plugin, but using fabric2 calls
and without some of the functions that are not relevant to FDB such as
on_compact/1 and others.
|
| |
|
|\
| |
| |
| |
| | |
cloudant/add-timeout-to-fold_docs_with_different_keys
Add timeout for 'fold_docs-with_different_keys' test
|
|/ |
|
| |
|
|
|
|
|
|
|
| |
Specifying a custom prefix allows having multiple CouchDB instances on a single
FDB cluster. This can be used for one form of multi-tenancy. It can also be
used for integration testing by creating a temporary prefix then deleting all
data in that directory when the test has finished.
|
| |
|
|
|
|
|
| |
This opens the max document size to the transaction limits rather than a
single 100k value.
|
| |
|
|
|
|
|
|
| |
If the indexing job has timed out and has been requed we need to exit
the current indexer. This ensures the errors are logged so that we can
keep an eye on failing jobs.
|
|
|
|
|
|
| |
This adds couch_views which builds map indexes and stores them in FDB.
Co-authored-by: Paul J. Davis <paul.joseph.davis@gmail.com>
|
|
|
|
|
| |
If a start or end key is not specified we still need to scope the range
read to the given `RangePrefix`.
|
|
|
|
|
| |
This exposes a single place where we can check for whether a given
database or database name is a replicator or users database.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The old test got around this by using couch_httpd_auth cache in its
tests which is fairly odd given that we run chttpd_auth_cache in
production. This fixes that mistake and upgrades chttpd_auth_cache so
that it works in the test scenario of changing the authentication_db
configuration.
|
| |
|
| |
|
|
|
|
|
| |
Previously I was forgetting to keep the previous history around which
ended up limiting the revision depth to two.
|
|
|
|
| |
Simple function change to `fabric2_db:name/1`
|
|
|
|
|
|
| |
The existing logic around return codes and term formats is labyrinthine.
This is the result of much trial and error to get the new logic to
behave exactly the same as the previous implementation.
|
|
|
|
|
|
| |
This adds the mapping of CouchDB start/end keys and so on to the similar
yet slightly different concepts in FoundationDB. The handlers for
`_all_dbs` and `_all_docs` have been udpated to use this new logic.
|
|
|
|
|
| |
Neither partitioned databases or shard splitting will exist in a
FoundationDB layer.
|
|
|
|
|
|
|
| |
RFC: https://github.com/apache/couchdb-documentation/pull/409
Main API is in the `couch_jobs` module. Additional description of internals is
in the README.md file.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This changes `chttpd_auth_cache` to use FoundationDB to back the
`_users` database including the `before_doc_update` and `after_doc_read`
features.
|
|
|
|
| |
This was a remnant before we used a version per database.
|