<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/couchdb.git/src/mem3/test, branch decrease-indexer-transaction-time-limit</title>
<subtitle>github.com: apache/couchdb.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/'/>
<entry>
<title>Replace Triq with PropEr</title>
<updated>2020-01-21T15:51:19+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2020-01-21T15:20:08+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=3e0dd6b6edb077de570b05e2acec0a857563be53'/>
<id>3e0dd6b6edb077de570b05e2acec0a857563be53</id>
<content type='text'>
It was already used in the IOQ2 work so all the plumbing to pull it in during
dev testing was there and it seems awkward to have two different property
testing framework for just a few tests.

It is still an optional component and is not included in the release.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It was already used in the IOQ2 work so all the plumbing to pull it in during
dev testing was there and it seems awkward to have two different property
testing framework for just a few tests.

It is still an optional component and is not included in the release.
</pre>
</div>
</content>
</entry>
<entry>
<title>When shard splitting make sure to reset the targets before any retries</title>
<updated>2020-01-10T19:58:05+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2020-01-10T17:53:46+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=dd1b2817bbf7a0efce858414310a0c822ce89468'/>
<id>dd1b2817bbf7a0efce858414310a0c822ce89468</id>
<content type='text'>
Previously the target was reset only when the whole job started, but not when
the initial copy phase restarted on its own. If that happened, we left the
target around so the retry failed always with the `eexist` error.

Target reset has a check to make sure the shards are not in the global shard
map, in case someone manually added them, for example. If they are found there
the job panics and exists.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously the target was reset only when the whole job started, but not when
the initial copy phase restarted on its own. If that happened, we left the
target around so the retry failed always with the `eexist` error.

Target reset has a check to make sure the shards are not in the global shard
map, in case someone manually added them, for example. If they are found there
the job panics and exists.
</pre>
</div>
</content>
</entry>
<entry>
<title>Lock shard splitting targets during the initial copy phase</title>
<updated>2020-01-05T07:29:37+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2020-01-04T22:08:05+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=43fff603bcc29f5d4138e15b764fa83cc871ce92'/>
<id>43fff603bcc29f5d4138e15b764fa83cc871ce92</id>
<content type='text'>
During the initial copy phase target shards are opened outside the
couch_server. Previously, it was possible to manually (via remsh for instance)
open the same targets via the couch_server by using the `couch_db:open/2` API
for example. That could lead to corruption as there would be two writers for
the same DB file.

In order to prevent such a scenario, introduce a mechanism for the shard
splitter to lock the target shards such that any regular open call would fail
during the initial copy phase.

The locking mechanism is generic and would allow local locking of shards for
possibly other reasons in the future as well.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During the initial copy phase target shards are opened outside the
couch_server. Previously, it was possible to manually (via remsh for instance)
open the same targets via the couch_server by using the `couch_db:open/2` API
for example. That could lead to corruption as there would be two writers for
the same DB file.

In order to prevent such a scenario, introduce a mechanism for the shard
splitter to lock the target shards such that any regular open call would fail
during the initial copy phase.

