capistrant commented on code in PR #20063:
URL: https://github.com/apache/druid/pull/20063#discussion_r3822458494


##########
server/src/main/java/org/apache/druid/metadata/SQLMetadataRuleManager.java:
##########
@@ -336,7 +321,9 @@ public boolean overrideRule(final String dataSource, final 
List<Rule> newRules,
     final String ruleString;
     try {
       ruleString = jsonMapper.writeValueAsString(newRules);
-      if 
(ruleString.equals(jsonMapper.writeValueAsString(rules.get().get(dataSource)))) 
{
+      // Deliberately a nullable lookup: an unknown datasource must not 
compare equal to an
+      // empty rule list, otherwise setting empty rules on it would silently 
be a no-op.

Review Comment:
   The effective rules is the same. This was more for explicit 
correctness/auditability in cases where explicit empty list applied to a 
datasource with no previous rules wanted to be tracked rather than short 
circuited as a no-op



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to