Skip to content

Conversation

@iilyak
Copy link

@iilyak iilyak commented May 25, 2017

Cherry Picks

81ee7c5: Fix error on race condition in mem3 startup
ca4761c: Increase timeout for compression tests
3691c2e: Test changes_listener dies on mem3_shards shutdown
9d99d6e: Expose mem3_shards:get_changes_pid/0
32b5402: chore: double test timeout see COUCHDB-3408
e8b2c74: chore: increase timeout for pausing writer COUCHDB-3384
fb6faec: Revert couch_lru to use gb_trees
55623f4: Pre-calculate application start order
4683f51: Whait db close a little bit before failing test
ed1609b: Make sure we cache admin pass prior to test run

Reverted commits

a5e3deb: Revert "Re-enable attachment replication tests"

wohali and others added 11 commits May 2, 2017 11:25
During mem3 startup, 2 paths attempt to call `couch_server:create/2` on
`_dbs`:

```
gen_server:init_it/6
  -> mem3_shards:init/1
    -> mem3_shards:get_update_seq/0
      -> couch_server:create/2
```

and

```
mem3_sync:initial_sync/1
  -> mem3_shards:fold/2
    -> couch_server:create/2
```

Normally, the first path completes before the second. If the second path
finishes first, the first path fails because it does not expect a
`file_exists` response.

This patch makes `mem3_util:ensure_enxists/1` more robust in the face of
a race to create `_dbs`.

Fixes COUCHDB-3402.

Approved by @davisp and @iilyak
This adds a test to ensure that the changes_listener process exits when
the mem3_shards process is shut down.

COUCHDB-3398
Simplify getting changes listener pid for testing
Recently couch_lru was changed to use ets tables.

During eprof profiling it showed improved performance however recently in a
larger test with more concurrent updates and 5000 max dbs open it showed a
significant degradation compared to the previous (gb_tree-based) version.

GH Issue apache#528
This allows us to make some better assertions/logging when starting our
application list on what should and should not already be started.
Databases are closed asynchronously. However it was not accounted for in
the test case. This commit waits database to close before it makes a
decission to abort the test.
I.e. if test case detects that database is still opened after 1 second
it considers it as failure.
couch_server is responsible for calling hash_admin_passwords whenever
"admin" section of config changes. However as you can see it from
[here](https://github.com/apache/couchdb/blob/master/src/couch/src/couch_server.erl#L219)
the call is asynchronous. This means that our test cases might fail when
we try to using admin user while admin password is not yet hashed.
@iilyak
Copy link
Author

iilyak commented May 25, 2017

@nickva
Copy link

nickva commented May 26, 2017

+1

@iilyak iilyak merged commit a680fd8 into cloudant May 26, 2017
@iilyak iilyak deleted the cherry-picks branch May 26, 2017 18:22
iilyak added a commit that referenced this pull request Dec 11, 2019
iilyak added a commit that referenced this pull request Jul 6, 2020
Previously the auth was injected unconidtionally. There were two problems:

1. no way to specify `basic_auth` credentials
2. no way to disable injection

Due to #2 it was impossible to use other user than hardcoded `adm` ()
in `Couch.login/3`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants