ChlineSaurus commented on code in PR #3076:
URL: https://github.com/apache/jackrabbit-oak/pull/3076#discussion_r3894772744


##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java:
##########
@@ -75,6 +77,24 @@ public class PropertyIndexLookup {
      */
     static final int MAX_COST = 100;
 
+    /**
+     * Feature toggle name for the configurable costPerEntry/costPerExecution
+     * cost formula (OAK-12348).
+     */
+    public static final String FT_OAK_12348 = "FT_OAK-12348";
+
+    /**
+     * When {@code true} (the default), {@link #getCost} reads {@code 
costPerEntry}/
+     * {@code costPerExecution} from the index definition ({@link 
#getCostConfigurable}).
+     * When {@code false}, {@link #getCost} uses the original hardcoded formula
+     * ({@link #getCostLegacy}) unconditionally, ignoring those properties 
even if
+     * set. Enabled by default: the new formula reproduces the legacy one 
exactly
+     * whenever {@code costPerEntry}/{@code costPerExecution} are absent, so 
this is
+     * a behavior-preserving default for anyone not using the new properties 
-- the
+     * toggle exists as an escape hatch, not as an opt-in gate.
+     */
+    public static final AtomicBoolean FT_OAK_12348_ENABLE = new 
AtomicBoolean(true);

Review Comment:
   Yes, agree. 
   I also think it's good like this, as it works much faster while still 
providing the safety of being able to turn off the behavior.
   
   I'm just asking because after the index regression in Oak 2.0.0 we discussed 
that it is not optimal if too many changes arrive at once. If there are 
regressions it is more difficult to know where they are coming from. 



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