couchdb-global-changes.git
22 months agoMerge remote-tracking branch 'cloudant/revert-default-value-for-max_write_delay' master
Paul J. Davis [Wed, 22 Feb 2017 20:21:09 +0000 (14:21 -0600)] 
Merge remote-tracking branch 'cloudant/revert-default-value-for-max_write_delay'

22 months agoRollback change in default value for max_write_delay config 17/head
brkolla [Mon, 20 Feb 2017 18:11:01 +0000 (13:11 -0500)] 
Rollback change in default value for max_write_delay config

The default for `global_change:max_write_delay` config was changed from
500 to 25 and is causing performance regression. Reverting this change
back to 500 is resulting in improved performance.

COUCHDB-3304

2 years agoMerge remote branch 'cloudant:3102-fix-return-value'
ILYA Khlopotov [Fri, 2 Sep 2016 17:39:33 +0000 (10:39 -0700)] 
Merge remote branch 'cloudant:3102-fix-return-value'

This closes #16

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
2 years agoReturn {ok, State} from handle_config_change/5 16/head
ILYA Khlopotov [Fri, 2 Sep 2016 17:19:36 +0000 (10:19 -0700)] 
Return {ok, State} from handle_config_change/5

This is a fixup commit for COUCHDB-3102.
config_listener expects either remove_handler or {ok, State} from the
callback module.

COUCHDB-3102

2 years agouse shard suffix when generating _changes ETag
Robert Newson [Fri, 2 Sep 2016 10:33:02 +0000 (11:33 +0100)] 
use shard suffix when generating _changes ETag

In CouchDB 2.0, instance_start_time is always 0.
This means that when generating ETag values derived
from the database info object, the same ETags can be
incorrectly deemed valid between different database
instances with the metadata.

To avoid this we can incorporate the unique shard
suffix for the database instance when generating
the current ETag value.

Copied from fix by Will Holley in chttpd

COUCHDB-3017

2 years agoMerge remote branch 'cloudant:3102-fix-config_subscription'
ILYA Khlopotov [Tue, 23 Aug 2016 21:59:45 +0000 (14:59 -0700)] 
Merge remote branch 'cloudant:3102-fix-config_subscription'

This closes #15

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
2 years agoUpdate handle_config_terminate API 15/head
ILYA Khlopotov [Wed, 17 Aug 2016 18:55:59 +0000 (11:55 -0700)] 
Update handle_config_terminate API

COUCHDB-3102

2 years agoadd missing change_callback implementation
Jan Lehnardt [Sun, 17 Apr 2016 18:21:37 +0000 (20:21 +0200)] 
add missing change_callback implementation

2 years agoenable feed=eventsource for /_db_updates
Jan Lehnardt [Sun, 17 Apr 2016 17:31:22 +0000 (19:31 +0200)] 
enable feed=eventsource for /_db_updates

The fix is adding `eventsource` to the allowed options to
/_db_updates?feed=eventsource, since the underlying implementation
is a global database‚Äôs _changes feed.

Closes COUCHDB-2665

3 years agoIntegrate with Travis CI 9/head
Alexander Shorin [Sun, 23 Aug 2015 10:32:37 +0000 (13:32 +0300)] 
Integrate with Travis CI

3 years agoMerge remote-tracking branch 'github/pr/13'
Alexander Shorin [Thu, 1 Oct 2015 16:17:24 +0000 (19:17 +0300)] 
Merge remote-tracking branch 'github/pr/13'

3 years agoFix test. 13/head
Nick Vatamaniuc [Thu, 1 Oct 2015 14:48:46 +0000 (10:48 -0400)] 
Fix test.

 Needs global_changes app started and get host from chttpd.

3 years agoPass supervisor's children to couch_epi 12/head
ILYA Khlopotov [Tue, 29 Sep 2015 20:05:05 +0000 (13:05 -0700)] 
Pass supervisor's children to couch_epi

3 years agoUpdate to new couch_epi API
ILYA Khlopotov [Mon, 28 Sep 2015 16:48:59 +0000 (09:48 -0700)] 
Update to new couch_epi API

3 years agoRegister service 11/head
ILYA Khlopotov [Wed, 2 Sep 2015 16:49:00 +0000 (09:49 -0700)] 
Register service

COUCHDB-2796

3 years agoRemove `ignore_providers` option
ILYA Khlopotov [Tue, 1 Sep 2015 13:26:34 +0000 (06:26 -0700)] 
Remove `ignore_providers` option

COUCHDB-2796

3 years agoAdd license header
Alexander Shorin [Sun, 23 Aug 2015 10:31:47 +0000 (13:31 +0300)] 
Add license header

