<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/couchdb.git/src/couch_pse_tests, branch devnode-boot-script</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>Update usage of couch_hash:md5_hash shim</title>
<updated>2019-12-02T08:13:15+00:00</updated>
<author>
<name>Will Holley</name>
<email>willholley@gmail.com</email>
</author>
<published>2019-12-02T08:01:57+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=bcf6881e4a244bb7ec3326cc051fe45c586e35e6'/>
<id>bcf6881e4a244bb7ec3326cc051fe45c586e35e6</id>
<content type='text'>
https://github.com/apache/couchdb/pull/1445 introduced a shim to
enable CouchDB to be compiled to use the Erlang MD5 function.
This allows CouchDB to run in FIPS environments where the crypto
module is restricted such that `crypto:hash(md5,..)` is blocked
(fails with `notsup` error).

This commit replaces usage of `crypto:hash(md5, ..)` introduced since
the original PR with the shim function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/apache/couchdb/pull/1445 introduced a shim to
enable CouchDB to be compiled to use the Erlang MD5 function.
This allows CouchDB to run in FIPS environments where the crypto
module is restricted such that `crypto:hash(md5,..)` is blocked
(fails with `notsup` error).

This commit replaces usage of `crypto:hash(md5, ..)` introduced since
the original PR with the shim function.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove delayed commits option</title>
<updated>2019-09-26T17:32:31+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2019-09-26T05:33:01+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=dc054e7ddcc3ea059e1f86a7039cf86912ab1052'/>
<id>dc054e7ddcc3ea059e1f86a7039cf86912ab1052</id>
<content type='text'>
This effectively removes a lot couch_db:ensure_full_commit/1,2 calls.

Low level fsync configuration options are also removed as it might be tempting
to start using those instead of delayed commits, however unlike delayed
commits, changing those default could lead to data corruption.

`/_ensure_full_commit` HTTP API was left as is since replicator from older
versions of CouchDB would call that, it just returns the start time as if
ensure_commit function was called.

Issue: https://github.com/apache/couchdb/issues/2165
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This effectively removes a lot couch_db:ensure_full_commit/1,2 calls.

Low level fsync configuration options are also removed as it might be tempting
to start using those instead of delayed commits, however unlike delayed
commits, changing those default could lead to data corruption.

`/_ensure_full_commit` HTTP API was left as is since replicator from older
versions of CouchDB would call that, it just returns the start time as if
ensure_commit function was called.

Issue: https://github.com/apache/couchdb/issues/2165
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix cpse_test_purge_replication eunit test</title>
<updated>2019-08-07T18:20:55+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2019-08-07T05:52:47+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=98a702c4a8784e3037f40f8d201fe0387a836428'/>
<id>98a702c4a8784e3037f40f8d201fe0387a836428</id>
<content type='text'>
It doesn't work on Jenkins but worked locally.

Noticed that we started chttpd even though the clustered port was never used.

Add a wait function in `db_url/1` to make sure to wait until the db is
available via the HTTP interface before continuing.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It doesn't work on Jenkins but worked locally.

Noticed that we started chttpd even though the clustered port was never used.

Add a wait function in `db_url/1` to make sure to wait until the db is
available via the HTTP interface before continuing.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove local replication endpoints in CouchDB 3.x</title>
<updated>2019-07-31T16:54:52+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2019-07-31T15:46:22+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=0a5b11f832722c33dd30c4150f4c02414edd85d4'/>
<id>0a5b11f832722c33dd30c4150f4c02414edd85d4</id>
<content type='text'>
`local` replication endpoints do something completely unexpected from a user's
point of view -- they replicate to and from node local databases on a random
node. The only way this worked correctly was if someone used the backend port
(:5986) with a single node database. However, that port is getting closed for 3.x
release as well, so it makes even less sense to keep this functionality around.

For more discussion and voting results see ML list:
https://lists.apache.org/thread.html/ddcd9db93cee363db7da571f5cbc7f2bd24b881a34e1ef734d6a0a1c@%3Cdev.couchdb.apache.org%3E

The `_replicate` HTTP "hack" was left as is, since it does work more or less,
However it is inconsistent with what _replicator docs do so we should probably
deprecated it and remove it in 4.x.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`local` replication endpoints do something completely unexpected from a user's
point of view -- they replicate to and from node local databases on a random
node. The only way this worked correctly was if someone used the backend port
(:5986) with a single node database. However, that port is getting closed for 3.x
release as well, so it makes even less sense to keep this functionality around.

For more discussion and voting results see ML list:
https://lists.apache.org/thread.html/ddcd9db93cee363db7da571f5cbc7f2bd24b881a34e1ef734d6a0a1c@%3Cdev.couchdb.apache.org%3E

The `_replicate` HTTP "hack" was left as is, since it does work more or less,
However it is inconsistent with what _replicator docs do so we should probably
deprecated it and remove it in 4.x.
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement initial shard splitting data copy</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=13db67efeebccce0b92556aa5a356a38d1b28200'/>
<id>13db67efeebccce0b92556aa5a356a38d1b28200</id>
<content type='text'>
The first step when a new shard splitting job starts is to do a bulk copy of
data from the source to the target.

