couchdb-fabric.git
7 years agoallow _cassim as db name setup 101/head
Jan Lehnardt [Fri, 7 Nov 2014 14:33:20 +0000 (15:33 +0100)] 
allow _cassim as db name

7 years agoFix compilation warning
Alexander Shorin [Fri, 10 Oct 2014 15:56:56 +0000 (19:56 +0400)] 
Fix compilation warning

7 years agoDon't flatten iolist
Robert Newson [Mon, 22 Sep 2014 13:18:58 +0000 (14:18 +0100)] 
Don't flatten iolist

7 years agoReturn unauthorized error if encountered on any shard
Robert Newson [Tue, 30 Sep 2014 16:24:59 +0000 (17:24 +0100)] 
Return unauthorized error if encountered on any shard

We had a mismatch here that caused us to return an unpleasant 500
status code (after discarding lots of unauthorized events from each
shard).

The mismatch was introduced in "Teach fabric_util:get_db/2 about maintenance
mode".

I also simplified the open_shard function and tuple syntax for further
clarity in this critical section.

7 years agoUse couch_log instead of ?LOG_*
Alexander Shorin [Wed, 24 Sep 2014 20:26:32 +0000 (00:26 +0400)] 
Use couch_log instead of ?LOG_*

7 years agoRestore write_quorum_errors metric collection
Robert Newson [Mon, 15 Sep 2014 13:37:41 +0000 (14:37 +0100)] 
Restore write_quorum_errors metric collection

7 years agoDon't receive foreign rexi replies
Robert Newson [Fri, 12 Sep 2014 08:55:38 +0000 (09:55 +0100)] 
Don't receive foreign rexi replies

7 years agoTeach fabric_util:get_db/2 about maintenance mode 2325-teach-fabric-get_db-about-maintenance-mode
Mike Wallace [Wed, 10 Sep 2014 11:14:30 +0000 (12:14 +0100)] 
Teach fabric_util:get_db/2 about maintenance mode

If the node servicing a request does not have a shard for the db
involved then fabric_util:get_db/2 can return a shard from a node
which is in maintenance mode. If that node is a replacement node
that has not yet been brought into the cluster then the security
object will be empty.

Because fabric:get_security/2 calls fabric_util:get_db/2 and is in
the code path for authorizing requests at the HTTP layer, this can
result in live nodes returning 403s.

This commit replaces an rpc:call/4 with a rexi:cast/4 and adds
a new rpc endpoint in fabric_rpc for opening single shards. This
uses set_io_priority which will reply with a rexi_EXIT if
maintenance mode is set.

Closes COUCHDB-2325

7 years agoMove maintenance_mode to the couchdb section
Mike Wallace [Wed, 10 Sep 2014 10:02:21 +0000 (11:02 +0100)] 
Move maintenance_mode to the couchdb section

7 years agoAllow clients to pass a db record to query_view
Paul J. Davis [Tue, 9 Sep 2014 23:06:26 +0000 (18:06 -0500)] 
Allow clients to pass a db record to query_view

The recent updates to use couch_mrview prevented the use of a #db{}
record in concjunction with a binary GroupId because the ddoc_cache
doesn't extract the name from a db record and instead uses it as the key
directly.

7 years agoExpose new size values windsor-merge 102/head
Robert Newson [Fri, 22 Aug 2014 18:26:45 +0000 (19:26 +0100)] 
Expose new size values

7 years agoPass #changes_args.db_open_options to couch_db:open/2
Paul J. Davis [Fri, 22 Aug 2014 10:05:40 +0000 (05:05 -0500)] 
Pass #changes_args.db_open_options to couch_db:open/2

7 years agoUpdate fabric to use couch_stats
Paul J. Davis [Thu, 21 Aug 2014 06:22:16 +0000 (01:22 -0500)] 
Update fabric to use couch_stats

