nickva commented on code in PR #4813:
URL: https://github.com/apache/couchdb/pull/4813#discussion_r1408661762


##########
src/config/src/config.erl:
##########
@@ -315,6 +315,19 @@ handle_call({delete, Sec, Key, Persist, Reason}, _From, 
Config) ->
             _ ->
                 ok
         end,
+    % If persistent, there will always be a delete marker just written
+    % in the last .ini file, so only reload in the non-persistent case.
+    Persist orelse
+        begin
+            IniMap = ini_map(Config#config.ini_files),
+            case maps:find({Sec, Key}, IniMap) of
+                % ?DELETE markers not inserted
+                {ok, Val} when is_list(Val) ->
+                    true = ets:insert(?MODULE, {{Sec, Key}, Val});
+                _ ->
+                    ok
+            end

Review Comment:
   I wonder how this behavior would work?
   
   If delete marker is not persisted, it seems it should only affect whether it 
gets written to the last file in the chain or not, otherwise the "live" value 
should be the same if persisted or not persisted case. With the new behavior, 
it seems, if `Persisted = false` we'd actually load the last non-deleted value 
from the .ini chain.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to