The locking mechanism is generic and would allow local locking of shards for
possibly other reasons in the future as well.
</pre>
</div>
</content>
</entry>
<entry>
<title>Move eunit tests into test/eunit directory</title>
<updated>2019-07-29T11:24:37+00:00</updated>
<author>
<name>ILYA Khlopotov</name>
<email>iilyak@apache.org</email>
</author>
<published>2019-05-10T00:45:21+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=cf60cffb44bf18889aa8362b616bafb7bed87445'/>
<id>cf60cffb44bf18889aa8362b616bafb7bed87445</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix EUnit timeouts (#2087)</title>
<updated>2019-07-29T03:50:50+00:00</updated>
<author>
<name>Adam Kocoloski</name>
<email>kocolosk@apache.org</email>
</author>
<published>2019-07-29T03:50:50+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=29d484e45054c4b40f6b3a223298c8a31914f90d'/>
<id>29d484e45054c4b40f6b3a223298c8a31914f90d</id>
<content type='text'>
* Proactively increase timeout for PBKDF2 test

This test was taking 134s in a recent run, which is uncomfortably close
to the threshold.

* Extend timeouts for all reshard API tests

We're observing timeouts on various tests in this suite so let's keep
it consistent and increase timeouts across the board.

* Bump default timeout for all mem3_reshard tests

A couple of these tests were exceeding the default timeout under normal
circumstances, but many of them do a significant amount of work, so for
simplicity we set a module-wide timeout and apply it consistently
throughout.

* Modernize the sync_security test setup/teardown

This test actually doesn't do much real work, but I think what was
happening is that the setup and teardown time was being charged to the
test itself. I've refactored it to use a more modern scaffolding
following some of our more recent additions to the test suite, but have
left the timeout at the default to test this hypothesis.

* Increase timeouts on more heavyweight mem3 tests

* Extend timeouts for replication tests
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Proactively increase timeout for PBKDF2 test

This test was taking 134s in a recent run, which is uncomfortably close
to the threshold.

* Extend timeouts for all reshard API tests

We're observing timeouts on various tests in this suite so let's keep
it consistent and increase timeouts across the board.

* Bump default timeout for all mem3_reshard tests

A couple of these tests were exceeding the default timeout under normal
circumstances, but many of them do a significant amount of work, so for
simplicity we set a module-wide timeout and apply it consistently
throughout.

* Modernize the sync_security test setup/teardown

This test actually doesn't do much real work, but I think what was
happening is that the setup and teardown time was being charged to the
test itself. I've refactored it to use a more modern scaffolding
following some of our more recent additions to the test suite, but have
left the timeout at the default to test this hypothesis.

* Increase timeouts on more heavyweight mem3 tests

* Extend timeouts for replication tests
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow restricting resharding parameters</title>
<updated>2019-04-23T23:31:20+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2019-04-23T22:36:35+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=3a54280670704c96f8628eb7cfe926f6f2e414e0'/>
<id>3a54280670704c96f8628eb7cfe926f6f2e414e0</id>
<content type='text'>
To avoid inadvertently splitting all the shards in all the ranges due to user
error, introduce an option enforce the presence of node and range job creation
parameters.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To avoid inadvertently splitting all the shards in all the ranges due to user
error, introduce an option enforce the presence of node and range job creation
parameters.
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement resharding HTTP API</title>
<updated>2019-04-03T14:48:45+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2019-03-18T17:32:15+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=a6db7d54e7651eee796932a60b534b208566f563'/>
<id>a6db7d54e7651eee796932a60b534b208566f563</id>
<content type='text'>
This implements the API as defined in RFC #1920

The handlers live in the `mem3_reshard_httpd` and helpers, like validators live
in the `mem3_reshard_api` module.

There are also a bunch of high level (HTTP &amp; fabric) API tests that check that
shard splitting happens properly, jobs are behaving as defined in the RFC, etc.

Co-authored-by: Eric Avdey &lt;eiri@eiri.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This implements the API as defined in RFC #1920

The handlers live in the `mem3_reshard_httpd` and helpers, like validators live
in the `mem3_reshard_api` module.

There are also a bunch of high level (HTTP &amp; fabric) API tests that check that
shard splitting happens properly, jobs are behaving as defined in the RFC, etc.

Co-authored-by: Eric Avdey &lt;eiri@eiri.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Update internal replicator to handle split shards</title>
<updated>2019-04-03T14:48:45+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2019-03-18T17:32:15+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=b7d5b5d4661e742596a8b7b9302e0e3aa9f4cf5d'/>
<id>b7d5b5d4661e742596a8b7b9302e0e3aa9f4cf5d</id>
<content type='text'>
Shard splitting will result in uneven shard copies. Previously internal
replicator knew to replicate from one shard copy to another but now it needs to
know how to replicate from one source to possibly multiple targets.

The main idea is to reuse the same logic and "pick" function as
`couch_db_split`.

But to avoid a penalty of calling the custom hash function for every document
even for cases when there is just a single target, there is a special "1
target" case where the hash function is `undefined`.

Another case where internal replicator is used is to topoff replication and to
replicate the shard map dbs to and from current node (used in shard map update
logic). For that reason there are a few helper mem3_util and mem3_rpc
functions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Shard splitting will result in uneven shard copies. Previously internal
replicator knew to replicate from one shard copy to another but now it needs to
know how to replicate from one source to possibly multiple targets.

The main idea is to reuse the same logic and "pick" function as
`couch_db_split`.

But to avoid a penalty of calling the custom hash function for every document
even for cases when there is just a single target, there is a special "1
target" case where the hash function is `undefined`.

Another case where internal replicator is used is to topoff replication and to
replicate the shard map dbs to and from current node (used in shard map update
logic). For that reason there are a few helper mem3_util and mem3_rpc
functions.
</pre>
</div>
</content>
</entry>
<entry>
<title>Uneven shard copy handling in mem3 and fabric</title>
<updated>2019-04-03T14:48:45+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2019-03-18T17:32:14+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=d10b7955929c1581f192fc487840cbf5005f84c9'/>
<id>d10b7955929c1581f192fc487840cbf5005f84c9</id>
<content type='text'>
The introduction of shard splitting will eliminate the contraint that all
document copies are located in shards with same range boundaries. That
assumption was made by default in mem3 and fabric functions that do shard
replacement, worker spawning, unpacking `_changes` update sequences and some
others. This commit updates those places to handle the case where document
copies might be in different shard ranges.

A good place to start from is the `mem3_util:get_ring()` function. This
function returns a full non-overlapped ring from a set of possibly overlapping
shards.

This function is used by almost everything else in this commit:

1) It's used when only a single copy of the data is needed, for example in
cases where _all_docs or _changes procesessig.