7 years agoAdd a no-options adapter to all_docs.
Paul J. Davis [Thu, 14 Aug 2014 18:56:04 +0000 (13:56 -0500)] 
Add a no-options adapter to all_docs.

7 years agoFix use of the rexi:stream2 API
Paul J. Davis [Thu, 14 Aug 2014 18:12:15 +0000 (13:12 -0500)] 
Fix use of the rexi:stream2 API

Bit of a mixup during the merge on this one as it included both the
switch to stream2 as well as the switch to using couch_mrview.

7 years agoFix merge of new changes behaviors
Paul J. Davis [Wed, 13 Aug 2014 21:25:40 +0000 (16:25 -0500)] 
Fix merge of new changes behaviors

7 years agosquashme! stream_last
Robert Newson [Fri, 8 Aug 2014 09:17:51 +0000 (10:17 +0100)] 
squashme! stream_last

7 years agosquashme! use stream2
Robert Newson [Thu, 7 Aug 2014 21:19:16 +0000 (22:19 +0100)] 
squashme! use stream2

7 years agoConsistently log fabric worker timeouts
Mike Wallace [Sat, 11 Jan 2014 22:11:20 +0000 (22:11 +0000)] 
Consistently log fabric worker timeouts

Write a log line for each worker that did not return a response
when a fabric request times out. The format of the log line is:

    fabric_worker_timeout ENDPOINT,NODE,SHARD_NAME

This is intented to be easily consumable by downstream tools
(e.g., Splunk).

BugzID: 26984

7 years agoSet non-interactive default for set_security
Benjamin Bastian [Thu, 13 Mar 2014 02:50:52 +0000 (22:50 -0400)] 
Set non-interactive default for set_security

Prior to this commit, fabric:set_security would default to interactive
IO priority. This would cause all nodes to set the security header
except shards on any nodes which were in MM. Subsequent calls to
fabric:get_security would cause inconsistent security properties to be
applied to the request. This patch sets a non-interactive default for
fabric:set_security, which will cause security updates to be applied to
all nodes regardless of MM by default.

BugzID: 28847

7 years agoClear worker references for get_shard_replacements
Paul J. Davis [Wed, 12 Mar 2014 06:25:35 +0000 (02:25 -0400)] 
Clear worker references for get_shard_replacements

This function relies on record equality. If a request passes workers
that have references defined it would return all copies of the shard
range incorrectly.

BugzId: 28992

7 years agoFix fabric_db_update_listener code upgrades
Paul J. Davis [Fri, 31 Jan 2014 00:40:04 +0000 (18:40 -0600)] 
Fix fabric_db_update_listener code upgrades

Changes procesess waiting idle for db update messages will never upgrade
their code. This just adds a timeout before recursing through the module
exports table to load new code.

BugzId: 27660

7 years agoInclude epoch node in seqs and replacement logic
Adam Kocoloski [Fri, 17 Jan 2014 01:32:48 +0000 (17:32 -0800)] 
Include epoch node in seqs and replacement logic

The {Seq, UUID, Node} triplet uniquely identifies an update in a
cluster.  Including the node that originally accepted the update in
sequences allows us to defend against byzantine cases of shards moving
back and forth between the nodes in a cluster.

This patch updates the sequence generation to include the full triplet
in each element of the _changes sequence.  It also uses the epoch node
instead of the node currently hosting the shard when determining the
safe replacement sequence.

BugzID: 27193

7 years agoMove attachment code into couch_att
Brian Mitchell [Thu, 12 Dec 2013 04:11:48 +0000 (23:11 -0500)] 
Move attachment code into couch_att

This is an attempt to isolate the attachment record and
some related code. This will allow seamless upgrades
over time.

7 years agoAvoid badarith error during cluster upgrade
Adam Kocoloski [Mon, 6 Jan 2014 17:02:18 +0000 (12:02 -0500)] 
Avoid badarith error during cluster upgrade

BugzID: 26631

