davisp commented on a change in pull request #495: Couchdb 3288 mixed cluster 
upgrade
URL: https://github.com/apache/couchdb/pull/495#discussion_r116238559
 
 

 ##########
 File path: src/couch/src/couch_server.erl
 ##########
 @@ -465,11 +470,12 @@ handle_call({delete, DbName, Options}, _From, Server) ->
     Error ->
         {reply, Error, Server}
     end;
-handle_call({db_updated, #db{}=Db}, _From, Server0) ->
-    #db{name = DbName, instance_start_time = StartTime} = Db,
-    Server = try ets:lookup_element(couch_dbs, DbName, 
#db.instance_start_time) of
+handle_call({db_updated, Db}, _From, Server0) ->
+    DbName = couch_db:name(Db),
+    StartTime = couch_db:get_instance_start_time(Db),
+    Server = try ets:lookup_element(couch_dbs, DbName, #entry.start_time) of
         StartTime ->
-            true = ets:insert(couch_dbs, Db),
+            true = ets:update_element(couch_dbs, DbName, {#entry.db, Db}),
 
 Review comment:
   Nope. We just asserted it was in the table when we extracted StartTime and 
this is the only process that modifies the table so it should be there. Or, 
rather, if its not there then we should crash hard cause ets has lost its mind.
 
----------------------------------------------------------------
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

Reply via email to