<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/couchdb.git/src/couch_views, 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>Decrease the view indexer transaction time</title>
<updated>2021-03-22T15:44:55+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2021-03-22T05:22:18+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=aa800e2d00eb9565d59396c1ae8c482d609ec872'/>
<id>aa800e2d00eb9565d59396c1ae8c482d609ec872</id>
<content type='text'>
The indexer transaction time is decreased in order to allow enough
time for the client to re-use the same GRV to emit doc bodies.

This PR goes along with [1], where emitted doc bodies in a view
responses now come from the same database read version as the one used
by the indexer. Since the batcher previously used 4.5 seconds as the
maximum, that left little time to read any doc bodies.

[1]: https://github.com/apache/couchdb/pull/3391

Issue: https://github.com/apache/couchdb/issues/3381
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The indexer transaction time is decreased in order to allow enough
time for the client to re-use the same GRV to emit doc bodies.

This PR goes along with [1], where emitted doc bodies in a view
responses now come from the same database read version as the one used
by the indexer. Since the batcher previously used 4.5 seconds as the
maximum, that left little time to read any doc bodies.

[1]: https://github.com/apache/couchdb/pull/3391

Issue: https://github.com/apache/couchdb/issues/3381
</pre>
</div>
</content>
</entry>
<entry>
<title>Lower the view indexer transaction retry limit</title>
<updated>2021-03-04T17:28:17+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2021-03-03T19:59:37+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=fdd53774bd802fe9e6b6eb473ae5b40c7436137c'/>
<id>fdd53774bd802fe9e6b6eb473ae5b40c7436137c</id>
<content type='text'>
Previously, the view indexer used the default retry limit (100) from the
`fdb_tx_options` config section. However, since the batching algorithm relies
on sensing errors and reacting to them, retrying the batch 100 times before
erroring out was not optimal. So value is lowered down to 5 and it's also made
configurable.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the view indexer used the default retry limit (100) from the
`fdb_tx_options` config section. However, since the batching algorithm relies
on sensing errors and reacting to them, retrying the batch 100 times before
erroring out was not optimal. So value is lowered down to 5 and it's also made
configurable.
</pre>
</div>
</content>
</entry>
<entry>
<title>Relax isolation level when indexer reads from DB (#3393)</title>
<updated>2021-03-02T22:13:52+00:00</updated>
<author>
<name>Adam Kocoloski</name>
<email>kocolosk@apache.org</email>
</author>
<published>2021-03-02T22:13:52+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=650ba28bb9f09bbd7d4740f2d030b24d5169401c'/>
<id>650ba28bb9f09bbd7d4740f2d030b24d5169401c</id>
<content type='text'>
* Relax isolation level when indexer reads from DB

This patch causes the indexing subsystem to use snapshot isolation when
reading from the database. This reduces commit conflicts and ensures
the index can make progress even in the case of frequently updated docs.

In the pathological case, a document updated in a fast loop can cause
the indexer to stall out entirely when using serializable reads. Each
successful update of the doc will cause the indexer to fail to commit.
The indexer will retry with a new GRV but the same target DbSeq. In the
meantime, our frequently updated document will have advanced beyond
DbSeq and so the indexer will finish without indexing it in that pass.
This process can be repeated ad infinitum and the document will never
actually show up in a view response.

Snapshot reads are safe for this use case precisely because we do have
the _changes feed, and we can always be assured that a concurrent doc
update will show up again later in the feed.

* Bump erlfdb version

Needed to pull in fix for snapshot range reads.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Relax isolation level when indexer reads from DB

This patch causes the indexing subsystem to use snapshot isolation when
reading from the database. This reduces commit conflicts and ensures
the index can make progress even in the case of frequently updated docs.

In the pathological case, a document updated in a fast loop can cause
the indexer to stall out entirely when using serializable reads. Each
successful update of the doc will cause the indexer to fail to commit.
The indexer will retry with a new GRV but the same target DbSeq. In the
meantime, our frequently updated document will have advanced beyond
DbSeq and so the indexer will finish without indexing it in that pass.
This process can be repeated ad infinitum and the document will never
actually show up in a view response.

Snapshot reads are safe for this use case precisely because we do have
the _changes feed, and we can always be assured that a concurrent doc
update will show up again later in the feed.

* Bump erlfdb version

Needed to pull in fix for snapshot range reads.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix badmatch in couch_views_indexer</title>
<updated>2021-03-02T20:42:16+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2021-03-02T20:20:57+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=fac13a3ff0cfe6502dc424a9a129d7dd265290e4'/>
<id>fac13a3ff0cfe6502dc424a9a129d7dd265290e4</id>
<content type='text'>
Previously, when an erlfdb error occured and a recursive call to `update/3` was
made, the result of that call was always matched against `{Mrst, State}`.
However, in the case when the call had finalized and returned
`couch_eval:release_map_context/1` response, the result would be `ok` which
would blow with a badmatch error against `{Mrst, State}`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, when an erlfdb error occured and a recursive call to `update/3` was
made, the result of that call was always matched against `{Mrst, State}`.
However, in the case when the call had finalized and returned
`couch_eval:release_map_context/1` response, the result would be `ok` which
would blow with a badmatch error against `{Mrst, State}`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add failing cases for ebtree:lookup_multi/3 bug</title>
<updated>2021-02-26T19:24:06+00:00</updated>
<author>
<name>Paul J. Davis</name>
<email>paul.joseph.davis@gmail.com</email>
</author>
<published>2021-02-26T19:08:42+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=73875b5233138dcdd965bbd36d9581ca625e3a2d'/>
<id>73875b5233138dcdd965bbd36d9581ca625e3a2d</id>
<content type='text'>
These two test cases expose the subtle bug in ebtree:lookup_multi/3
where a key that doesn't exist in the tree can prevent a subsequent
lookup key from matching in the same KV node.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These two test cases expose the subtle bug in ebtree:lookup_multi/3
where a key that doesn't exist in the tree can prevent a subsequent
lookup key from matching in the same KV node.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix typo</title>
<updated>2021-02-26T19:24:06+00:00</updated>
<author>
<name>Paul J. Davis</name>
<email>paul.joseph.davis@gmail.com</email>
</author>
<published>2021-02-26T18:45:19+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=79b64ea6956875b5715e585ca6210ad018e6094b'/>
<id>79b64ea6956875b5715e585ca6210ad018e6094b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unnecessary line wraps</title>
<updated>2020-11-17T21:53:52+00:00</updated>
<author>
<name>Paul J. Davis</name>
<email>paul.joseph.davis@gmail.com</email>
</author>
<published>2020-11-17T17:23:36+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=3168a4dbcef7181b67a989e1d723dc6a93e76280'/>
<id>3168a4dbcef7181b67a989e1d723dc6a93e76280</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Minimize conflicts while building views</title>
<updated>2020-11-17T21:53:52+00:00</updated>
<author>
<name>Paul J. Davis</name>
<email>paul.joseph.davis@gmail.com</email>
</author>
<published>2020-11-13T20:11:00+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=27e8e332cf974bff69b86a8d3c5e2f5a6de4125f'/>
<id>27e8e332cf974bff69b86a8d3c5e2f5a6de4125f</id>
<content type='text'>
This flips the view indexer to grab the database update_seq outside of
the update transaction. Previously we would cosntantly refresh the
db_seq value on every retry of the transactional loop.

We use a snapshot to get the update_seq so that we don't trigger
spurious read conflicts with any clients that might be updating the
database.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This flips the view indexer to grab the database update_seq outside of
the update transaction. Previously we would cosntantly refresh the
db_seq value on every retry of the transactional loop.

We use a snapshot to get the update_seq so that we don't trigger
spurious read conflicts with any clients that might be updating the
database.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove use of caching</title>
<updated>2020-11-10T20:09:32+00:00</updated>
<author>
<name>Paul J. Davis</name>
<email>paul.joseph.davis@gmail.com</email>
</author>
<published>2020-11-10T17:52:17+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=7d3caa97b18a8bd953c96b39c9a986a4a11e5f34'/>
<id>7d3caa97b18a8bd953c96b39c9a986a4a11e5f34</id>
<content type='text'>
Turns out that ebtree caching wasn't quite correct so removing it for
now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Turns out that ebtree caching wasn't quite correct so removing it for
now.
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow administrators to optionally encrypt views</title>
<updated>2020-11-06T15:19:33+00:00</updated>
<author>
<name>Paul J. Davis</name>
<email>paul.joseph.davis@gmail.com</email>
</author>
<published>2020-11-03T18:36:50+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=4b107505e9862af35fe616e12892fdf6cfffb12d'/>
<id>4b107505e9862af35fe616e12892fdf6cfffb12d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