7 years agoMake _changes?descending=true aware of maint. mode
Adam Kocoloski [Thu, 2 Jan 2014 14:18:37 +0000 (09:18 -0500)] 
Make _changes?descending=true aware of maint. mode

The _changes coordinator was using a one-off thing to get the start
sequence for a database which did not provide any error handling at all.
This patch replaces that one-off with a call to get_db_info/1, which
does include all the normal error handling.

A future enhancement could teach the coordinator to understand a
"sequence" like eof that would cause all the workers to automatically
seek to the end, but I wanted to stay conservative here in order to land
this for the next release.

BugzID: 25944

7 years agoFix logging of errors in _all_docs open_doc calls
Paul J. Davis [Fri, 13 Dec 2013 19:56:44 +0000 (13:56 -0600)] 
Fix logging of errors in _all_docs open_doc calls

Our exception handling accidentally captured the successful return
value. Using try/of/catch we can exit from the of clause without
catching.

BugzId: 26162

7 years agoDon't attempt to replace replacement shards
Paul J. Davis [Thu, 12 Dec 2013 18:58:35 +0000 (12:58 -0600)] 
Don't attempt to replace replacement shards

The old test was looking for {_, _} tuple but that doesn't account for
old since sequences. This just switches to using a negative selection.
The only bad behavior was that we were making lots of log messages about
rewinding from 0 in known conditions.

BugzId: 26125

7 years agoOnly attempt replacement when we have replacements
Paul J. Davis [Thu, 12 Dec 2013 18:51:46 +0000 (12:51 -0600)] 
Only attempt replacement when we have replacements

We weren't checking if we were even provided replacements before using
them. This just adds a guard so we don't end up with a badmatch error on
the `lists:keytake/3`.

BugzId: 26124

7 years agoThrow errors when starting changes streams
Paul J. Davis [Thu, 12 Dec 2013 18:45:10 +0000 (12:45 -0600)] 
Throw errors when starting changes streams

Previously we were calling the user supplied callback on these errors
which caused a badmatch in keep_sending_changes. This just throws the
error and lets chttpd handle formatting it for the user.

BugzId: 26122

7 years agoLog errors when doc reads fail for _all_docs
Paul J. Davis [Thu, 12 Dec 2013 15:25:39 +0000 (09:25 -0600)] 
Log errors when doc reads fail for _all_docs

This makes sure that we log any errors while opening a doc during an
_all_docs request. It also passes the failed DbName and DocId to the
user supplied callback function.

BugzId: 24580

7 years agoBe defensive when calcualting pending_count
Paul J. Davis [Tue, 10 Dec 2013 17:35:22 +0000 (11:35 -0600)] 
Be defensive when calcualting pending_count

Its theoretically possible that during the upgrade we end up with a
mixed set of RPC workers. This makes sure that we don't crash the
coordinator with a badarith error.

BugzId: 24236

7 years agoCollect pending counts and report sum at end
Adam Kocoloski [Thu, 17 Oct 2013 20:33:14 +0000 (16:33 -0400)] 
Collect pending counts and report sum at end

BugzID: 24236

7 years agoReport number of pending changes in shard
Adam Kocoloski [Thu, 17 Oct 2013 18:17:12 +0000 (14:17 -0400)] 
Report number of pending changes in shard

Also refactor the _changes accumulator into a record.

BugzID: 24236

7 years agoRefactor payload to simplify coordinator
Adam Kocoloski [Thu, 17 Oct 2013 18:03:47 +0000 (14:03 -0400)] 
Refactor payload to simplify coordinator

Two things we're doing here:

1) We're unwrapping {doc, {error, Reason}} on the RPC side.
2) We're already suppressing the doc field on the RPC side so we don't
have to duplicate the work on the coordinator.

7 years ago[2/2] Use proplist instead of #change record
Adam Kocoloski [Thu, 17 Oct 2013 17:27:58 +0000 (13:27 -0400)] 
[2/2] Use proplist instead of #change record