Ideally this should happen as fast as possible as it could potentially churn
through billions of documents. This logic is implemented in the
`couch_db_split` module in the main `couch` application.

To understand better what happens in `couch_db_split` it is better to think of
it as a version of `couch_bt_engine_compactor` that lives just above the
couch_db_engine (PSE) interface instead of below it.

The first initial data copy does is it creates the targets. Targets are created
based on the source parameters. So if the source uses a specific PSE engine,
targets will use the same PSE engine. If the source is partitioned, the targets
will use the same partitioned hash function as well.

An interesting bit with respect to target creation is that targets are not
regular couch_db databases but are closer to a couch_file with a
couch_db_updater process linked to them. They are linked directly without going
through couch_server. This is done in order to avoid the complexity of handling
concurrent updates, handling VDU, interactive vs non-interactive updates,
making sure it doesn't compact while copying happens, doesn't update any LRUs,
or emit `db_updated` events. Those are things are not needed and handling them
would make this more fragile. Another way to think of the targets during the
initial bulk data copy is as "hidden" or "write-only" dbs.

Another notable thing is that `couch_db_split` doesn't know anything about
shards and only knows about databases. The input is a source, a map of targets
and a caller provided "picker" function which will know how for each given
document ID to pick one of the targets. This will work for both regular dbs as
well as partitioned ones. All the logic will be inside the pick function not
embedded in `couch_db_split`.

One last point is about handling internal replicator _local checkpoint docs.
Those documents are transformed when they are copied such that the old source
UUID is replaced with the new target's UUID, since each shard will have its own
new UUID. That is done to avoid replications rewinding.

Besides those points, the rest is rather boring and it's just "open documents
from the source, pick the target, copy the documents to one of the targets,
read more documents from the source, etc".

Co-authored-by: Paul J. Davis &lt;davisp@apache.org&gt;
Co-authored-by: Eric Avdey &lt;eiri@eiri.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The first step when a new shard splitting job starts is to do a bulk copy of
data from the source to the target.

Ideally this should happen as fast as possible as it could potentially churn
through billions of documents. This logic is implemented in the
`couch_db_split` module in the main `couch` application.

To understand better what happens in `couch_db_split` it is better to think of
it as a version of `couch_bt_engine_compactor` that lives just above the
couch_db_engine (PSE) interface instead of below it.

The first initial data copy does is it creates the targets. Targets are created
based on the source parameters. So if the source uses a specific PSE engine,
targets will use the same PSE engine. If the source is partitioned, the targets
will use the same partitioned hash function as well.

An interesting bit with respect to target creation is that targets are not
regular couch_db databases but are closer to a couch_file with a
couch_db_updater process linked to them. They are linked directly without going
through couch_server. This is done in order to avoid the complexity of handling
concurrent updates, handling VDU, interactive vs non-interactive updates,
making sure it doesn't compact while copying happens, doesn't update any LRUs,
or emit `db_updated` events. Those are things are not needed and handling them
would make this more fragile. Another way to think of the targets during the
initial bulk data copy is as "hidden" or "write-only" dbs.

Another notable thing is that `couch_db_split` doesn't know anything about
shards and only knows about databases. The input is a source, a map of targets
and a caller provided "picker" function which will know how for each given
document ID to pick one of the targets. This will work for both regular dbs as
well as partitioned ones. All the logic will be inside the pick function not
embedded in `couch_db_split`.

One last point is about handling internal replicator _local checkpoint docs.
Those documents are transformed when they are copied such that the old source
UUID is replaced with the new target's UUID, since each shard will have its own
new UUID. That is done to avoid replications rewinding.

Besides those points, the rest is rather boring and it's just "open documents
from the source, pick the target, copy the documents to one of the targets,
read more documents from the source, etc".

Co-authored-by: Paul J. Davis &lt;davisp@apache.org&gt;
Co-authored-by: Eric Avdey &lt;eiri@eiri.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce cpse_test_purge_seqs again</title>
<updated>2019-01-03T02:13:28+00:00</updated>
<author>
<name>jiangph</name>
<email>jiangph@cn.ibm.com</email>
</author>
<published>2018-12-25T10:23:00+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=d12c22b23f00d2674d5155b6c5aa41a8ad240f94'/>
<id>d12c22b23f00d2674d5155b6c5aa41a8ad240f94</id>
<content type='text'>
  - Re-introduce cpse_test_purge_seqs after fixing issue on
  cpse_test_purge_seqs:cpse_increment_purge_seq_on_partial_purge/1
  with undef issue
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  - Re-introduce cpse_test_purge_seqs after fixing issue on
  cpse_test_purge_seqs:cpse_increment_purge_seq_on_partial_purge/1
  with undef issue
