<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/couchdb.git/src/couch_jobs/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>Fix more couch_jobs flakiness</title>
<updated>2021-03-12T21:51:14+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2021-03-12T21:12:05+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=c508efedcabd560449e4dcbd7774a04b3907257e'/>
<id>c508efedcabd560449e4dcbd7774a04b3907257e</id>
<content type='text'>
The errors see in #3417 seem to indicate the expiration jobs are interfering
with the couch_jobs tests, to prevent that prevent expiration_db job gen_server
from starting at all.

Fixes #3417
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The errors see in #3417 seem to indicate the expiration jobs are interfering
with the couch_jobs tests, to prevent that prevent expiration_db job gen_server
from starting at all.

Fixes #3417
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix couch_jobs to be less flaky</title>
<updated>2021-03-12T19:15:56+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2021-03-10T23:16:42+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=304a0634a2e06fdedd0746d39984e27147391842'/>
<id>304a0634a2e06fdedd0746d39984e27147391842</id>
<content type='text'>
It turns out fabric is dependent on couch_jobs because of db expiration module.
So when couch_jobs was restarted multiple times per test case it could have
brought down fabric. However, since couch_jobs needs fabric for transactional
stuff it ended up brining couch_jobs app down as well.

To fix it:

 * Switch to explicitly starting/stopping fabric and couch_jobs together

 * Break appart bad_messages* tests to individually test each type of message
   as app restarts in the middle of the tests kept killing fabric and
   intermettently killing couch_jobs a well.

 * Also make the tests look nicer by re-using ?TDEF_FE macros from
   `fabric2_test`, this we can avoid the `?_test(begin... end).` pattern.

 * Remove meck:unload since we don't really meck anything in the module

 * Don't need to spend time cleaning out database as we don't really create
   that many dbs (just one) and that one gets cleaned out in its own test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It turns out fabric is dependent on couch_jobs because of db expiration module.
So when couch_jobs was restarted multiple times per test case it could have
brought down fabric. However, since couch_jobs needs fabric for transactional
stuff it ended up brining couch_jobs app down as well.

To fix it:

 * Switch to explicitly starting/stopping fabric and couch_jobs together

 * Break appart bad_messages* tests to individually test each type of message
   as app restarts in the middle of the tests kept killing fabric and
   intermettently killing couch_jobs a well.

 * Also make the tests look nicer by re-using ?TDEF_FE macros from
   `fabric2_test`, this we can avoid the `?_test(begin... end).` pattern.

 * Remove meck:unload since we don't really meck anything in the module

 * Don't need to spend time cleaning out database as we don't really create
   that many dbs (just one) and that one gets cleaned out in its own test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix flaky couch_jobs type monitor test</title>
<updated>2020-05-15T22:32:38+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2020-05-15T21:17:50+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=6f2417e1af712b3720cf6c07713d7751cbc9fbef'/>
<id>6f2417e1af712b3720cf6c07713d7751cbc9fbef</id>
<content type='text'>
Sometimes this test fails on Jenkins but doesn't fail locally. The attempted
fix is to make sure to simply retry a few times for the number of children in
the supervisor to be the expected values. Also extend the timeout to 15
seconds.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sometimes this test fails on Jenkins but doesn't fail locally. The attempted
fix is to make sure to simply retry a few times for the number of children in
the supervisor to be the expected values. Also extend the timeout to 15
seconds.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix job removal notifications</title>
<updated>2020-04-09T21:10:10+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2020-04-09T20:48:25+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=56137f341e0fd22c7027a52b5c7e5eb1aa75aee0'/>
<id>56137f341e0fd22c7027a52b5c7e5eb1aa75aee0</id>
<content type='text'>
Fix the case when a job is removed while there are subscribers waiting for it.
Most of the logic was already there except:

 * Handle the case when when data decoded from subscription results could be
   `not_found`, in that case we just pass that atom back as is.

 * Need to notify the watch when jobs are removed or couch_jobs_notifiers would
   wake up and send notification messages.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix the case when a job is removed while there are subscribers waiting for it.
Most of the logic was already there except:

 * Handle the case when when data decoded from subscription results could be
   `not_found`, in that case we just pass that atom back as is.

 * Need to notify the watch when jobs are removed or couch_jobs_notifiers would
   wake up and send notification messages.