7 years agoAdjust replacement rewind exclusion
Paul J. Davis [Fri, 6 Dec 2013 20:44:44 +0000 (14:44 -0600)] 
Adjust replacement rewind exclusion

We're wanting to avoid attempting to use existing replacement
information for down shards. The is_integer guard didn't work because
the sequences are {UUID, Seq} tuples so we pattern match on that tuple
shape instead.

BugzId: 22698

7 years ago[squash] add deprecation info
Adam Kocoloski [Mon, 25 Nov 2013 20:31:47 +0000 (15:31 -0500)] 
[squash] add deprecation info

7 years agoUse smarter replacements for stream_start failures
Adam Kocoloski [Sat, 23 Nov 2013 03:03:22 +0000 (22:03 -0500)] 
Use smarter replacements for stream_start failures

This patch enhances the StartFun to search the original list of workers
for the sequence from which the worker being replaced had started.

BugzID: 22698

7 years agoUse smarter seqs when original shard is down/gone
Adam Kocoloski [Sun, 17 Nov 2013 23:16:07 +0000 (18:16 -0500)] 
Use smarter seqs when original shard is down/gone

If a shard that contributes to a sequence a) is on a down node or b) is
no longer part of the shard set we can provide enough detail to the
replacement workers to allow them to choose a smarter replacement
sequence.

This patch does not cover the case where the shard that originally
contributed to the sequence is alive but crashes before initializing the
stream to the coordinator.  In that case we're still firing up
replacement workers and asking them to stream from zero.  The
stream_start semantics make reworking that bit a tad trickier.

BugzID: 22698

7 years agoCalculate safe worker seq on shard replacement
Adam Kocoloski [Sun, 17 Nov 2013 17:01:05 +0000 (12:01 -0500)] 
Calculate safe worker seq on shard replacement

When a shard is being replaced in the changes feed the RPC workers for
the other shard copies can leverage epoch and checkpoint information to
start from a sequence greater than zero.  This commit (and an associated
one in mem3) make that possible, though we still need to teach the
coordinator to share the fact that the worker is being summoned to
replace another copy that previously contributed to the feed.

BugzID: 22698

7 years agoReport errors opening documents during _all_docs
Adam Kocoloski [Sat, 26 Oct 2013 02:59:23 +0000 (22:59 -0400)] 
Report errors opening documents during _all_docs

All errors are currently ignored in the receive statements and
eventually we timeout.  This patch causes fabric to report the error and
terminate quickly instead of waiting.

BugzID: 24580

7 years agoSwitch from ddoc to id+rev protocol for views
Brian Mitchell [Fri, 25 Oct 2013 15:44:00 +0000 (11:44 -0400)] 
Switch from ddoc to id+rev protocol for views

7 years agoHandle fabric upgrade
Brian Mitchell [Thu, 24 Oct 2013 14:12:58 +0000 (10:12 -0400)] 
Handle fabric upgrade

We still need to handle direct document passing for older
clients. The new Id+Rev protocol will be a part of a
future upgrade.

7 years agoPass document id & rev rather than the whole document
Brian Mitchell [Mon, 21 Oct 2013 17:14:40 +0000 (13:14 -0400)] 
Pass document id & rev rather than the whole document

This uses the ddoc_cache support for revisions. It should
reduce bandwidth overhead of copying documents around.

7 years agoFix inclusion of "doc":"undefined" in changes feed
Paul J. Davis [Tue, 22 Oct 2013 05:02:46 +0000 (00:02 -0500)] 
Fix inclusion of "doc":"undefined" in changes feed

We were reusing the wrong variable after removing the default values.

BugzId: 24356

7 years agoMake all timeouts configurable
Robert Newson [Mon, 21 Oct 2013 17:05:11 +0000 (18:05 +0100)] 
Make all timeouts configurable

BugzID: 24302

7 years agoReplace read_repair logs with a metric
Paul J. Davis [Thu, 17 Oct 2013 20:35:39 +0000 (15:35 -0500)] 
Replace read_repair logs with a metric

