bhabegger commented on code in PR #3076:
URL: https://github.com/apache/jackrabbit-oak/pull/3076#discussion_r3894686174
##########
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:
My take on this one:
- if it's a bug for which we are confident on the fix and that it is a
really issue -> default on, toggle back to fals for cases where the bug has
become a "feature"
- if it's a new feature we would first like to test in some scenarios ->
default off, toggle on in the specific cases where we want to test and once
validated toggle externally for all cases.
Here we are in the first case. Cost is wrong for property and node types so
we should make it opt out.
--
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]