</pre>
</div>
</content>
</entry>
<entry>
<title>couch_jobs resubmit updates job data (#2649)</title>
<updated>2020-03-10T17:34:33+00:00</updated>
<author>
<name>garren smith</name>
<email>garren.smith@gmail.com</email>
</author>
<published>2020-03-10T17:34:33+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=1457c2826eceed7cd6244e1130c6f9c499fd2bb3'/>
<id>1457c2826eceed7cd6244e1130c6f9c499fd2bb3</id>
<content type='text'>
* couch_jobs resubmit updates job data

When a job is either pending or finished and the job is resubmitted
with new data the job data is updated.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* couch_jobs resubmit updates job data

When a job is either pending or finished and the job is resubmitted
with new data the job data is updated.
</pre>
</div>
</content>
</entry>
<entry>
<title>Optimize resubmitting pending jobs</title>
<updated>2020-03-09T19:10:34+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2020-03-08T04:53:22+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=17ce741c7cfcb14df7a8f24d38a59a7bf302dd5d'/>
<id>17ce741c7cfcb14df7a8f24d38a59a7bf302dd5d</id>
<content type='text'>
Previously even when the scheduled time was the same the job was still deleted
and re-inserted into the pending queue. Now we perform the re-enqueing
operation only if the scheduled time has changed. So if the whole operation is
run in its own transaction, the transaction will now become a read-only
transaction.

This optimization should come in handy with the indexing auto-builder, for
example, where multiple nodes might try to re-enqueue the job and then only the
first would succeed, and the rest will perform a quick one row read and not do
any writes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously even when the scheduled time was the same the job was still deleted
and re-inserted into the pending queue. Now we perform the re-enqueing
operation only if the scheduled time has changed. So if the whole operation is
run in its own transaction, the transaction will now become a read-only
transaction.

This optimization should come in handy with the indexing auto-builder, for
example, where multiple nodes might try to re-enqueue the job and then only the
first would succeed, and the rest will perform a quick one row read and not do
any writes.
</pre>
</div>
</content>
</entry>
<entry>
<title>Let couch_jobs use its own metadata key</title>
<updated>2020-03-02T18:26:22+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2020-02-18T22:20:15+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=bab35666a0223f184e2cc32bbc592584d05b0917'/>
<id>bab35666a0223f184e2cc32bbc592584d05b0917</id>
<content type='text'>
Previously, if the metadata key is bumped in a transaction, the same
transaction could not be used to add jobs with `couch_jobs`. That's because
metadata is a versionstamped value, and when set, it cannot be read back until
that transaction has committed. In `fabric2_fdb` there is a process dict key
that is set which declares that metadata was already read, which happens before
any db update, however `couch_jobs` uses it's own caching mechanism and doesn't
know about that pdict key.

Ideally we'd implement a single `couch_fdb` module to be shared between
`couch_jobs` and `fabric2_db` but until then it maybe simpler to just let
`couch_jobs` use its own metadata key. This way, it doesn't get invalidated or
bumped every time dbs get recreated or design docs are updated. The only time
it would be bumped is if the FDB layer prefix changed at runtime.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, if the metadata key is bumped in a transaction, the same
transaction could not be used to add jobs with `couch_jobs`. That's because
metadata is a versionstamped value, and when set, it cannot be read back until
that transaction has committed. In `fabric2_fdb` there is a process dict key
that is set which declares that metadata was already read, which happens before
any db update, however `couch_jobs` uses it's own caching mechanism and doesn't
know about that pdict key.

Ideally we'd implement a single `couch_fdb` module to be shared between
`couch_jobs` and `fabric2_db` but until then it maybe simpler to just let
`couch_jobs` use its own metadata key. This way, it doesn't get invalidated or
bumped every time dbs get recreated or design docs are updated. The only time
it would be bumped is if the FDB layer prefix changed at runtime.
</pre>
</div>
</content>
</entry>
<entry>
<title>CouchDB background jobs</title>
<updated>2020-03-02T17:20:26+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2019-06-12T20:11:56+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=f10b554b3e0e26eb2a33e0bb991499d180539720'/>
<id>f10b554b3e0e26eb2a33e0bb991499d180539720</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
</feed>