Successful read repair notices aren't overly informative. To reduce log
spam we'll just switch to using a metric and only log when we don't have
a successful response.

BugzId: 24262

7 years ago[1/2] Use proplist instead of #change record
Adam Kocoloski [Thu, 17 Oct 2013 15:45:08 +0000 (11:45 -0400)] 
[1/2] Use proplist instead of #change record

This commit lays the groundwork by translating the record into a
proplist.  A follow-on commit will cause the RPC workers to send the
proplist instead of the record.

It also converts the 'complete' tuple into a tagged proplist.

BugzID: 24236

7 years agoProvide replacement shards in changes feeds
Paul J. Davis [Thu, 12 Sep 2013 17:25:33 +0000 (12:25 -0500)] 
Provide replacement shards in changes feeds

BugzId: 20423

7 years agoProvide replacement shards in reduce views
Paul J. Davis [Thu, 12 Sep 2013 15:22:16 +0000 (10:22 -0500)] 
Provide replacement shards in reduce views

BugzId: 20423

7 years agoProvide replacement shards in map views
Paul J. Davis [Thu, 12 Sep 2013 15:22:00 +0000 (10:22 -0500)] 
Provide replacement shards in map views

BugzId: 20423

7 years agoAdd utility function to find shard replacements
Paul J. Davis [Thu, 12 Sep 2013 18:30:40 +0000 (13:30 -0500)] 
Add utility function to find shard replacements

Streaming RPC coordinators can use this function to generate a list of
shard replacements that is suitable to be passed to
fabric_util:stream_start/4.

BugzId: 20423

7 years agoAllow shard replacements in stream_start
Paul J. Davis [Thu, 12 Sep 2013 15:23:48 +0000 (10:23 -0500)] 
Allow shard replacements in stream_start

This adds fabric_util:stream_start/4 which accepts a start function and
a proplist of replacement shards keyed by range. If a worker exits due
to maintenance mode and prevents progress from being made, the list of
replacement shards is searched for any replacements for the range. If
any are found the start function is called for each possible
replacement. The start function takes the possible replacement and
should return the new worker.

BugzId: 20423

7 years agoFix `fabric:get_db_info/1`
Paul J. Davis [Fri, 4 Oct 2013 21:34:11 +0000 (16:34 -0500)] 
Fix `fabric:get_db_info/1`

We weren't properly removing shards that had an error as well as
returning errors to functions that don't expect them.

7 years agoSet io_priority properly for all requests
Paul J. Davis [Fri, 4 Oct 2013 21:35:13 +0000 (16:35 -0500)] 
Set io_priority properly for all requests

Notably, changes wasn't calling set_io_priority so was not affected by
maintenance_mode.

7 years agoUpdate _changes coordinator to use new RPC APIs
Paul J. Davis [Wed, 4 Sep 2013 20:59:39 +0000 (15:59 -0500)] 
Update _changes coordinator to use new RPC APIs

BugzId: 21755

7 years agoRemove test for old reduce view behavior
Paul J. Davis [Wed, 4 Sep 2013 21:23:02 +0000 (16:23 -0500)] 
Remove test for old reduce view behavior

This test is no longer valid because its checking that a complete
message removes other workers from the same range which no longer
happens. This is because fabric_util:stream_start/2 now removes all
workers and returns us a single complete shard ring.

BugzId: 21755

7 years agoUpdate reduce view coordinator to use new RPC APIs
Paul J. Davis [Wed, 4 Sep 2013 21:00:01 +0000 (16:00 -0500)] 
Update reduce view coordinator to use new RPC APIs

BugzId: 21755

7 years agoUpdate map view coordinator to use new RPC APIs
Paul J. Davis [Fri, 6 Sep 2013 12:26:52 +0000 (07:26 -0500)] 
Update map view coordinator to use new RPC APIs

BugzId: 21755

