davisp commented on a change in pull request #495: Couchdb 3288 mixed cluster
upgrade
URL: https://github.com/apache/couchdb/pull/495#discussion_r115767536
##########
File path: src/couch/src/couch_db.erl
##########
@@ -112,9 +198,31 @@ reopen(#db{main_pid = Pid, fd = Fd, fd_monitor = OldRef,
user_ctx = UserCtx}) ->
{ok, NewDb#db{user_ctx = UserCtx, fd_monitor = NewRef}}
end.
+incref(#db{fd = Fd} = Db) ->
+ Ref = erlang:monitor(process, Fd),
+ {ok, Db#db{fd_monitor = Ref}}.
+
+clustered_db(DbName, UserCtx) ->
+ clustered_db(DbName, UserCtx, []).
+
+clustered_db(DbName, UserCtx, SecProps) ->
+ {ok, #db{name = DbName, user_ctx = UserCtx, security = SecProps}}.
+
+is_db(#db{}) ->
+ true;
+is_db(_) ->
Review comment:
Narp. There are very few operations that we want to support on shared
database records (and eventually I'd like to remove them but didn't want to mix
PRs). But its limited on purpose to be name, user_ctx, and security objects
that can be read.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services