bhabegger commented on code in PR #3076:
URL: https://github.com/apache/jackrabbit-oak/pull/3076#discussion_r3895584425
##########
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:
I would say that this is not really a toggle issue. In a PR you just can't
know what will land in the next release. Maybe the defaults should be chosen at
release time to see which fixes we want in, but then that means revisiting how
we put toggles in.
--
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]