3 years agoMerge remote-tracking branch 'cloudant/epi_hooks'
Robert Newson [Wed, 12 Aug 2015 15:40:06 +0000 (16:40 +0100)] 
Merge remote-tracking branch 'cloudant/epi_hooks'

3 years agoIntroduce `global_changes_plugin:transform_change/3` 8/head
ILYA Khlopotov [Fri, 31 Jul 2015 13:48:56 +0000 (06:48 -0700)] 
Introduce `global_changes_plugin:transform_change/3`

3 years agoMerge remote-tracking branch 'cloudant/chttpd-qs'
Robert Newson [Wed, 29 Jul 2015 15:21:39 +0000 (16:21 +0100)] 
Merge remote-tracking branch 'cloudant/chttpd-qs'

3 years agoHandle waiting_for_updates in callback
Robert Newson [Mon, 27 Jul 2015 12:13:11 +0000 (13:13 +0100)] 
Handle waiting_for_updates in callback

COUCHDB-2724

3 years agoUse `chttpd:qs*` instead of `couch_httpd:qs*` 7/head
ILYA Khlopotov [Thu, 23 Jul 2015 20:12:22 +0000 (13:12 -0700)] 
Use `chttpd:qs*` instead of `couch_httpd:qs*`

3 years agoUse dynamic handlers for `_db_updates` 6/head
ILYA Khlopotov [Wed, 15 Jul 2015 15:47:59 +0000 (08:47 -0700)] 
Use dynamic handlers for `_db_updates`

3 years agoerlang R14-18 compatibility
Robert Newson [Thu, 2 Jul 2015 21:59:49 +0000 (22:59 +0100)] 
erlang R14-18 compatibility

3 years agoFix _db_changes respone format 5/head
ILYA Khlopotov [Mon, 27 Apr 2015 14:41:50 +0000 (07:41 -0700)] 
Fix _db_changes respone format

We are not suppose to return `account` field
`dnname` field is renamed to `db_name`

COUCHDB-2667

3 years agoFix indentation
ILYA Khlopotov [Mon, 27 Apr 2015 14:41:29 +0000 (07:41 -0700)] 
Fix indentation

3 years agoMake global_changes database system one
Alexander Shorin [Sat, 18 Apr 2015 13:33:47 +0000 (16:33 +0300)] 
Make global_changes database system one

3 years agohandle heartbeat=false
Robert Newson [Sat, 11 Apr 2015 15:37:59 +0000 (16:37 +0100)] 
handle heartbeat=false

3 years agoMerge remote-tracking branch 'iilyak/2585-allowed_owner-hook'
Alexander Shorin [Fri, 27 Feb 2015 14:47:48 +0000 (17:47 +0300)] 
Merge remote-tracking branch 'iilyak/2585-allowed_owner-hook'

This closes #3

3 years agoValidate callback defined 3/head
ILYA Khlopotov [Tue, 24 Feb 2015 21:17:54 +0000 (13:17 -0800)] 
Validate callback defined

COUCHDB-2585

3 years agoUse `config` module for `allowed_owner` setting
ILYA Khlopotov [Wed, 18 Feb 2015 15:48:16 +0000 (07:48 -0800)] 
Use `config` module for `allowed_owner` setting

COUCHDB-2585

3 years agoIntroduce an `allowed_owner` hook
ILYA Khlopotov [Mon, 16 Feb 2015 20:05:57 +0000 (12:05 -0800)] 
Introduce an `allowed_owner` hook

COUCHDB-2585

3 years agoMerge remote-tracking branch 'iilyak/2561-make-config-API-consistent'
Alexander Shorin [Wed, 4 Feb 2015 15:43:19 +0000 (18:43 +0300)] 
Merge remote-tracking branch 'iilyak/2561-make-config-API-consistent'

This closes #2

COUCHDB-2561

3 years agoDon't restart event handler on termination 2/head
ILYA Khlopotov [Fri, 30 Jan 2015 19:20:28 +0000 (11:20 -0800)] 
Don't restart event handler on termination

COUCHDB-2561

3 years agoUpdate config_listener behaviuor
ILYA Khlopotov [Thu, 29 Jan 2015 21:50:58 +0000 (13:50 -0800)] 
Update config_listener behaviuor

COUCHDB-2561

3 years agoUse ADMIN_CTX macro from couch_db.hrl
Alexander Shorin [Mon, 26 Jan 2015 04:06:33 +0000 (07:06 +0300)] 
Use ADMIN_CTX macro from couch_db.hrl

3 years agoOpen global changes db with admin context 43665-open-db-with-admin-ctx
Robert Newson [Fri, 23 Jan 2015 16:33:33 +0000 (16:33 +0000)] 
Open global changes db with admin context

The global changes feed should work even if the security object says otherwise.

BugzID: 43665