7 years agoUpdate _all_docs coordinator to use new RPC APIs
Paul J. Davis [Wed, 4 Sep 2013 22:28:57 +0000 (17:28 -0500)] 
Update _all_docs coordinator to use new RPC APIs

BugzId: 21755

7 years agoImplement fabric_view:handle_worker_exit/3
Paul J. Davis [Wed, 11 Sep 2013 01:58:38 +0000 (20:58 -0500)] 
Implement fabric_view:handle_worker_exit/3

This is a simple utility function that we can use to cancel a streaming
response when a worker dies. By the time we get here we know that
progress is no longer possible so we report the error and abort the
stream.

7 years agoImplement fabric_view:check_down_shards/2
Paul J. Davis [Wed, 11 Sep 2013 01:56:27 +0000 (20:56 -0500)] 
Implement fabric_view:check_down_shards/2

This replaces fabric_view:remove_down_shards/2 with a check to see if a
rexi_DOWN message affects any of the worker shards. This is because we
monitor all the shards but are only handling messages from a single ring
which may not have included a node in the initial shards list.

We no longer need to remove shards on down nodes because once our stream
handling functions run as soon as we see a shard on a downed node we
know that progress is no longer possible under our current behavior.

7 years agoImplement fabric_util:stream_start/2
Paul J. Davis [Fri, 6 Sep 2013 12:26:32 +0000 (07:26 -0500)] 
Implement fabric_util:stream_start/2

This is a utility function that handles gathering the start of a rexi
stream. It will return a single full hash ring of shards or an error.

BugzId: 21755

7 years agoAdd fabric_dict:fetch_keys/1
Paul J. Davis [Fri, 4 Oct 2013 18:16:03 +0000 (13:16 -0500)] 
Add fabric_dict:fetch_keys/1

7 years agoAdd fabric_dict:is_key/2
Paul J. Davis [Wed, 4 Sep 2013 20:58:42 +0000 (15:58 -0500)] 
Add fabric_dict:is_key/2

BugzId: 21755

7 years agoUse the dollar_endonly option to prevent newlines
Adam Kocoloski [Wed, 16 Oct 2013 17:56:35 +0000 (13:56 -0400)] 
Use the dollar_endonly option to prevent newlines

BugzID: 24203

7 years agoAllow options to all database functions
Paul J. Davis [Mon, 30 Sep 2013 18:52:05 +0000 (13:52 -0500)] 
Allow options to all database functions

This is the first of two commits. The second needs to be in a second
release.

BugzId: 23787

7 years agoAllow to omit seq from some rows in _changes response
Adam Kocoloski [Wed, 2 Oct 2013 01:41:52 +0000 (21:41 -0400)] 
Allow to omit seq from some rows in _changes response

This is a hack to improve the throughput of _changes on databases with
large Q values.  The record-based approach for sharing config options is
a pain to extend so we're going to be dirty and use the pdict here.

BugzID: 23637

7 years agoHandle duplicate docs in bulk update
Benjamin Bastian [Fri, 23 Aug 2013 18:41:48 +0000 (11:41 -0700)] 
Handle duplicate docs in bulk update

Previous to this commit, fabric assumed that all docs in a bulk update
request were unique. In the case that they were not unique, fabric would
error and return a stack trace to the user. This commit makes fabric
identify docs in a bulk update by a ref rather than their id.

This commit is based on work done by Bob Dionne.

BugzID: 12540

7 years agoUpgrade continuous changes feeds to new code
Robert Newson [Tue, 17 Sep 2013 22:33:30 +0000 (23:33 +0100)] 
Upgrade continuous changes feeds to new code

BugzID: 23154

7 years agoRemove (not that successful) downgrade trick
Robert Newson [Tue, 17 Sep 2013 12:31:13 +0000 (13:31 +0100)] 
Remove (not that successful) downgrade trick

7 years agoFix hot upgrade for new since values
Robert Newson [Mon, 16 Sep 2013 21:17:49 +0000 (22:17 +0100)] 
Fix hot upgrade for new since values

