You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2017/09/19 19:15:40 UTC
[1/5] couchdb-cassim git commit: Enable cassim by default [Forced
Update!]
Repository: couchdb-cassim
Updated Branches:
refs/heads/COUCHDB-3288-remove-public-db-record 89047a0a3 -> 86bf25f9b (forced update)
Enable cassim by default
COUCHDB-2879
Project: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/commit/ab1ef1ce
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/tree/ab1ef1ce
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/diff/ab1ef1ce
Branch: refs/heads/COUCHDB-3288-remove-public-db-record
Commit: ab1ef1cee5f7b7ec1733e44845c1df99fc7a66a3
Parents: 9bbfe82
Author: Alexander Shorin <kx...@apache.org>
Authored: Tue Nov 10 03:41:14 2015 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Fri Nov 13 02:52:43 2015 +0300
----------------------------------------------------------------------
src/cassim.erl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-cassim/blob/ab1ef1ce/src/cassim.erl
----------------------------------------------------------------------
diff --git a/src/cassim.erl b/src/cassim.erl
index 65d942c..aeebb2a 100644
--- a/src/cassim.erl
+++ b/src/cassim.erl
@@ -51,7 +51,7 @@ is_active() ->
is_enabled() ->
- config:get_boolean("cassim", "enable", false).
+ config:get_boolean("cassim", "enable", true).
metadata_db_exists() ->
[5/5] couchdb-cassim git commit: Remove public db record
Posted by da...@apache.org.
Remove public db record
COUCHDB-3288
Project: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/commit/86bf25f9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/tree/86bf25f9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/diff/86bf25f9
Branch: refs/heads/COUCHDB-3288-remove-public-db-record
Commit: 86bf25f9b4485fe5aa76661d43a0ebb5c620e8cb
Parents: 7f03449
Author: Paul J. Davis <pa...@gmail.com>
Authored: Thu Feb 16 09:57:26 2017 -0600
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Tue Sep 19 14:14:18 2017 -0500
----------------------------------------------------------------------
src/cassim_security.erl | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-cassim/blob/86bf25f9/src/cassim_security.erl
----------------------------------------------------------------------
diff --git a/src/cassim_security.erl b/src/cassim_security.erl
index 08fe791..93c19f5 100644
--- a/src/cassim_security.erl
+++ b/src/cassim_security.erl
@@ -38,9 +38,7 @@ get_security(DbName) ->
get_security(DbName, [?ADMIN_CTX]).
-get_security(#db{name=DbName}, Options) ->
- get_security(DbName, Options);
-get_security(DbName, Options) ->
+get_security(DbName, Options) when is_binary(DbName) ->
case cassim:is_active() of
true ->
UserCtx = couch_util:get_value(user_ctx, Options, #user_ctx{}),
@@ -50,7 +48,9 @@ get_security(DbName, Options) ->
{proplists:delete(<<"_id">>, SecProps)};
false ->
fabric:get_security(DbName, Options)
- end.
+ end;
+get_security(Db, Options) ->
+ get_security(couch_db:name(Db), Options).
get_security_doc(DbName) when is_binary(DbName) ->
@@ -90,20 +90,22 @@ set_security(DbName, SecProps) ->
set_security(DbName, SecProps, [?ADMIN_CTX]).
-set_security(#db{name=DbName0}, #doc{}=SecDoc0, Options) ->
+set_security(DbName0, #doc{}=SecDoc0, Options) when is_binary(DbName0) ->
DbName = mem3:dbname(DbName0),
MetaId = cassim_metadata_cache:security_meta_id(DbName),
SecDoc = SecDoc0#doc{id=MetaId},
UserCtx = couch_util:get_value(user_ctx, Options, #user_ctx{}),
MetaDbName = cassim_metadata_cache:metadata_db(),
- MetaDb = #db{name=MetaDbName, user_ctx=?ADMIN_USER},
+ MetaDb = couch_db:clustered_db(MetaDbName, ?ADMIN_USER),
cassim:verify_admin_role(UserCtx),
ok = validate_security_doc(SecDoc),
{Status, Etag, {Body0}} =
chttpd_db:update_doc(MetaDb, MetaId, SecDoc, Options),
Body = {proplists:delete(<<"_id">>, Body0)},
ok = cassim_metadata_cache:cleanup_old_docs(MetaId),
- {Status, Etag, Body}.
+ {Status, Etag, Body};
+set_security(Db, SecDoc, Options) ->
+ set_security(couch_db:name(Db), SecDoc, Options).
migrate_security_props(DbName0, {SecProps}) ->
@@ -111,7 +113,7 @@ migrate_security_props(DbName0, {SecProps}) ->
MetaId = cassim_metadata_cache:security_meta_id(DbName),
SecDoc = #doc{id=MetaId, body={SecProps}},
MetaDbName = cassim_metadata_cache:metadata_db(),
- MetaDb = #db{name=MetaDbName, user_ctx=?ADMIN_USER},
+ MetaDb = couch_db:clustered_db(MetaDbName, ?ADMIN_USER),
%% Better way to construct a new #doc{} with the rev?
{_, _, {Body}} = chttpd_db:update_doc(MetaDb, MetaId, SecDoc, [?ADMIN_CTX]),
Rev = proplists:get_value(rev, Body),
@@ -149,8 +151,5 @@ validate_roles_list(Field, _Roles) ->
check_is_member(UserCtx, SecProps) ->
- FakeDb = #db{
- security = SecProps,
- user_ctx = UserCtx
- },
+ {ok, FakeDb} = couch_db:clustered_db(<<"foo">>, UserCtx, SecProps),
couch_db:check_is_member(FakeDb).
[3/5] couchdb-cassim git commit: Don't exit on timeout callback in
cassim metadata cache
Posted by da...@apache.org.
Don't exit on timeout callback in cassim metadata cache
Previously changes feed process exited after timeout message then a new
listener process was spawned after 5 seconds.
COUCHDB-3267
Project: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/commit/b3bfd65b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/tree/b3bfd65b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/diff/b3bfd65b
Branch: refs/heads/COUCHDB-3288-remove-public-db-record
Commit: b3bfd65bcb6246c2cf14a042b9afd13ff8fecab5
Parents: ab1ef1c
Author: Nick Vatamaniuc <va...@apache.org>
Authored: Tue Jan 3 17:32:50 2017 -0500
Committer: Nick Vatamaniuc <va...@apache.org>
Committed: Fri Jan 6 10:53:35 2017 -0500
----------------------------------------------------------------------
src/cassim_metadata_cache.erl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-cassim/blob/b3bfd65b/src/cassim_metadata_cache.erl
----------------------------------------------------------------------
diff --git a/src/cassim_metadata_cache.erl b/src/cassim_metadata_cache.erl
index ceb6c9e..8babd8e 100644
--- a/src/cassim_metadata_cache.erl
+++ b/src/cassim_metadata_cache.erl
@@ -184,7 +184,7 @@ changes_callback({change, {Change}}, _) ->
end,
{ok, couch_util:get_value(seq, Change)};
changes_callback(timeout, EndSeq) ->
- exit({seq, EndSeq});
+ {ok, EndSeq};
changes_callback({error, database_does_not_exist}, _EndSeq) ->
exit({error, database_does_not_exist});
changes_callback({error, _}, EndSeq) ->
[2/5] couchdb-cassim git commit: Fix changes callback function clause
for stop event
Posted by da...@apache.org.
Fix changes callback function clause for stop event
Project: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/commit/33bf3bb3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/tree/33bf3bb3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/diff/33bf3bb3
Branch: refs/heads/COUCHDB-3288-remove-public-db-record
Commit: 33bf3bb3104b4d3dda903fce67937e3dfbe58ffb
Parents: ab1ef1c
Author: Alexander Shorin <kx...@apache.org>
Authored: Wed Mar 9 23:10:51 2016 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Wed Mar 9 23:10:51 2016 +0300
----------------------------------------------------------------------
src/cassim_metadata_cache.erl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-cassim/blob/33bf3bb3/src/cassim_metadata_cache.erl
----------------------------------------------------------------------
diff --git a/src/cassim_metadata_cache.erl b/src/cassim_metadata_cache.erl
index ceb6c9e..25e0937 100644
--- a/src/cassim_metadata_cache.erl
+++ b/src/cassim_metadata_cache.erl
@@ -166,7 +166,7 @@ changes_callback(waiting_for_updates, Acc) ->
{ok, Acc};
changes_callback(start, Since) ->
{ok, Since};
-changes_callback({stop, EndSeq}, _) ->
+changes_callback({stop, EndSeq, _Pending}, _) ->
exit({seq, EndSeq});
changes_callback({change, {Change}}, _) ->
Id = couch_util:get_value(id, Change),
[4/5] couchdb-cassim git commit: Merge remote-tracking branch
'github/pr/9'
Posted by da...@apache.org.
Merge remote-tracking branch 'github/pr/9'
Project: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/commit/7f034497
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/tree/7f034497
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/diff/7f034497
Branch: refs/heads/COUCHDB-3288-remove-public-db-record
Commit: 7f03449703edd3ac1989e1fd3affc8f5c68e20bb
Parents: b3bfd65 33bf3bb
Author: Alexander Shorin <kx...@apache.org>
Authored: Tue Jan 10 22:38:43 2017 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue Jan 10 22:38:43 2017 +0300
----------------------------------------------------------------------
src/cassim_metadata_cache.erl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-cassim/blob/7f034497/src/cassim_metadata_cache.erl
----------------------------------------------------------------------