4 years agoFix LICENSE indention
Alexander Shorin [Mon, 22 Dec 2014 15:14:18 +0000 (18:14 +0300)] 
Fix LICENSE indention

4 years agoFix race condition by relying on admin only windsor-merge
Paul J. Davis [Fri, 22 Aug 2014 10:05:59 +0000 (05:05 -0500)] 
Fix race condition by relying on admin only

Since we no longer have to worry about filtering for users we can let
fabric take care of the underlying limit implementation for now. Without
this there's a race condition where fabric will wait for Timeout seconds
before actually stopping. Any activity in that window will be sent
through the callback and forwarded on to clients. There's probably a way
to fix that but my brain isn't working so well right now.

4 years agoUpdate to use couch_stats
Paul J. Davis [Thu, 21 Aug 2014 06:56:48 +0000 (01:56 -0500)] 
Update to use couch_stats

4 years agoReimplement global_change rate limiting
Paul J. Davis [Wed, 13 Aug 2014 20:54:17 +0000 (15:54 -0500)] 
Reimplement global_change rate limiting

Rather than just checking when a change occurs to update we instead just
update after max_write_delay milliseconds.

4 years agoAdd ASF license
Robert Newson [Wed, 16 Jul 2014 12:06:58 +0000 (13:06 +0100)] 
Add ASF license

4 years agoRaise default global_changes max_write_delay & max_event_delay to 500ms
robfraz [Thu, 20 Feb 2014 13:48:19 +0000 (13:48 +0000)] 
Raise default global_changes max_write_delay & max_event_delay to 500ms

BugzID: 28257

4 years agoUse gen_server:cast rather than rexi RPCs
Benjamin Bastian [Wed, 19 Feb 2014 21:41:28 +0000 (13:41 -0800)] 
Use gen_server:cast rather than rexi RPCs

Prior to this commit, the global_changes_listener would send updates to
the global_changes_server via a rexi RPC which only did a
gen_server:call. This is needlessly heavyweight and would cause
gen_server:call timeout errors when the global_changes_server was slow
(usually due to slow disk IO). This commit removes the rexi RPC and
replaces it with a gen_server:cast.

Since this causes all global_changes_server handlers to not reply, this
commit also removes the format_reply function as it's unnecessary.

BugzID: 28242

4 years agoMake changes_callback end request when limit=1
Benjamin Bastian [Fri, 13 Dec 2013 22:31:30 +0000 (14:31 -0800)] 
Make changes_callback end request when limit=1

Prior to this commit, the limit was hit when limit=0 by the first
changes_callback function clause. This makes maybe_finish end the
request when limit=1, so that it doesn't have to wait for another change
to end the request.

BugzID: 26166

4 years agoThis was a silly off-by-one error while counting
Paul J. Davis [Fri, 13 Dec 2013 20:38:23 +0000 (14:38 -0600)] 
This was a silly off-by-one error while counting

The start message doesn't count as a row so we don't want to adjust
Acc#acc.limit based on that message.

BugzId: 26165

4 years agoFix limit=N for non-admins by counting post-filter
Benjamin Bastian [Tue, 10 Dec 2013 21:50:00 +0000 (13:50 -0800)] 
Fix limit=N for non-admins by counting post-filter

Prior to this commit, the _db_updates endpoint would often return less
than N results for limit=N queries, even when there were N changes to
return. This was because the limiting was done by passing the limit
parameter to fabric:changes, which doesn't account for the per-user
filtering done in global_changes_httpd.

This commit adds explicit counting of the filtered changes in
global_changes_httpd and manually ends the request when N post-filter
changes have been seen.

BugzID: 25272

4 years agoFix changes API usage for new pending values
Paul J. Davis [Thu, 12 Dec 2013 18:33:50 +0000 (12:33 -0600)] 
Fix changes API usage for new pending values

BugzId: 26119

4 years agoset module version to 1
Robert Newson [Fri, 22 Nov 2013 16:54:32 +0000 (16:54 +0000)] 
set module version to 1

4 years agoFix heartbeat=true for db_updates feeds
Benjamin Bastian [Tue, 15 Oct 2013 18:50:07 +0000 (11:50 -0700)] 
Fix heartbeat=true for db_updates feeds

This commit fixes some bad case clause ordering. It'd match 'true' to a
variable when the variable should only either be false or a number.

BugzID: 24170

4 years agoAdd the initial version of the global_changes app.
Benjamin Bastian [Fri, 6 Sep 2013 01:33:38 +0000 (18:33 -0700)] 
Add the initial version of the global_changes app.

BugzID: 17681

4 years agoInitial commit.
Benjamin Bastian [Fri, 9 Aug 2013 12:47:35 +0000 (13:47 +0100)] 
Initial commit.