7 years agoInclude uuid in since values
Robert Newson [Wed, 11 Sep 2013 15:26:34 +0000 (16:26 +0100)] 
Include uuid in since values

BugzID: 21658

7 years agoHandle bad_request message from worker
Mike Wallace [Wed, 21 Aug 2013 12:51:58 +0000 (13:51 +0100)] 
Handle bad_request message from worker

fabric_doc_update handles bad_request messages that can be sent
by its workers if they fail to parse a multipart/related document.

BugzID: 22593

7 years agoFix changes shard replacement
Paul J. Davis [Fri, 6 Sep 2013 11:17:44 +0000 (06:17 -0500)] 
Fix changes shard replacement

We were unwittingly falling victim to list comprehensions swallowing
exceptions again. The result this time was that anytime we needed to
replace a changes shard we were adding the entire shard map. This means
that any time we were resetting the feed its possible we could have
reset the feed for all shard ranges depending on the rexi worker race.

BugzId: 22808

7 years agoFix invalid reference in edoc
Adam Kocoloski [Fri, 30 Aug 2013 17:01:02 +0000 (13:01 -0400)] 
Fix invalid reference in edoc

BugzID: 10870

7 years agoDowngrade new style since values unintentionally released into the wild
Robert Newson [Wed, 14 Aug 2013 21:05:47 +0000 (22:05 +0100)] 
Downgrade new style since values unintentionally released into the wild

7 years agoRevert "Revert "Revert uuid in changes feeds temporarily""
Robert Newson [Wed, 14 Aug 2013 16:28:28 +0000 (17:28 +0100)] 
Revert "Revert "Revert uuid in changes feeds temporarily""

This reverts commit 92190f71fecf4a22102154231a2de09ad910616c.

7 years agoRevert "Merge pull request #99 from cloudant/fix-fencepost"
Robert Newson [Wed, 14 Aug 2013 16:28:11 +0000 (17:28 +0100)] 
Revert "Merge pull request #99 from cloudant/fix-fencepost"

This reverts commit 1cf3128d139ebd4e1d6055cdcfbdede43febe1be, reversing
changes made to 82223b0e44c83fb60e93f7653a3bebd22ea98bfe.

7 years agoGracefully terminate continuous changes feeds
Robert Newson [Mon, 12 Aug 2013 01:12:28 +0000 (02:12 +0100)] 
Gracefully terminate continuous changes feeds

When maintenance_mode is set to "true" or "nolb", end all active continuous
changes feeds gracefully with a last_seq chunk and clean TCP
termination.

BugzID: 21618

7 years agoValidate epochs
Robert Newson [Sat, 10 Aug 2013 18:19:04 +0000 (19:19 +0100)] 
Validate epochs

7 years agoAdd negative test for fencepost
Robert Newson [Sat, 10 Aug 2013 18:11:29 +0000 (19:11 +0100)] 
Add negative test for fencepost

7 years agoSeparate is_owner logic from owner_of
Robert Newson [Sat, 10 Aug 2013 18:05:49 +0000 (19:05 +0100)] 
Separate is_owner logic from owner_of

7 years agoFix fencepost error
Robert Newson [Sat, 10 Aug 2013 18:02:50 +0000 (19:02 +0100)] 
Fix fencepost error

7 years agoMonitor coordinator pids for update notifiers
Paul J. Davis [Thu, 8 Aug 2013 11:19:32 +0000 (12:19 +0100)] 
Monitor coordinator pids for update notifiers

We were leaking fabric_db_update_listener rexi workers. This uses the
new couch_event configurability to have the workers automatically exit
when the coordinator dies.

7 years agoRevert "Revert uuid in changes feeds temporarily"
Robert Newson [Tue, 30 Jul 2013 23:11:29 +0000 (00:11 +0100)] 
Revert "Revert uuid in changes feeds temporarily"

This reverts commit 0796c6714978fd8302192c24f652c53844373773.