2) Used when checking if progress is possible after some nodes died.
`get_ring()` returns `[]` when it cannot find a full ring is used to indicate
that progress is not possible.

3) During shard replacement. This is pershaps the most complicated case. During
replacement besides just finding a possible covering of the ring from the set
of shards, it is also desirable to find one that minimizes the number of
workers that have to be replaced. A neat trick used here is to provide
`get_ring` with a custom sort function, which prioritizes certain shard copies
over others. In case of replacements it prioritiezes shards for which workers
have already spawned. In the default cause `get_ring()` will prioritize longer
ranges over shorter ones, so for example, to cover the interval [00-ff] with
either [00-7f, 80-ff] or [00-ff] shards ranges, it will pick the single [00-ff]
range instead of [00-7f, 80-ff] pair.

Co-authored-by: Paul J. Davis &lt;davisp@apache.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The introduction of shard splitting will eliminate the contraint that all
document copies are located in shards with same range boundaries. That
assumption was made by default in mem3 and fabric functions that do shard
replacement, worker spawning, unpacking `_changes` update sequences and some
others. This commit updates those places to handle the case where document
copies might be in different shard ranges.

A good place to start from is the `mem3_util:get_ring()` function. This
function returns a full non-overlapped ring from a set of possibly overlapping
shards.

This function is used by almost everything else in this commit:

1) It's used when only a single copy of the data is needed, for example in
cases where _all_docs or _changes procesessig.

2) Used when checking if progress is possible after some nodes died.
`get_ring()` returns `[]` when it cannot find a full ring is used to indicate
that progress is not possible.

3) During shard replacement. This is pershaps the most complicated case. During
replacement besides just finding a possible covering of the ring from the set
of shards, it is also desirable to find one that minimizes the number of
workers that have to be replaced. A neat trick used here is to provide
`get_ring` with a custom sort function, which prioritizes certain shard copies
over others. In case of replacements it prioritiezes shards for which workers
have already spawned. In the default cause `get_ring()` will prioritize longer
ranges over shorter ones, so for example, to cover the interval [00-ff] with
either [00-7f, 80-ff] or [00-ff] shards ranges, it will pick the single [00-ff]
range instead of [00-7f, 80-ff] pair.

Co-authored-by: Paul J. Davis &lt;davisp@apache.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement configurable hash functions</title>
<updated>2019-01-18T19:03:28+00:00</updated>
<author>
<name>Paul J. Davis</name>
<email>paul.joseph.davis@gmail.com</email>
</author>
<published>2018-10-25T21:58:48+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=05678b93d560bceb63a3e19350d3e068cac70dbf'/>
<id>05678b93d560bceb63a3e19350d3e068cac70dbf</id>
<content type='text'>
This provides the capability for features to specify alternative hash
functions for placing documents in a given shard range. While the
functionality exists with this implementation it is not yet actually
used.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This provides the capability for features to specify alternative hash
functions for placing documents in a given shard range. While the
functionality exists with this implementation it is not yet actually
used.
</pre>
</div>
</content>
</entry>
</feed>