</pre>
</div>
</content>
</entry>
<entry>
<title>Suppress export-related compiler warnings</title>
<updated>2018-12-27T21:07:57+00:00</updated>
<author>
<name>Jay Doane</name>
<email>jay.s.doane@gmail.com</email>
</author>
<published>2018-12-27T20:49:47+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=4e75964898bd49218087de1e02391300da024e6c'/>
<id>4e75964898bd49218087de1e02391300da024e6c</id>
<content type='text'>
- For export_all warnings: either replace with explicit exports, add
nowarn_export_all compiler directives when appropriate, or in the case
of couch_epi_sup, move the test to dedicated test file and export the
function needed for testing.

- For "function already exported" warning in couch_key_tree_prop_tests,
remove include_lib attribute for eunit.hrl since it already gets
imported in triq.hrl
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- For export_all warnings: either replace with explicit exports, add
nowarn_export_all compiler directives when appropriate, or in the case
of couch_epi_sup, move the test to dedicated test file and export the
function needed for testing.

- For "function already exported" warning in couch_key_tree_prop_tests,
remove include_lib attribute for eunit.hrl since it already gets
imported in triq.hrl
</pre>
</div>
</content>
</entry>
<entry>
<title>Suppress crypto and random compiler warnings</title>
<updated>2018-12-27T21:07:57+00:00</updated>
<author>
<name>Jay Doane</name>
<email>jay.s.doane@gmail.com</email>
</author>
<published>2018-12-23T18:07:02+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=b9b333bac7a2518c2acfde31c47872523ad6e50c'/>
<id>b9b333bac7a2518c2acfde31c47872523ad6e50c</id>
<content type='text'>
Replace deprecated crypto:rand_uniform/2 and 'random' module functions
with equivalent couch_rand:uniform/1 calls, or eliminate the offending
code entirely if unused.

Note that crypto:rand_uniform/2 takes two parameters which have
different semantics than the single argument couch_rand:uniform/1.

Tests in mem3 are also provided to validate that the random rotation of
node lists was converted correctly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace deprecated crypto:rand_uniform/2 and 'random' module functions
with equivalent couch_rand:uniform/1 calls, or eliminate the offending
code entirely if unused.

Note that crypto:rand_uniform/2 takes two parameters which have
different semantics than the single argument couch_rand:uniform/1.

Tests in mem3 are also provided to validate that the random rotation of
node lists was converted correctly.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix make warning from cpse_test_purge_seqs.erl</title>
<updated>2018-08-24T02:02:39+00:00</updated>
<author>
<name>jiangph</name>
<email>jiangph@cn.ibm.com</email>
</author>
<published>2018-08-23T05:52:34+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=b648bbe5249e383f7a9a9abb256fc8f5d8334e39'/>
<id>b648bbe5249e383f7a9a9abb256fc8f5d8334e39</id>
<content type='text'>
Fixes #1572
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #1572
</pre>
</div>
</content>
</entry>
<entry>
<title>[07/10] Clustered Purge: Internal replication</title>
<updated>2018-08-21T16:59:16+00:00</updated>
<author>
<name>Paul J. Davis</name>
<email>paul.joseph.davis@gmail.com</email>
</author>
<published>2018-04-24T17:27:14+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=c625933fc3c69d300da3d6dbb2ffb5d3c8a26499'/>
<id>c625933fc3c69d300da3d6dbb2ffb5d3c8a26499</id>
<content type='text'>
This commit implements the internal replication of purge requests. This
part of the anit-entropy process is important for ensuring that shard
copies continue to be eventually consistent even if updates happen to
shards independently due to a network split or other event that prevents
the successful purge request to a given copy.

The main addition to internal replication is that we both pull and push
purge requests between the source and target shards. The push direction
is obvious given that internal replication is in the push direction
already. Pull isn't quite as obvious but is required so that we don't
push an update that was already purged on the target.

Of note is that internal replication also has to maintain _local doc
checkpoints to prevent compaction removing old purge requests or else
shard copies could end up missing purge requests which would prevent the
shard copies from ever reaching a consistent state.

COUCHDB-3326

Co-authored-by: Mayya Sharipova &lt;mayyas@ca.ibm.com&gt;
Co-authored-by: jiangphcn &lt;jiangph@cn.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit implements the internal replication of purge requests. This
part of the anit-entropy process is important for ensuring that shard
copies continue to be eventually consistent even if updates happen to
shards independently due to a network split or other event that prevents
the successful purge request to a given copy.

The main addition to internal replication is that we both pull and push
purge requests between the source and target shards. The push direction
is obvious given that internal replication is in the push direction
already. Pull isn't quite as obvious but is required so that we don't
push an update that was already purged on the target.

Of note is that internal replication also has to maintain _local doc
checkpoints to prevent compaction removing old purge requests or else
shard copies could end up missing purge requests which would prevent the
shard copies from ever reaching a consistent state.

COUCHDB-3326

Co-authored-by: Mayya Sharipova &lt;mayyas@ca.ibm.com&gt;
Co-authored-by: jiangphcn &lt;jiangph@cn.ibm.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