7 years agoRevert uuid in changes feeds temporarily
Robert Newson [Tue, 30 Jul 2013 22:23:23 +0000 (23:23 +0100)] 
Revert uuid in changes feeds temporarily

Reverts;
b271bcceff4dddc255af3e4ae57a1a36d6708b8a 19133-fix-code-upgrade
7102f90a85c80b02229a429185b40817182fbfcb 18726-use-uuid-generation-in-since

7 years agoMake shard open backoff configurable
Benjamin Anderson [Thu, 20 Jun 2013 22:13:00 +0000 (15:13 -0700)] 
Make shard open backoff configurable

7 years agoUse new couch_db APIs for uuids and epochs
Paul J. Davis [Thu, 13 Jun 2013 21:55:25 +0000 (16:55 -0500)] 
Use new couch_db APIs for uuids and epochs

This uses the new API to get the uuid and epochs for a database.

7 years agoSend new since format and rewind better by using it
Robert Newson [Thu, 30 May 2013 17:29:22 +0000 (18:29 +0100)] 
Send new since format and rewind better by using it

BugzID: 18726

7 years agoSupport new and old since values
Robert Newson [Thu, 30 May 2013 17:28:42 +0000 (18:28 +0100)] 
Support new and old since values

BugzID: 18726

7 years agoUse a private record for the callback state
Adam Kocoloski [Fri, 24 May 2013 18:51:07 +0000 (14:51 -0400)] 
Use a private record for the callback state

7 years agoUpdate to use new couch_event application
Paul J. Davis [Wed, 24 Apr 2013 16:32:00 +0000 (11:32 -0500)] 
Update to use new couch_event application

7 years agoEnhance maintenance_mode instead of creating a new mode
Adam Kocoloski [Mon, 29 Apr 2013 17:44:00 +0000 (13:44 -0400)] 
Enhance maintenance_mode instead of creating a new mode

BugzID: 18955

7 years agoSet middleman timeout to fabric request timeout
Paul J. Davis [Fri, 26 Apr 2013 20:10:16 +0000 (15:10 -0500)] 
Set middleman timeout to fabric request timeout

The middleman_loop function in fabric_doc_attachments has a hard coded
ten second timeout. We think this is the cause of ten minute timeouts
seen by some customers. If the RPC workers happent to take more than ten
second to start requesting data (or if they all pause for more than ten
seconds) then the middleman loop dies which triggers the RPC worker
timeout as they wait for attachment data.

This updates the timeout to the fabric per-message timeout which is the
absolute maximum a middleman could go without seeing a message before
the coordinator would exit anyway.

7 years agoRevert "Send a `no_pass` message when a doc fails a filter"
Adam Kocoloski [Fri, 26 Apr 2013 17:44:40 +0000 (13:44 -0400)] 
Revert "Send a `no_pass` message when a doc fails a filter"

This reverts commit 1c47d1b7e1000eb665cbf4bb2a301baa1c3a4d51.  We'll
apply this commit once its parent is deployed.

BugzID: 17709

7 years agoSend a `no_pass` message when a doc fails a filter
Adam Kocoloski [Thu, 25 Apr 2013 19:18:31 +0000 (15:18 -0400)] 
Send a `no_pass` message when a doc fails a filter

BugzID: 17709

7 years agoHandle `no_pass` messages from filtered docs
Adam Kocoloski [Thu, 25 Apr 2013 19:16:57 +0000 (15:16 -0400)] 
Handle `no_pass` messages from filtered docs

BugzID: 17709

7 years agoIssue a timeout even if messages have arrived
Adam Kocoloski [Thu, 25 Apr 2013 19:10:04 +0000 (15:10 -0400)] 
Issue a timeout even if messages have arrived

When processing _changes feeds a timeout message simply generates a
newline in the response body.  We can afford to send a few extra of
those.  This patch allows us to send messages from the workers back to
the coordinator without interfering with the timeout calculation.

BugzID: 17709